修改枚举展示
parent
aa1ecaf1fe
commit
cf6a7d9166
|
@ -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("}");
|
||||
|
|
Loading…
Reference in New Issue