From cf6a7d916688c950756515f1ac0d312e33340970 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 24 Oct 2024 18:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/DictionaryService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index eb300531f..1f957a530 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -26,7 +26,6 @@ namespace IRaCIS.Core.Application.Service IRepository _readingQuestionCriterionTrial, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDictionaryService { - public async Task GenerateEnumDefine(string code) { var searchList = await _dicRepository.Where(t => t.Parent.Code == code && t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); @@ -40,8 +39,13 @@ namespace IRaCIS.Core.Application.Service foreach (var item in searchList) { + // 添加 XML 注释作为枚举描述 + enumCode.AppendLine($" /// "); + enumCode.AppendLine($" /// {item.ValueCN}"); // 假设你有一个描述字段 + enumCode.AppendLine($" /// "); // 每个枚举值生成 - enumCode.AppendLine($" {item.Code} = {item.ValueCN},"); + enumCode.AppendLine($" {item.Value.Trim().Replace(" ", "")} = {item.Code},"); + } enumCode.AppendLine("}");