修改枚举展示

IRC_NewDev
hang 2024-10-24 18:05:41 +08:00
parent aa1ecaf1fe
commit cf6a7d9166
1 changed files with 6 additions and 2 deletions

View File

@ -26,7 +26,6 @@ namespace IRaCIS.Core.Application.Service
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDictionaryService
{
public async Task<IResponseOutput> GenerateEnumDefine(string code)
{
var searchList = await _dicRepository.Where(t => t.Parent.Code == code && t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).ToListAsync();
@ -40,8 +39,13 @@ namespace IRaCIS.Core.Application.Service
foreach (var item in searchList)
{
// 添加 XML 注释作为枚举描述
enumCode.AppendLine($" /// <summary>");
enumCode.AppendLine($" /// {item.ValueCN}"); // 假设你有一个描述字段
enumCode.AppendLine($" /// </summary>");
// 每个枚举值生成
enumCode.AppendLine($" {item.Code} = {item.ValueCN},");
enumCode.AppendLine($" {item.Value.Trim().Replace(" ", "")} = {item.Code},");
}
enumCode.AppendLine("}");