refactor: 完善枚举系统与状态类型转换,新增枚举管理接口
1. 为所有枚举添加Description特性用于中文描述 2. 移除实体类中冗余的状态字段注释与定义 3. 将所有枚举状态参数改为int类型转换,统一数据交互格式 4. 新增系统管理枚举查询接口与实现,支持获取所有枚举元数据 5. 调整宠物服务模板状态更新接口参数类型
This commit is contained in:
@ -50,7 +50,7 @@ public class UserJournalService(
|
||||
}
|
||||
|
||||
// 校验期刊状态
|
||||
if (journal.Status != JournalStatusEnum.Published)
|
||||
if (journal.Status != (int)JournalStatusEnum.Published)
|
||||
{
|
||||
logger.LogWarning("绑定期刊失败,期刊未发布,JournalId: {JournalId}, Status: {Status}", input.JournalId, journal.Status);
|
||||
throw new BusinessException("该期刊暂未发布,无法绑定", 400);
|
||||
@ -77,7 +77,7 @@ public class UserJournalService(
|
||||
JournalId = input.JournalId,
|
||||
Id = input.Id,
|
||||
Type = Enum.Parse<UserJournalTypeEnum>(input.Type, true),
|
||||
Status = UserJournalStatusEnum.Active,
|
||||
Status = (int)UserJournalStatusEnum.Active,
|
||||
IsDeleted = false,
|
||||
CreatedBy = userId.ToString(),
|
||||
CreatedAt = DateTime.Now,
|
||||
|
||||
Reference in New Issue
Block a user