refactor: 批量新增枚举类型并完成实体、DTO、服务层枚举替换
- 新增30+业务枚举类型覆盖用户、宠物、商城、社区、积分等模块 - 完成实体类、DTO、服务层的字符串枚举替换为强类型枚举 - 修复用户状态枚举名称变更,将Frozen改为Disabled - 新增批量发布社区消息接口与控制器实现 - 新增操作日志、积分管理、补偿任务相关服务与DTO
This commit is contained in:
@ -6,6 +6,7 @@ using QYZH.InteractiveMagazine.IService;
|
||||
using QYZH.InteractiveMagazine.Models.Common;
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
using QYZH.InteractiveMagazine.Models.Enum;
|
||||
using QYZH.InteractiveMagazine.Repository;
|
||||
using SqlSugar;
|
||||
|
||||
@ -64,7 +65,7 @@ public class AdminUserService(BaseRepository<AdminUser> adminUserRepository, ILo
|
||||
|
||||
logger.LogInformation("管理员创建成功,用户名: {UserName}, ID: {Id}", input.UserName, adminUser.Id);
|
||||
|
||||
return new AdminUserOutput { Id = adminUser.Id, UserName = adminUser.UserName, Type = adminUser.Type, Status = adminUser.Status, CreatedBy = adminUser.CreatedBy, CreatedAt = adminUser.CreatedAt, UpdatedBy = adminUser.UpdatedBy, UpdatedAt = adminUser.UpdatedAt };
|
||||
return new AdminUserOutput { Id = adminUser.Id, UserName = adminUser.UserName, Type = adminUser.Type.ToString(), Status = adminUser.Status, CreatedBy = adminUser.CreatedBy, CreatedAt = adminUser.CreatedAt, UpdatedBy = adminUser.UpdatedBy, UpdatedAt = adminUser.UpdatedAt };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -100,10 +101,7 @@ public class AdminUserService(BaseRepository<AdminUser> adminUserRepository, ILo
|
||||
adminUser.PasswordHash = BCrypt.Net.BCrypt.HashPassword(input.Password);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(input.Type))
|
||||
{
|
||||
adminUser.Type = input.Type;
|
||||
}
|
||||
adminUser.Type = input.Type;
|
||||
|
||||
|
||||
adminUser.UpdatedBy = "System";
|
||||
@ -118,7 +116,7 @@ public class AdminUserService(BaseRepository<AdminUser> adminUserRepository, ILo
|
||||
|
||||
logger.LogInformation("管理员更新成功,ID: {Id}", id);
|
||||
|
||||
return new AdminUserOutput { Id = adminUser.Id, UserName = adminUser.UserName, Type = adminUser.Type, Status = adminUser.Status, CreatedBy = adminUser.CreatedBy, CreatedAt = adminUser.CreatedAt, UpdatedBy = adminUser.UpdatedBy, UpdatedAt = adminUser.UpdatedAt };
|
||||
return new AdminUserOutput { Id = adminUser.Id, UserName = adminUser.UserName, Type = adminUser.Type.ToString(), Status = adminUser.Status, CreatedBy = adminUser.CreatedBy, CreatedAt = adminUser.CreatedAt, UpdatedBy = adminUser.UpdatedBy, UpdatedAt = adminUser.UpdatedAt };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -162,7 +160,7 @@ public class AdminUserService(BaseRepository<AdminUser> adminUserRepository, ILo
|
||||
{
|
||||
Id = adminUser.Id,
|
||||
UserName = adminUser.UserName,
|
||||
Type = adminUser.Type,
|
||||
Type = adminUser.Type.ToString(),
|
||||
Status = adminUser.Status,
|
||||
CreatedBy = adminUser.CreatedBy,
|
||||
CreatedAt = adminUser.CreatedAt,
|
||||
@ -195,7 +193,7 @@ public class AdminUserService(BaseRepository<AdminUser> adminUserRepository, ILo
|
||||
{
|
||||
Id = a.Id,
|
||||
UserName = a.UserName,
|
||||
Type = a.Type,
|
||||
Type = a.Type.ToString(),
|
||||
Status = a.Status,
|
||||
CreatedBy = a.CreatedBy,
|
||||
CreatedAt = a.CreatedAt,
|
||||
|
||||
Reference in New Issue
Block a user