From 0126c6b0972c29b4dfb4d161cdb2a41584e561ca Mon Sep 17 00:00:00 2001 From: glz <694770232@qq.com> Date: Mon, 8 Jun 2026 17:54:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E7=B3=BB=E7=BB=9F=E4=B8=8E=E7=8A=B6=E6=80=81=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=BD=AC=E6=8D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 为所有枚举添加Description特性用于中文描述 2. 移除实体类中冗余的状态字段注释与定义 3. 将所有枚举状态参数改为int类型转换,统一数据交互格式 4. 新增系统管理枚举查询接口与实现,支持获取所有枚举元数据 5. 调整宠物服务模板状态更新接口参数类型 --- .../IPetService.cs | 2 +- .../ISystemManagementService.cs | 15 ++++ .../Dto/SystemManagement/EnumInfoOutput.cs | 40 ++++++++++ .../Entity/CheckInConfig.cs | 7 -- .../Entity/CommunityMessageComment.cs | 7 -- .../Entity/CommunityTemplateSentence.cs | 7 -- .../Entity/CompensationTask.cs | 6 -- .../Entity/DotFile.cs | 6 -- .../Entity/DotFileDetail.cs | 6 -- .../Entity/ExchangeRecord.cs | 6 -- .../Entity/Journal.cs | 7 -- .../Entity/JournalPage.cs | 7 -- .../Entity/PetEvolution.cs | 7 -- .../Entity/PetFeedingRecord.cs | 6 -- .../Entity/PetTemplate.cs | 6 -- .../Entity/PointsRecord.cs | 6 -- .../Entity/UserBag.cs | 6 -- .../Entity/UserJournal.cs | 7 -- .../Entity/UserMedal.cs | 7 -- .../Entity/UserPet.cs | 7 -- .../Entity/Users.cs | 7 -- .../Enum/AdminUserStatusEnum.cs | 22 ++++++ .../Enum/AdminUserTypeEnum.cs | 7 +- .../Enum/CheckInConfigStatusEnum.cs | 4 + .../Enum/CheckInConfigTypeEnum.cs | 4 + .../Enum/CheckInRecordStatusEnum.cs | 10 ++- .../Enum/CheckInRecordTypeEnum.cs | 4 + .../Enum/CommunityMessageCommentStatusEnum.cs | 4 + .../Enum/CommunityMessageCommentTypeEnum.cs | 3 + .../Enum/CommunityMessageLikeTypeEnum.cs | 3 + .../CommunityTemplateSentenceStatusEnum.cs | 4 + .../Enum/CommunityTemplateSentenceTypeEnum.cs | 5 ++ .../Enum/CompensationTaskStatusEnum.cs | 7 ++ .../Enum/CompensationTaskTypeEnum.cs | 6 ++ .../Enum/DotFileDetailStatusEnum.cs | 7 ++ .../Enum/DotFileStatusEnum.cs | 7 ++ .../Enum/ExchangeRecordStatusEnum.cs | 4 + .../Enum/JournalCatalogTypeEnum.cs | 4 + .../Enum/JournalPageStatusEnum.cs | 5 ++ .../Enum/JournalPageTaskTypeEnum.cs | 6 ++ .../Enum/JournalStatusEnum.cs | 5 ++ .../Enum/JournalTypeEnum.cs | 4 + .../Enum/MedalTypeEnum.cs | 4 + .../Enum/MessageStatusEnum.cs | 5 ++ .../Enum/MessageTypeEnum.cs | 5 ++ .../Enum/PetEvolutionStatusEnum.cs | 4 + .../Enum/PetEvolutionTypeEnum.cs | 4 + .../Enum/PetFeedingRecordStatusEnum.cs | 10 ++- .../Enum/PetFeedingRecordTypeEnum.cs | 4 + .../Enum/PetSkinImageTypeEnum.cs | 4 + .../Enum/PetSkinTypeEnum.cs | 5 ++ .../Enum/PetTemplateStatusEnum.cs | 4 + .../Enum/PetTemplateTypeEnum.cs | 5 ++ .../Enum/PointsChangeTypeEnum.cs | 11 +++ .../Enum/PointsFlowTypeEnum.cs | 4 + .../Enum/PointsRecordStatusEnum.cs | 5 ++ .../Enum/ProductTypeEnum.cs | 4 + .../Enum/UserBagStatusEnum.cs | 4 + .../Enum/UserBagTypeEnum.cs | 4 + .../Enum/UserJournalStatusEnum.cs | 4 + .../Enum/UserJournalTypeEnum.cs | 5 ++ .../Enum/UserMedalStatusEnum.cs | 4 + .../Enum/UserMedalTypeEnum.cs | 4 + .../Enum/UserPetStatusEnum.cs | 5 ++ .../Enum/UserPetTypeEnum.cs | 3 + .../Enum/UserStatusEnum.cs | 4 + .../Enum/UsersTypeEnum.cs | 4 + .../CheckInService.cs | 6 +- .../CompensationManageService.cs | 14 ++-- .../CompensationTaskService.cs | 16 ++-- .../MedalService.cs | 8 +- .../PetService.cs | 24 +++--- .../PointsService.cs | 8 +- .../SystemManagementService.cs | 73 +++++++++++++++++++ .../UserJournalService.cs | 4 +- .../UsersService.cs | 2 +- .../WeChatAuthService.cs | 4 +- .../WeChatCommunityService.cs | 2 +- .../WxMallService.cs | 18 ++--- .../Controllers/PetManageController.cs | 2 +- .../Controllers/SystemManagementController.cs | 46 ++++++++++++ 81 files changed, 470 insertions(+), 176 deletions(-) create mode 100644 QYZH.InteractiveMagazine.IService/ISystemManagementService.cs create mode 100644 QYZH.InteractiveMagazine.Models/Dto/SystemManagement/EnumInfoOutput.cs create mode 100644 QYZH.InteractiveMagazine.Models/Enum/AdminUserStatusEnum.cs create mode 100644 QYZH.InteractiveMagazine.Service/SystemManagementService.cs create mode 100644 QYZH.InteractiveMagazine.WebApi/Controllers/SystemManagementController.cs diff --git a/QYZH.InteractiveMagazine.IService/IPetService.cs b/QYZH.InteractiveMagazine.IService/IPetService.cs index dda64f4..a7e192f 100644 --- a/QYZH.InteractiveMagazine.IService/IPetService.cs +++ b/QYZH.InteractiveMagazine.IService/IPetService.cs @@ -75,7 +75,7 @@ public interface IPetService : IBaseService /// /// 更新模板状态(启用/禁用) /// - Task UpdateTemplateStatusAsync(long id, string status); + Task UpdateTemplateStatusAsync(long id, int status); // ==================== 后台管理:进化链 ==================== diff --git a/QYZH.InteractiveMagazine.IService/ISystemManagementService.cs b/QYZH.InteractiveMagazine.IService/ISystemManagementService.cs new file mode 100644 index 0000000..8efbda5 --- /dev/null +++ b/QYZH.InteractiveMagazine.IService/ISystemManagementService.cs @@ -0,0 +1,15 @@ +using QYZH.InteractiveMagazine.Models.Dto.SystemManagement; + +namespace QYZH.InteractiveMagazine.IService; + +/// +/// 系统管理服务接口 +/// +public interface ISystemManagementService +{ + /// + /// 获取所有枚举信息 + /// + /// 枚举信息列表 + Task> GetAllEnumsAsync(); +} diff --git a/QYZH.InteractiveMagazine.Models/Dto/SystemManagement/EnumInfoOutput.cs b/QYZH.InteractiveMagazine.Models/Dto/SystemManagement/EnumInfoOutput.cs new file mode 100644 index 0000000..209ed69 --- /dev/null +++ b/QYZH.InteractiveMagazine.Models/Dto/SystemManagement/EnumInfoOutput.cs @@ -0,0 +1,40 @@ +using System.ComponentModel; + +namespace QYZH.InteractiveMagazine.Models.Dto.SystemManagement; + +/// +/// 枚举信息输出 +/// +public class EnumInfoOutput +{ + /// + /// 枚举名称 + /// + public string EnumName { get; set; } = string.Empty; + + /// + /// 枚举项列表 + /// + public List Items { get; set; } = new(); +} + +/// +/// 枚举项 +/// +public class EnumItemDto +{ + /// + /// 枚举项名称 + /// + public string Name { get; set; } = string.Empty; + + /// + /// 枚举项值 + /// + public int Value { get; set; } + + /// + /// 描述 + /// + public string? Description { get; set; } +} diff --git a/QYZH.InteractiveMagazine.Models/Entity/CheckInConfig.cs b/QYZH.InteractiveMagazine.Models/Entity/CheckInConfig.cs index 4374230..725107c 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/CheckInConfig.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/CheckInConfig.cs @@ -42,12 +42,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// Nullable:False /// public CheckInConfigTypeEnum Type {get;set;} - - /// - /// Desc:状态: Active, Inactive - /// Default:Active - /// Nullable:False - /// - public CheckInConfigStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/CommunityMessageComment.cs b/QYZH.InteractiveMagazine.Models/Entity/CommunityMessageComment.cs index 1590e66..c82f940 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/CommunityMessageComment.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/CommunityMessageComment.cs @@ -41,12 +41,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// Nullable:False /// public CommunityMessageCommentTypeEnum Type {get;set;} - - /// - /// Desc:状态: Published, Hidden - /// Default:Published - /// Nullable:False - /// - public CommunityMessageCommentStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/CommunityTemplateSentence.cs b/QYZH.InteractiveMagazine.Models/Entity/CommunityTemplateSentence.cs index f7ee681..1ba1599 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/CommunityTemplateSentence.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/CommunityTemplateSentence.cs @@ -35,12 +35,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// Nullable:False /// public CommunityTemplateSentenceTypeEnum Type {get;set;} - - /// - /// Desc:状态: Active, Inactive - /// Default:Active - /// Nullable:False - /// - public CommunityTemplateSentenceStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/CompensationTask.cs b/QYZH.InteractiveMagazine.Models/Entity/CompensationTask.cs index 08fd431..57013c0 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/CompensationTask.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/CompensationTask.cs @@ -78,12 +78,6 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public int MaxRetries { get; set; } - /// - /// Desc:处理状态 Pending / Processing / Success / Failed / Cancelled - /// Default:Pending - /// Nullable:False - /// - public CompensationTaskStatusEnum Status { get; set; } /// /// Desc:最后处理时间 diff --git a/QYZH.InteractiveMagazine.Models/Entity/DotFile.cs b/QYZH.InteractiveMagazine.Models/Entity/DotFile.cs index 9b51827..edbecc7 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/DotFile.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/DotFile.cs @@ -94,12 +94,6 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public int TotalUse {get;set;} - /// - /// Desc:Pending / Processing / Success / Failed / Cancelled - /// Default:Pending - /// Nullable:False - /// - public DotFileStatusEnum Status {get;set;} /// /// Desc: diff --git a/QYZH.InteractiveMagazine.Models/Entity/DotFileDetail.cs b/QYZH.InteractiveMagazine.Models/Entity/DotFileDetail.cs index cd595c4..d82bbb8 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/DotFileDetail.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/DotFileDetail.cs @@ -59,12 +59,6 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public int Revision {get;set;} - /// - /// Desc:Pending / Processing / Success / Failed / Cancelled - /// Default:Pending - /// Nullable:False - /// - public DotFileDetailStatusEnum Status {get;set;} /// /// Desc: diff --git a/QYZH.InteractiveMagazine.Models/Entity/ExchangeRecord.cs b/QYZH.InteractiveMagazine.Models/Entity/ExchangeRecord.cs index dab7d7d..02bbbab 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/ExchangeRecord.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/ExchangeRecord.cs @@ -60,11 +60,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public int Quantity { get; set; } - /// - /// Desc:状态: Success, Refunded - /// Default:Success - /// Nullable:False - /// - public ExchangeRecordStatusEnum Status { get; set; } } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/Journal.cs b/QYZH.InteractiveMagazine.Models/Entity/Journal.cs index b977892..cfe6ebd 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/Journal.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/Journal.cs @@ -82,12 +82,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// Nullable:False /// public JournalTypeEnum Type {get;set;} - - /// - /// Desc:状态: Draft, Published, Archived - /// Default:Draft - /// Nullable:False - /// - public JournalStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/JournalPage.cs b/QYZH.InteractiveMagazine.Models/Entity/JournalPage.cs index 0ccea2f..010549b 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/JournalPage.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/JournalPage.cs @@ -51,13 +51,6 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public int PageNum {get;set;} - /// - /// Desc:校验状态(0-未校验 1校验成功 -1校验失败) - /// Default: - /// Nullable:False - /// - public int Status {get;set;} - /// /// Desc:页图片 /// Default: diff --git a/QYZH.InteractiveMagazine.Models/Entity/PetEvolution.cs b/QYZH.InteractiveMagazine.Models/Entity/PetEvolution.cs index 567e37e..8bc04c1 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/PetEvolution.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/PetEvolution.cs @@ -80,12 +80,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// Nullable:False /// public PetEvolutionTypeEnum Type { get; set; } - - /// - /// Desc:状态: Active, Inactive - /// Default:Active - /// Nullable:False - /// - public PetEvolutionStatusEnum Status { get; set; } } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/PetFeedingRecord.cs b/QYZH.InteractiveMagazine.Models/Entity/PetFeedingRecord.cs index 4346af7..5f67782 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/PetFeedingRecord.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/PetFeedingRecord.cs @@ -63,11 +63,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public PetFeedingRecordTypeEnum Type {get;set;} - /// - /// Desc:状态 - /// Default:Success - /// Nullable:False - /// - public PetFeedingRecordStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/PetTemplate.cs b/QYZH.InteractiveMagazine.Models/Entity/PetTemplate.cs index 5077df2..4fb6752 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/PetTemplate.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/PetTemplate.cs @@ -53,11 +53,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public PetTemplateTypeEnum Type { get; set; } - /// - /// Desc:状态: Active, Inactive - /// Default:Active - /// Nullable:False - /// - public PetTemplateStatusEnum Status { get; set; } } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/PointsRecord.cs b/QYZH.InteractiveMagazine.Models/Entity/PointsRecord.cs index c0d2bee..22e3ee0 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/PointsRecord.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/PointsRecord.cs @@ -63,11 +63,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public PointsFlowTypeEnum Type {get;set;} - /// - /// Desc:状态: Success, Failed, Pending - /// Default:Success - /// Nullable:False - /// - public PointsRecordStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/UserBag.cs b/QYZH.InteractiveMagazine.Models/Entity/UserBag.cs index 81fb11d..ade630f 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/UserBag.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/UserBag.cs @@ -55,11 +55,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public UserBagTypeEnum Type {get;set;} - /// - /// Desc:状态: Available, Expired - /// Default:Available - /// Nullable:False - /// - public UserBagStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/UserJournal.cs b/QYZH.InteractiveMagazine.Models/Entity/UserJournal.cs index edd4252..e1de98a 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/UserJournal.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/UserJournal.cs @@ -38,12 +38,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity [SugarColumn(ColumnName = "Type")] public UserJournalTypeEnum Type { get; set; } - /// - /// Desc:状态: Active(正常), Inactive(失效) - /// Default:Active - /// Nullable:False - /// - [SugarColumn(ColumnName = "Status")] - public UserJournalStatusEnum Status { get; set; } } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/UserMedal.cs b/QYZH.InteractiveMagazine.Models/Entity/UserMedal.cs index 2883914..9af5a40 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/UserMedal.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/UserMedal.cs @@ -40,12 +40,5 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// Nullable:True /// public UserMedalTypeEnum Type {get;set;} - - /// - /// Desc:状态: Awarded, Revoked - /// Default:Awarded - /// Nullable:False - /// - public UserMedalStatusEnum Status {get;set;} } } diff --git a/QYZH.InteractiveMagazine.Models/Entity/UserPet.cs b/QYZH.InteractiveMagazine.Models/Entity/UserPet.cs index c5dc7ef..01841b0 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/UserPet.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/UserPet.cs @@ -70,13 +70,6 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// public UserPetTypeEnum Type { get; set; } - /// - /// Desc:状态: Inactive, Active, Sleeping - /// Default:Inactive - /// Nullable:False - /// - public UserPetStatusEnum Status { get; set; } - /// /// 理解力 /// diff --git a/QYZH.InteractiveMagazine.Models/Entity/Users.cs b/QYZH.InteractiveMagazine.Models/Entity/Users.cs index 3a2af95..fe8c651 100644 --- a/QYZH.InteractiveMagazine.Models/Entity/Users.cs +++ b/QYZH.InteractiveMagazine.Models/Entity/Users.cs @@ -41,13 +41,6 @@ namespace QYZH.InteractiveMagazine.Models.Entity /// Nullable:False /// public UsersTypeEnum Type { get; set; } - - /// - /// Desc:状态: Active, Disabled - /// Default:Active - /// Nullable:False - /// - public UserStatusEnum Status { get; set; } /// /// Desc:微信OpenId /// Default: diff --git a/QYZH.InteractiveMagazine.Models/Enum/AdminUserStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/AdminUserStatusEnum.cs new file mode 100644 index 0000000..ee8879d --- /dev/null +++ b/QYZH.InteractiveMagazine.Models/Enum/AdminUserStatusEnum.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace QYZH.InteractiveMagazine.Models.Enum +{ + /// + /// 管理员状态枚举 + /// + public enum AdminUserStatusEnum + { + /// + /// 未激活 + /// + [Description("未激活")] + Inactive = 0, + + /// + /// 激活 + /// + [Description("激活")] + Active = 1 + } +} diff --git a/QYZH.InteractiveMagazine.Models/Enum/AdminUserTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/AdminUserTypeEnum.cs index dcfca63..bb8b596 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/AdminUserTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/AdminUserTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,13 +10,16 @@ public enum AdminUserTypeEnum /// /// 编辑员 /// + [Description("编辑员")] Editor = 2, /// /// 超级管理员 /// + [Description("超级管理员")] SuperAdmin = 0, /// - /// 超级管理员 + /// 管理员 /// + [Description("管理员")] Admin = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigStatusEnum.cs index 3a46bb1..deded80 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum CheckInConfigStatusEnum /// /// 未激活 /// + [Description("未激活")] Inactive = 0, /// /// 激活 /// + [Description("激活")] Active = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigTypeEnum.cs index 18f1290..610ba52 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CheckInConfigTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum CheckInConfigTypeEnum /// /// 每日签到 /// + [Description("每日签到")] Daily = 1, /// /// 连续签到 /// + [Description("连续签到")] Streak = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordStatusEnum.cs index dd61915..d55fcd1 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,5 +10,11 @@ public enum CheckInRecordStatusEnum /// /// 成功 /// - Success = 1 + [Description("成功")] + Success = 1, + /// + /// 失败 + /// + [Description("失败")] + Fail = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordTypeEnum.cs index 606be79..3215d51 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CheckInRecordTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum CheckInRecordTypeEnum /// /// 正常签到 /// + [Description("正常签到")] Normal = 1, /// /// 补签 /// + [Description("补签")] MakeUp = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentStatusEnum.cs index 36d839c..ccf2ede 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum CommunityMessageCommentStatusEnum /// /// 已隐藏 /// + [Description("已隐藏")] Hidden = 0, /// /// 已发布 /// + [Description("已发布")] Published = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentTypeEnum.cs index e6d9ea4..7ad3dec 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageCommentTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,5 +10,6 @@ public enum CommunityMessageCommentTypeEnum /// /// 模板评论 /// + [Description("模板评论")] TemplateComment = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageLikeTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageLikeTypeEnum.cs index 6105097..03e2496 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageLikeTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CommunityMessageLikeTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,5 +10,6 @@ public enum CommunityMessageLikeTypeEnum /// /// 点赞 /// + [Description("点赞")] Like = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceStatusEnum.cs index c7e0773..9e4c071 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum CommunityTemplateSentenceStatusEnum /// /// 未激活 /// + [Description("未激活")] Inactive = 0, /// /// 激活 /// + [Description("激活")] Active = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceTypeEnum.cs index 9687425..b7c7665 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CommunityTemplateSentenceTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,13 +10,16 @@ public enum CommunityTemplateSentenceTypeEnum /// /// 正面 /// + [Description("正面")] Positive = 1, /// /// 中性 /// + [Description("中性")] Neutral = 2, /// /// 负面 /// + [Description("负面")] Negative = 3 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskStatusEnum.cs index db313f7..b59ef94 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,25 +10,30 @@ public enum CompensationTaskStatusEnum /// /// 待处理 /// + [Description("待处理")] Pending = 0, /// /// 处理中 /// + [Description("处理中")] Processing = 1, /// /// 成功 /// + [Description("成功")] Success = 2, /// /// 失败 /// + [Description("失败")] Failed = 3, /// /// 已取消 /// + [Description("已取消")] Cancelled = 4 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskTypeEnum.cs index 1417673..bcd7e3f 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/CompensationTaskTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,17 +10,21 @@ public enum CompensationTaskTypeEnum /// /// 宠物喂养补偿 /// + [Description("宠物喂养补偿")] PetFeeding = 1, /// /// 用户积分补偿 /// + [Description("用户积分补偿")] UserPoints = 2, /// /// 用户成长值补偿 /// + [Description("用户成长值补偿")] UserGrowth = 3, /// /// 发送通知补偿 /// + [Description("发送通知补偿")] SendNotification = 4 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/DotFileDetailStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/DotFileDetailStatusEnum.cs index d0ba8f7..5c5977c 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/DotFileDetailStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/DotFileDetailStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,25 +10,30 @@ public enum DotFileDetailStatusEnum /// /// 待处理 /// + [Description("待处理")] Pending = 0, /// /// 处理中 /// + [Description("处理中")] Processing = 1, /// /// 成功 /// + [Description("成功")] Success = 2, /// /// 失败 /// + [Description("失败")] Failed = 3, /// /// 已取消 /// + [Description("已取消")] Cancelled = 4 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/DotFileStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/DotFileStatusEnum.cs index c6099c7..ac0cd6e 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/DotFileStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/DotFileStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,25 +10,30 @@ public enum DotFileStatusEnum /// /// 待处理 /// + [Description("待处理")] Pending = 0, /// /// 处理中 /// + [Description("处理中")] Processing = 1, /// /// 成功 /// + [Description("成功")] Success = 2, /// /// 失败 /// + [Description("失败")] Failed = 3, /// /// 已取消 /// + [Description("已取消")] Cancelled = 4 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/ExchangeRecordStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/ExchangeRecordStatusEnum.cs index 827ba8c..317e418 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/ExchangeRecordStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/ExchangeRecordStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum ExchangeRecordStatusEnum /// /// 成功 /// + [Description("成功")] Success = 1, /// /// 已退还 /// + [Description("已退还")] Refunded = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/JournalCatalogTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/JournalCatalogTypeEnum.cs index b827b56..18063af 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/JournalCatalogTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/JournalCatalogTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum JournalCatalogTypeEnum /// /// 单元 /// + [Description("单元")] Unit = 0, /// /// 页面 /// + [Description("页面")] Page = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/JournalPageStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/JournalPageStatusEnum.cs index 66726f1..3168e84 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/JournalPageStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/JournalPageStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,15 +10,18 @@ public enum JournalPageStatusEnum /// /// 验证失败 /// + [Description("验证失败")] Failed = -1, /// /// 未验证 /// + [Description("未验证")] NotVerified = 0, /// /// 验证成功 /// + [Description("验证成功")] Success = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/JournalPageTaskTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/JournalPageTaskTypeEnum.cs index 18b9a60..0d21078 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/JournalPageTaskTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/JournalPageTaskTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,17 +10,21 @@ public enum JournalPageTaskTypeEnum /// /// 单选题 /// + [Description("单选题")] SingleChoice = 1, /// /// 多选题 /// + [Description("多选题")] MultipleChoice = 2, /// /// 填空题 /// + [Description("填空题")] FillInBlank = 3, /// /// 问答题 /// + [Description("问答题")] QuestionAnswer = 4 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/JournalStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/JournalStatusEnum.cs index 7fd1009..ea02ab3 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/JournalStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/JournalStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,15 +10,18 @@ public enum JournalStatusEnum /// /// 草稿 /// + [Description("草稿")] Draft = 0, /// /// 已发布 /// + [Description("已发布")] Published = 1, /// /// 已归档 /// + [Description("已归档")] Archived = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/JournalTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/JournalTypeEnum.cs index a47e011..492ebd6 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/JournalTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/JournalTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum JournalTypeEnum /// /// 普通 /// + [Description("普通")] Normal = 1, /// /// 特刊 /// + [Description("特刊")] Special = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/MedalTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/MedalTypeEnum.cs index aaea1a6..c4c7322 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/MedalTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/MedalTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum MedalTypeEnum /// /// 宠物勋章 /// + [Description("宠物勋章")] Pet = 1, /// /// 社区勋章 /// + [Description("社区勋章")] Community = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/MessageStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/MessageStatusEnum.cs index f548838..2109dba 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/MessageStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/MessageStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,15 +10,18 @@ public enum MessageStatusEnum /// /// 审核中 /// + [Description("审核中")] PendingReview = 0, /// /// 已通过 /// + [Description("已通过")] Approved = 1, /// /// 已冻结 /// + [Description("已冻结")] Frozen = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/MessageTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/MessageTypeEnum.cs index ccf38c6..631c931 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/MessageTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/MessageTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,15 +10,18 @@ public enum MessageTypeEnum /// /// 文章 /// + [Description("文章")] Article = 1, /// /// 引用 /// + [Description("引用")] Quote = 2, /// /// 公告 /// + [Description("公告")] Announcement = 3 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionStatusEnum.cs index 0e68631..31054f5 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum PetEvolutionStatusEnum /// /// 未激活 /// + [Description("未激活")] Inactive = 0, /// /// 激活 /// + [Description("激活")] Active = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionTypeEnum.cs index b90b46f..bb155b5 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetEvolutionTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum PetEvolutionTypeEnum /// /// 普通进化 /// + [Description("普通进化")] Normal = 1, /// /// 特殊进化 /// + [Description("特殊进化")] Special = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordStatusEnum.cs index 85a3976..de23782 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,5 +10,11 @@ public enum PetFeedingRecordStatusEnum /// /// 成功 /// - Success = 1 + [Description("成功")] + Success = 1, + /// + /// 失败 + /// + [Description("失败")] + Fail = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordTypeEnum.cs index 4a48254..8080efb 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetFeedingRecordTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum PetFeedingRecordTypeEnum /// /// 普通喂养 /// + [Description("普通喂养")] Normal = 1, /// /// 特殊喂养 /// + [Description("特殊喂养")] Special = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetSkinImageTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetSkinImageTypeEnum.cs index 0600890..318c243 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetSkinImageTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetSkinImageTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum PetSkinImageTypeEnum /// /// 普通图片 /// + [Description("普通图片")] Normal = 1, /// /// 特殊图片 /// + [Description("特殊图片")] Special = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetSkinTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetSkinTypeEnum.cs index 3fbb886..f1d782b 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetSkinTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetSkinTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,13 +10,16 @@ public enum PetSkinTypeEnum /// /// 普通皮肤 /// + [Description("普通皮肤")] Normal = 1, /// /// 限定皮肤 /// + [Description("限定皮肤")] Limited = 2, /// /// 活动皮肤 /// + [Description("活动皮肤")] Event = 3 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetTemplateStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetTemplateStatusEnum.cs index 651e5e4..a9f1a83 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetTemplateStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetTemplateStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum PetTemplateStatusEnum /// /// 未激活 /// + [Description("未激活")] Inactive = 0, /// /// 激活 /// + [Description("激活")] Active = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PetTemplateTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PetTemplateTypeEnum.cs index cb6b65b..2a0f4dd 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PetTemplateTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PetTemplateTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,13 +10,16 @@ public enum PetTemplateTypeEnum /// /// 普通 /// + [Description("普通")] Normal = 1, /// /// 特殊 /// + [Description("特殊")] Special = 2, /// /// 限定 /// + [Description("限定")] Limited = 3 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PointsChangeTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PointsChangeTypeEnum.cs index 6d41020..20110d1 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PointsChangeTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PointsChangeTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,45 +10,54 @@ public enum PointsChangeTypeEnum /// /// 签到奖励 /// + [Description("签到奖励")] SignIn, /// /// 补签奖励 /// + [Description("补签奖励")] MakeUpSign, /// /// 商城兑换扣除 /// + [Description("商城兑换扣除")] Exchange, /// /// 宠物喂养消耗 /// + [Description("宠物喂养消耗")] FeedPet, /// /// 任务奖励(杂志任务等) /// + [Description("任务奖励")] TaskReward, /// /// 注册奖励 /// + [Description("注册奖励")] RegisterBonus, /// /// 勋章奖励 /// + [Description("勋章奖励")] MedalBonus, /// /// 系统补偿 /// + [Description("系统补偿")] SystemCompensation, /// /// 后台手动调整 /// + [Description("后台手动调整")] ManualAdjust } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PointsFlowTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PointsFlowTypeEnum.cs index 3d4e2c2..d20ce26 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PointsFlowTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PointsFlowTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum PointsFlowTypeEnum /// /// 收入 /// + [Description("收入")] Income, /// /// 支出 /// + [Description("支出")] Expense } diff --git a/QYZH.InteractiveMagazine.Models/Enum/PointsRecordStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/PointsRecordStatusEnum.cs index c58550f..3677089 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/PointsRecordStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/PointsRecordStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,15 +10,18 @@ public enum PointsRecordStatusEnum /// /// 待处理 /// + [Description("待处理")] Pending = 0, /// /// 成功 /// + [Description("成功")] Success = 1, /// /// 失败 /// + [Description("失败")] Failed = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/ProductTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/ProductTypeEnum.cs index 50e530e..d62551e 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/ProductTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/ProductTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum ProductTypeEnum /// /// 补签卡 /// + [Description("补签卡")] MakeUpCard = 1, /// /// 宠物背景 /// + [Description("宠物背景")] PetBg = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserBagStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserBagStatusEnum.cs index 44e74a3..acc0c0b 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserBagStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserBagStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum UserBagStatusEnum /// /// 已过期 /// + [Description("已过期")] Expired = 0, /// /// 可用 /// + [Description("可用")] Available = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserBagTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserBagTypeEnum.cs index dcd2e47..3322dfe 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserBagTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserBagTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum UserBagTypeEnum /// /// 补签卡 /// + [Description("补签卡")] MakeUpCard = 1, /// /// 宠物背景 /// + [Description("宠物背景")] PetBg = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserJournalStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserJournalStatusEnum.cs index cf29326..a7c77ea 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserJournalStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserJournalStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum UserJournalStatusEnum /// /// 失效 /// + [Description("失效")] Inactive = 0, /// /// 正常 /// + [Description("正常")] Active = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserJournalTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserJournalTypeEnum.cs index d3bd261..2004c9d 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserJournalTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserJournalTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,13 +10,16 @@ public enum UserJournalTypeEnum /// /// 已读 /// + [Description("已读")] Read = 1, /// /// 收藏 /// + [Description("收藏")] Favorite = 2, /// /// 订阅 /// + [Description("订阅")] Subscribe = 3 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserMedalStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserMedalStatusEnum.cs index 9332e4a..08a0231 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserMedalStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserMedalStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum UserMedalStatusEnum /// /// 已撤销 /// + [Description("已撤销")] Revoked = 0, /// /// 已授予 /// + [Description("已授予")] Awarded = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserMedalTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserMedalTypeEnum.cs index c8ebfa0..6edec3b 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserMedalTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserMedalTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum UserMedalTypeEnum /// /// 系统授予 /// + [Description("系统授予")] System = 1, /// /// 活动奖励 /// + [Description("活动奖励")] Activity = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserPetStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserPetStatusEnum.cs index cfa4b9e..143da27 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserPetStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserPetStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,15 +10,18 @@ public enum UserPetStatusEnum /// /// 未激活 /// + [Description("未激活")] Inactive = 0, /// /// 激活 /// + [Description("激活")] Active = 1, /// /// 休眠中 /// + [Description("休眠中")] Sleeping = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserPetTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserPetTypeEnum.cs index a38d14d..a92bc40 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserPetTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserPetTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,5 +10,6 @@ public enum UserPetTypeEnum /// /// 普通 /// + [Description("普通")] Normal = 1 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UserStatusEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UserStatusEnum.cs index 5a0014c..8c33aa1 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UserStatusEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UserStatusEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,10 +10,12 @@ public enum UserStatusEnum /// /// 启用 /// + [Description("启用")] Active = 1, /// /// 禁用 /// + [Description("禁用")] Disabled = 2 } diff --git a/QYZH.InteractiveMagazine.Models/Enum/UsersTypeEnum.cs b/QYZH.InteractiveMagazine.Models/Enum/UsersTypeEnum.cs index 1491604..2c82f42 100644 --- a/QYZH.InteractiveMagazine.Models/Enum/UsersTypeEnum.cs +++ b/QYZH.InteractiveMagazine.Models/Enum/UsersTypeEnum.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace QYZH.InteractiveMagazine.Models.Enum; /// @@ -8,9 +10,11 @@ public enum UsersTypeEnum /// /// 普通用户 /// + [Description("普通用户")] Normal = 1, /// /// VIP用户 /// + [Description("VIP用户")] VIP = 2 } diff --git a/QYZH.InteractiveMagazine.Service/CheckInService.cs b/QYZH.InteractiveMagazine.Service/CheckInService.cs index dcea9ea..6f9e9ca 100644 --- a/QYZH.InteractiveMagazine.Service/CheckInService.cs +++ b/QYZH.InteractiveMagazine.Service/CheckInService.cs @@ -117,7 +117,7 @@ public class CheckInService( }); // 7. 如果用户有活跃宠物,调用 PetService 喂养(含进化检查),独立事务 - if (pet != null && pet.Status == UserPetStatusEnum.Active && growthReward > 0) + if (pet != null && pet.Status == (int)UserPetStatusEnum.Active && growthReward > 0) { try { @@ -315,7 +315,7 @@ public class CheckInService( }); // 如果有活跃宠物,喂养成长值 - if (pet != null && pet.Status == UserPetStatusEnum.Active && growthReward > 0) + if (pet != null && pet.Status == (int)UserPetStatusEnum.Active && growthReward > 0) { try { @@ -391,7 +391,7 @@ public class CheckInService( { // 查询签到配置(按 DayNumber 升序) var configs = await checkInRecordRepository.Context.Queryable() - .Where(c => c.Status == CheckInConfigStatusEnum.Active && !c.IsDeleted) + .Where(c => c.Status == (int)CheckInConfigStatusEnum.Active && !c.IsDeleted) .OrderBy(c => c.DayNumber) .ToListAsync(); diff --git a/QYZH.InteractiveMagazine.Service/CompensationManageService.cs b/QYZH.InteractiveMagazine.Service/CompensationManageService.cs index 9483eb3..b0ae7bf 100644 --- a/QYZH.InteractiveMagazine.Service/CompensationManageService.cs +++ b/QYZH.InteractiveMagazine.Service/CompensationManageService.cs @@ -37,7 +37,7 @@ public class CompensationManageService( .LeftJoin((t, u) => t.UserId == u.Id) .WhereIF(input.UserId.HasValue, (t, u) => t.UserId == input.UserId.Value) .WhereIF(input.TaskType.HasValue, (t, u) => t.TaskType == (int)input.TaskType.Value) - .WhereIF(input.Status.HasValue, (t, u) => t.Status == input.Status.Value) + .WhereIF(input.Status.HasValue, (t, u) => t.Status == (int)input.Status) .WhereIF(!string.IsNullOrWhiteSpace(input.BusinessSource), (t, u) => t.BusinessSource == input.BusinessSource) .OrderByDescending((t, u) => t.CreatedAt) .Select((t, u) => new CompensationManageOutput @@ -53,7 +53,7 @@ public class CompensationManageService( ErrorSource = t.ErrorSource, RetryCount = t.RetryCount, MaxRetries = t.MaxRetries, - Status = t.Status, + Status = (CompensationTaskStatusEnum)t.Status, ProcessedAt = t.ProcessedAt, ScheduledAt = t.ScheduledAt, ResultMessage = t.ResultMessage, @@ -75,12 +75,12 @@ public class CompensationManageService( if (task == null) throw new BusinessException("补偿任务不存在", 404); - if (task.Status != CompensationTaskStatusEnum.Failed && task.Status != CompensationTaskStatusEnum.Cancelled) + if (task.Status != (int)CompensationTaskStatusEnum.Failed && task.Status != (int)CompensationTaskStatusEnum.Cancelled) throw new BusinessException($"只有失败或已取消的任务才能重试,当前状态: {task.Status}", 400); // 重置任务状态为 Pending,清零重试次数,设置立即执行 await compensationTaskRepository.Context.Updateable() - .SetColumns(t => t.Status == CompensationTaskStatusEnum.Pending) + .SetColumns(t => t.Status == (int)CompensationTaskStatusEnum.Pending) .SetColumns(t => t.RetryCount == 0) .SetColumns(t => t.ScheduledAt == DateTime.Now) .SetColumns(t => t.ResultMessage == $"管理员手动重试: {input.Reason}") @@ -118,12 +118,12 @@ public class CompensationManageService( if (task == null) throw new BusinessException("补偿任务不存在", 404); - if (task.Status == CompensationTaskStatusEnum.Success) + if (task.Status == (int)CompensationTaskStatusEnum.Success) throw new BusinessException("该任务已经是成功状态,无需标记", 400); // 标记为 Success await compensationTaskRepository.Context.Updateable() - .SetColumns(t => t.Status == CompensationTaskStatusEnum.Success) + .SetColumns(t => t.Status == (int)CompensationTaskStatusEnum.Success) .SetColumns(t => t.ResultMessage == $"管理员手动标记已解决: {input.ResolveNote}") .SetColumns(t => t.ProcessedAt == DateTime.Now) .SetColumns(t => t.UpdatedBy == operatorName) @@ -172,7 +172,7 @@ public class CompensationManageService( ErrorSource = t.ErrorSource, RetryCount = t.RetryCount, MaxRetries = t.MaxRetries, - Status = t.Status, + Status = (CompensationTaskStatusEnum)t.Status, ProcessedAt = t.ProcessedAt, ScheduledAt = t.ScheduledAt, ResultMessage = t.ResultMessage, diff --git a/QYZH.InteractiveMagazine.Service/CompensationTaskService.cs b/QYZH.InteractiveMagazine.Service/CompensationTaskService.cs index be8e38d..0a38e8c 100644 --- a/QYZH.InteractiveMagazine.Service/CompensationTaskService.cs +++ b/QYZH.InteractiveMagazine.Service/CompensationTaskService.cs @@ -38,7 +38,7 @@ public class CompensationTaskService( ErrorSource = input.ErrorSource, RetryCount = 0, MaxRetries = input.MaxRetries > 0 ? input.MaxRetries : 3, - Status = CompensationTaskStatusEnum.Pending, + Status = (int)CompensationTaskStatusEnum.Pending, ScheduledAt = DateTime.Now, IsDeleted = false, CreatedBy = "System", @@ -62,7 +62,7 @@ public class CompensationTaskService( var now = DateTime.Now; var tasks = await taskRepository.Queryable() - .Where(t => (t.Status == CompensationTaskStatusEnum.Pending || t.Status == CompensationTaskStatusEnum.Processing) + .Where(t => (t.Status == (int)CompensationTaskStatusEnum.Pending || t.Status == (int)CompensationTaskStatusEnum.Processing) && !t.IsDeleted && (t.ScheduledAt == null || t.ScheduledAt <= now)) .OrderBy(t => t.CreatedAt) @@ -79,7 +79,7 @@ public class CompensationTaskService( ErrorSource = t.ErrorSource, RetryCount = t.RetryCount, MaxRetries = t.MaxRetries, - Status = t.Status, + Status = (CompensationTaskStatusEnum)t.Status, ProcessedAt = t.ProcessedAt, ScheduledAt = t.ScheduledAt, ResultMessage = t.ResultMessage, @@ -99,10 +99,10 @@ public class CompensationTaskService( .Where(t => !t.IsDeleted); if (input.Status.HasValue) - query = query.Where(t => t.Status == input.Status.Value); + query = query.Where(t => t.Status == (int)input.Status); if (input.TaskType.HasValue) - query = query.Where(t => t.TaskType == (int)input.TaskType.Value); + query = query.Where(t => t.TaskType == (int)input.TaskType); if (!string.IsNullOrEmpty(input.BusinessSource)) query = query.Where(t => t.BusinessSource == input.BusinessSource); @@ -122,7 +122,7 @@ public class CompensationTaskService( ErrorSource = t.ErrorSource, RetryCount = t.RetryCount, MaxRetries = t.MaxRetries, - Status = t.Status, + Status = (CompensationTaskStatusEnum)t.Status, ProcessedAt = t.ProcessedAt, ScheduledAt = t.ScheduledAt, ResultMessage = t.ResultMessage, @@ -139,7 +139,7 @@ public class CompensationTaskService( public async Task UpdateTaskStatusAsync(long taskId, UpdateCompensationStatusInput input) { var update = taskRepository.Context.Updateable() - .SetColumns(t => t.Status == input.Status) + .SetColumns(t => t.Status == (int)input.Status) .SetColumns(t => t.ResultMessage == input.ResultMessage) .SetColumns(t => t.ProcessedAt == DateTime.Now) .SetColumns(t => t.UpdatedAt == DateTime.Now); @@ -163,7 +163,7 @@ public class CompensationTaskService( public async Task CancelTaskAsync(long taskId, string reason) { await taskRepository.Context.Updateable() - .SetColumns(t => t.Status == CompensationTaskStatusEnum.Cancelled) + .SetColumns(t => t.Status == (int)CompensationTaskStatusEnum.Cancelled) .SetColumns(t => t.ResultMessage == reason) .SetColumns(t => t.UpdatedAt == DateTime.Now) .Where(t => t.Id == taskId && !t.IsDeleted) diff --git a/QYZH.InteractiveMagazine.Service/MedalService.cs b/QYZH.InteractiveMagazine.Service/MedalService.cs index 1fa2c55..8d149f4 100644 --- a/QYZH.InteractiveMagazine.Service/MedalService.cs +++ b/QYZH.InteractiveMagazine.Service/MedalService.cs @@ -314,7 +314,7 @@ public class MedalService(BaseRepository medalRepository, ILogger() - .Where(um => um.UserId == userId && um.Status == UserMedalStatusEnum.Awarded) + .Where(um => um.UserId == userId && um.Status == (int)UserMedalStatusEnum.Awarded) .ToListAsync(); var userMedalDict = userMedals.ToDictionary(um => um.MedalId, um => um.AwardedAt); @@ -341,7 +341,7 @@ public class MedalService(BaseRepository medalRepository, ILogger() .InnerJoin((um, m) => um.MedalId == m.Id) - .Where((um, m) => um.UserId == userId && um.Status == UserMedalStatusEnum.Awarded) + .Where((um, m) => um.UserId == userId && um.Status == (int)UserMedalStatusEnum.Awarded) .OrderByDescending((um, m) => um.AwardedAt) .Select((um, m) => new WxUserMedalOutput { @@ -391,7 +391,7 @@ public class MedalService(BaseRepository medalRepository, ILogger() - .Where(um => um.UserId == userId && um.MedalId == (int)input.MedalId && um.Status == UserMedalStatusEnum.Awarded) + .Where(um => um.UserId == userId && um.MedalId == (int)input.MedalId && um.Status == (int)UserMedalStatusEnum.Awarded) .FirstAsync(); if (existingUserMedal != null) @@ -405,7 +405,7 @@ public class MedalService(BaseRepository medalRepository, ILogger t.Status == PetTemplateStatusEnum.Active && !t.IsDeleted) + .Where(t => t.Status == (int)PetTemplateStatusEnum.Active && !t.IsDeleted) .OrderBy(t => t.SortOrder) .FirstAsync(); @@ -123,7 +123,7 @@ public class PetService( var initialEvolution = await petEvolutionRepository.Queryable() .Where(e => e.TemplateId == defaultTemplate.Id && e.PreviousEvolutionId == null - && e.Status == PetEvolutionStatusEnum.Active) + && e.Status == (int)PetEvolutionStatusEnum.Active) .OrderBy(e => e.StageLevel) .FirstAsync(); @@ -137,7 +137,7 @@ public class PetService( FeedingCount = 0, CurrentSkinId = 0, Type = UserPetTypeEnum.Normal, - Status = UserPetStatusEnum.Inactive, + Status = (int)UserPetStatusEnum.Inactive, IsDeleted = false, CreatedBy = userId.ToString(), CreatedAt = DateTime.Now, @@ -173,14 +173,14 @@ public class PetService( return; } - if (pet.Status != UserPetStatusEnum.Inactive) + if (pet.Status != (int)UserPetStatusEnum.Inactive) { logger.LogInformation("用户宠物已非未激活状态,跳过激活,UserId: {UserId}, Status: {Status}", userId, pet.Status); return; } var result = await petRepository.UpdateAsync( - p => new UserPet { Status = UserPetStatusEnum.Active }, + p => new UserPet { Status = (int)UserPetStatusEnum.Active }, p => p.UserId == userId); if (!result) @@ -226,7 +226,7 @@ public class PetService( } // 校验宠物状态 - if (pet.Status != UserPetStatusEnum.Active) + if (pet.Status != (int)UserPetStatusEnum.Active) { logger.LogWarning("喂养失败,宠物未激活,PetId: {PetId}, Status: {Status}", input.PetId, pet.Status); throw new BusinessException("宠物未激活,无法喂养", 400); @@ -258,7 +258,7 @@ public class PetService( var nextEvolution = await petEvolutionRepository.Queryable() .Where(e => e.PreviousEvolutionId == pet.CurrentEvolutionId && e.RequiredGrowth <= growthAfter - && e.Status == PetEvolutionStatusEnum.Active) + && e.Status == (int)PetEvolutionStatusEnum.Active) .OrderBy(e => e.RequiredGrowth, OrderByType.Desc) .FirstAsync(); @@ -291,7 +291,7 @@ public class PetService( GrowthBefore = growthBefore, GrowthAfter = growthAfter, Type = PetFeedingRecordTypeEnum.Normal, - Status = PetFeedingRecordStatusEnum.Success, + Status = (int)PetFeedingRecordStatusEnum.Success, IsDeleted = false, CreatedBy = userId.ToString(), CreatedAt = DateTime.Now, @@ -367,7 +367,7 @@ public class PetService( IconUrl = input.IconUrl, SortOrder = input.SortOrder, Type = Enum.Parse(input.Type, true), - Status = PetTemplateStatusEnum.Active, + Status = (int)PetTemplateStatusEnum.Active, CreatedBy = "System", CreatedAt = DateTime.Now, UpdatedBy = "System", @@ -484,13 +484,13 @@ public class PetService( /// /// 更新模板状态(启用/禁用) /// - public async Task UpdateTemplateStatusAsync(long id, string status) + public async Task UpdateTemplateStatusAsync(long id, int status) { var template = await petTemplateRepository.GetByIdAsync(id); if (template == null || template.IsDeleted) throw new BusinessException("宠物模板不存在", 404); - template.Status = Enum.Parse(status, true); + template.Status = status; template.UpdatedBy = "System"; template.UpdatedAt = DateTime.Now; await petTemplateRepository.UpdateAsync(template); @@ -548,7 +548,7 @@ public class PetService( BaseIntelligence = input.BaseIntelligence, BaseCharm = input.BaseCharm, Type = Enum.Parse(input.Type, true), - Status = PetEvolutionStatusEnum.Active, + Status = (int)PetEvolutionStatusEnum.Active, CreatedBy = "System", CreatedAt = DateTime.Now, UpdatedBy = "System", diff --git a/QYZH.InteractiveMagazine.Service/PointsService.cs b/QYZH.InteractiveMagazine.Service/PointsService.cs index dbe8d5b..5cd73a9 100644 --- a/QYZH.InteractiveMagazine.Service/PointsService.cs +++ b/QYZH.InteractiveMagazine.Service/PointsService.cs @@ -101,7 +101,7 @@ public class PointsService( RelatedId = input.RelatedId, Description = input.Description, Type = PointsFlowTypeEnum.Income, - Status = PointsRecordStatusEnum.Success, + Status = (int)PointsRecordStatusEnum.Success, IsDeleted = false, CreatedBy = input.OperatorName ?? user.Name ?? input.UserId.ToString(), CreatedAt = DateTime.Now, @@ -164,7 +164,7 @@ public class PointsService( RelatedId = input.RelatedId, Description = input.Description, Type = PointsFlowTypeEnum.Expense, - Status = PointsRecordStatusEnum.Success, + Status = (int)PointsRecordStatusEnum.Success, IsDeleted = false, CreatedBy = input.OperatorName ?? user.Name ?? input.UserId.ToString(), CreatedAt = DateTime.Now, @@ -218,12 +218,12 @@ public class PointsService( // 查询累计收入(Income 类型) var totalIncome = await Context.Queryable() - .Where(r => r.UserId == userId && !r.IsDeleted && r.Type == PointsFlowTypeEnum.Income && r.Status == PointsRecordStatusEnum.Success) + .Where(r => r.UserId == userId && !r.IsDeleted && r.Type == PointsFlowTypeEnum.Income && r.Status == (int)PointsRecordStatusEnum.Success) .SumAsync(r => r.ChangeAmount); // 查询累计支出(Expense 类型,取绝对值) var totalExpense = await Context.Queryable() - .Where(r => r.UserId == userId && !r.IsDeleted && r.Type == PointsFlowTypeEnum.Expense && r.Status == PointsRecordStatusEnum.Success) + .Where(r => r.UserId == userId && !r.IsDeleted && r.Type == PointsFlowTypeEnum.Expense && r.Status == (int)PointsRecordStatusEnum.Success) .SumAsync(r => r.ChangeAmount); return new PointsSummaryOutput diff --git a/QYZH.InteractiveMagazine.Service/SystemManagementService.cs b/QYZH.InteractiveMagazine.Service/SystemManagementService.cs new file mode 100644 index 0000000..ceb154b --- /dev/null +++ b/QYZH.InteractiveMagazine.Service/SystemManagementService.cs @@ -0,0 +1,73 @@ +using System.ComponentModel; +using System.Reflection; +using Microsoft.Extensions.Logging; +using QYZH.InteractiveMagazine.IService; +using QYZH.InteractiveMagazine.Models.Dto.SystemManagement; + +namespace QYZH.InteractiveMagazine.Service; + +/// +/// 系统管理服务实现 +/// +public class SystemManagementService : ISystemManagementService +{ + private readonly ILogger _logger; + + public SystemManagementService(ILogger logger) + { + _logger = logger; + } + + public Task> GetAllEnumsAsync() + { + _logger.LogInformation("开始获取所有枚举信息"); + + var enumAssembly = typeof(QYZH.InteractiveMagazine.Models.Enum.AdminUserStatusEnum).Assembly; + var enumNamespace = "QYZH.InteractiveMagazine.Models.Enum"; + + var enumTypes = enumAssembly.GetTypes() + .Where(t => t.IsEnum && t.Namespace == enumNamespace) + .OrderBy(t => t.Name) + .ToList(); + + var result = new List(); + + foreach (var enumType in enumTypes) + { + var enumInfo = new EnumInfoOutput + { + EnumName = enumType.Name + }; + + var fields = Enum.GetValues(enumType) + .Cast() + .Select(value => new + { + Name = Enum.GetName(enumType, value), + Value = Convert.ToInt32(value), + Field = enumType.GetField(value.ToString()!) + }) + .ToList(); + + foreach (var field in fields) + { + var description = field.Field? + .GetCustomAttribute()? + .Description; + + enumInfo.Items.Add(new EnumItemDto + { + Name = field.Name!, + Value = field.Value, + Description = description + }); + } + + result.Add(enumInfo); + } + + _logger.LogInformation("获取枚举信息完成,共 {Count} 个枚举", result.Count); + + return Task.FromResult(result); + } +} diff --git a/QYZH.InteractiveMagazine.Service/UserJournalService.cs b/QYZH.InteractiveMagazine.Service/UserJournalService.cs index 3bd870a..15cd79c 100644 --- a/QYZH.InteractiveMagazine.Service/UserJournalService.cs +++ b/QYZH.InteractiveMagazine.Service/UserJournalService.cs @@ -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(input.Type, true), - Status = UserJournalStatusEnum.Active, + Status = (int)UserJournalStatusEnum.Active, IsDeleted = false, CreatedBy = userId.ToString(), CreatedAt = DateTime.Now, diff --git a/QYZH.InteractiveMagazine.Service/UsersService.cs b/QYZH.InteractiveMagazine.Service/UsersService.cs index a4fcc7a..c6e3764 100644 --- a/QYZH.InteractiveMagazine.Service/UsersService.cs +++ b/QYZH.InteractiveMagazine.Service/UsersService.cs @@ -180,7 +180,7 @@ public class UsersService( var statusValue = input.Status == 1 ? UserStatusEnum.Active : UserStatusEnum.Disabled; var result = await UpdateAsync( - u => new Users { Status = statusValue }, + u => new Users { Status = (int)statusValue }, u => u.Id == id ); diff --git a/QYZH.InteractiveMagazine.Service/WeChatAuthService.cs b/QYZH.InteractiveMagazine.Service/WeChatAuthService.cs index 43e1e07..4d8e197 100644 --- a/QYZH.InteractiveMagazine.Service/WeChatAuthService.cs +++ b/QYZH.InteractiveMagazine.Service/WeChatAuthService.cs @@ -72,7 +72,7 @@ public class WeChatAuthService(BaseRepository usersRepository, IConfigura UnionId = wxResponse.UnionId, Phone = phone, Type = UsersTypeEnum.Normal, - Status = UserStatusEnum.Active, + Status = (int)UserStatusEnum.Active, GrowthPoints = 0, Points = 0, IsLastOnline = true @@ -190,7 +190,7 @@ public class WeChatAuthService(BaseRepository usersRepository, IConfigura throw new BusinessException("无法切换到该用户", 403); } - if (targetUser.Status == UserStatusEnum.Disabled) + if (targetUser.Status == (int)UserStatusEnum.Disabled) { throw new BusinessException("目标账号已被禁用", 403); } diff --git a/QYZH.InteractiveMagazine.Service/WeChatCommunityService.cs b/QYZH.InteractiveMagazine.Service/WeChatCommunityService.cs index ad21ff9..1566514 100644 --- a/QYZH.InteractiveMagazine.Service/WeChatCommunityService.cs +++ b/QYZH.InteractiveMagazine.Service/WeChatCommunityService.cs @@ -236,7 +236,7 @@ public class WeChatCommunityService( private async Task> GetUserJournalIds(long userId) { return await Context.Queryable() - .Where(uj => uj.UserId == userId && uj.Status == UserJournalStatusEnum.Active) + .Where(uj => uj.UserId == userId && uj.Status == (int)UserJournalStatusEnum.Active) .Select(uj => uj.JournalId) .ToListAsync(); } diff --git a/QYZH.InteractiveMagazine.Service/WxMallService.cs b/QYZH.InteractiveMagazine.Service/WxMallService.cs index 91cb27d..445c76b 100644 --- a/QYZH.InteractiveMagazine.Service/WxMallService.cs +++ b/QYZH.InteractiveMagazine.Service/WxMallService.cs @@ -83,7 +83,7 @@ public class WxMallService( var skinProductIds = skinProductMap.Select(x => x.ProductId).ToList(); var bagItems = skinProductIds.Count > 0 ? await exchangeRecordRepository.Context.Queryable() - .Where(b => b.UserId == userId && !b.IsDeleted && b.Status == UserBagStatusEnum.Available + .Where(b => b.UserId == userId && !b.IsDeleted && b.Status == (int)UserBagStatusEnum.Available && skinProductIds.Contains(b.ItemId)) .ToListAsync() : new List(); @@ -158,7 +158,7 @@ public class WxMallService( } var owned = await exchangeRecordRepository.Context.Queryable() - .Where(b => b.UserId == userId && b.ItemId == product.Id && !b.IsDeleted && b.Status == UserBagStatusEnum.Available) + .Where(b => b.UserId == userId && b.ItemId == product.Id && !b.IsDeleted && b.Status == (int)UserBagStatusEnum.Available) .AnyAsync(); return new WxProductOutput @@ -213,7 +213,7 @@ public class WxMallService( PointsCost = totalCost, PointsBalance = 0, // 稍后赋值 Quantity = input.Quantity, - Status = ExchangeRecordStatusEnum.Success, + Status = (int)ExchangeRecordStatusEnum.Success, IsDeleted = false, CreatedBy = userId.ToString(), CreatedAt = DateTime.Now, @@ -241,7 +241,7 @@ public class WxMallService( // 加入背包 var existingBag = await exchangeRecordRepository.Context.Queryable() - .Where(b => b.UserId == userId && b.ItemId == product.Id && !b.IsDeleted && b.Status == UserBagStatusEnum.Available) + .Where(b => b.UserId == userId && b.ItemId == product.Id && !b.IsDeleted && b.Status == (int)UserBagStatusEnum.Available) .FirstAsync(); if (existingBag != null) @@ -264,7 +264,7 @@ public class WxMallService( Quantity = input.Quantity, MetaData = product.MetaData, Type = Enum.TryParse(product.Type.ToString(), out var bagType) ? bagType : default, - Status = UserBagStatusEnum.Available, + Status = (int)UserBagStatusEnum.Available, IsDeleted = false, CreatedBy = userId.ToString(), CreatedAt = DateTime.Now, @@ -318,7 +318,7 @@ public class WxMallService( public async Task> GetBagItemsAsync(long userId, string? itemType = null) { var query = exchangeRecordRepository.Context.Queryable() - .Where(b => b.UserId == userId && !b.IsDeleted && b.Status == UserBagStatusEnum.Available) + .Where(b => b.UserId == userId && !b.IsDeleted && b.Status == (int)UserBagStatusEnum.Available) .WhereIF(!string.IsNullOrEmpty(itemType), b => b.ItemType == itemType) .OrderByDescending(b => b.CreatedAt); @@ -403,7 +403,7 @@ public class WxMallService( throw new BusinessException("背包物品Id无效", 400); var bagItem = await exchangeRecordRepository.Context.Queryable() - .Where(b => b.Id == input.BagItemId && b.UserId == userId && !b.IsDeleted && b.Status == UserBagStatusEnum.Available) + .Where(b => b.Id == input.BagItemId && b.UserId == userId && !b.IsDeleted && b.Status == (int)UserBagStatusEnum.Available) .FirstAsync(); if (bagItem == null) @@ -444,7 +444,7 @@ public class WxMallService( if (bagItem.Quantity <= 1) { await exchangeRecordRepository.Context.Updateable() - .SetColumns(b => b.Status == UserBagStatusEnum.Expired) + .SetColumns(b => b.Status == (int)UserBagStatusEnum.Expired) .SetColumns(b => b.Quantity == 0) .SetColumns(b => b.UpdatedAt == DateTime.Now) .Where(b => b.Id == bagItem.Id) @@ -507,7 +507,7 @@ public class WxMallService( // 校验背包中是否拥有该皮肤(通过 MetaData 中的 SkinId 判断) var hasSkin = await exchangeRecordRepository.Context.Queryable() - .Where(b => b.UserId == userId && !b.IsDeleted && b.Status == UserBagStatusEnum.Available && b.Quantity > 0 + .Where(b => b.UserId == userId && !b.IsDeleted && b.Status == (int)UserBagStatusEnum.Available && b.Quantity > 0 && b.ItemType == "PetBg") .ToListAsync(); diff --git a/QYZH.InteractiveMagazine.WebApi/Controllers/PetManageController.cs b/QYZH.InteractiveMagazine.WebApi/Controllers/PetManageController.cs index 8d69490..41a1ce5 100644 --- a/QYZH.InteractiveMagazine.WebApi/Controllers/PetManageController.cs +++ b/QYZH.InteractiveMagazine.WebApi/Controllers/PetManageController.cs @@ -145,7 +145,7 @@ public class PetManageController : BaseController /// 更新宠物模板状态(启用/禁用) /// [HttpPut("{id}/status")] - public async Task> UpdateTemplateStatusAsync(long id, [FromBody] string status) + public async Task> UpdateTemplateStatusAsync(long id, [FromBody] int status) { try { diff --git a/QYZH.InteractiveMagazine.WebApi/Controllers/SystemManagementController.cs b/QYZH.InteractiveMagazine.WebApi/Controllers/SystemManagementController.cs new file mode 100644 index 0000000..2d924ea --- /dev/null +++ b/QYZH.InteractiveMagazine.WebApi/Controllers/SystemManagementController.cs @@ -0,0 +1,46 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using QYZH.InteractiveMagazine.IService; +using QYZH.InteractiveMagazine.Models.Dto; +using QYZH.InteractiveMagazine.Models.Dto.SystemManagement; +using QYZH.InteractiveMagazine.Models.Enum; + +namespace QYZH.InteractiveMagazine.WebApi.Controllers; + +/// +/// 系统管理控制器 +/// +[Route("api/[controller]")] +[ApiController] +[ApiExplorerSettings(GroupName = nameof(ApiVersionEnum.Platform))] +public class SystemManagementController : BaseController +{ + private readonly ISystemManagementService _systemManagementService; + private readonly ILogger _logger; + + public SystemManagementController(ISystemManagementService systemManagementService, ILogger logger) + { + _systemManagementService = systemManagementService; + _logger = logger; + } + + /// + /// 获取系统中所有枚举信息 + /// + /// 枚举信息列表 + [AllowAnonymous] + [HttpGet("enums")] + public async Task>> GetAllEnumsAsync() + { + try + { + var result = await _systemManagementService.GetAllEnumsAsync(); + return Success(result); + } + catch (Exception ex) + { + _logger.LogError(ex, "获取枚举信息异常"); + return BaseResponse>.Fail("获取枚举信息失败"); + } + } +}