refactor: 批量新增枚举类型并完成实体、DTO、服务层枚举替换
- 新增30+业务枚举类型覆盖用户、宠物、商城、社区、积分等模块 - 完成实体类、DTO、服务层的字符串枚举替换为强类型枚举 - 修复用户状态枚举名称变更,将Frozen改为Disabled - 新增批量发布社区消息接口与控制器实现 - 新增操作日志、积分管理、补偿任务相关服务与DTO
This commit is contained in:
@ -6,6 +6,7 @@ using QYZH.InteractiveMagazine.Infrastructure.Cache;
|
||||
using QYZH.InteractiveMagazine.IService;
|
||||
using QYZH.InteractiveMagazine.Models.Common;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
using QYZH.InteractiveMagazine.Models.Enum;
|
||||
using QYZH.InteractiveMagazine.Models.Settings;
|
||||
using QYZH.InteractiveMagazine.Models.WeChat;
|
||||
using QYZH.InteractiveMagazine.Repository;
|
||||
@ -70,8 +71,8 @@ public class WeChatAuthService(BaseRepository<Users> usersRepository, IConfigura
|
||||
OpenId = wxResponse.OpenId,
|
||||
UnionId = wxResponse.UnionId,
|
||||
Phone = phone,
|
||||
Type = "Normal",
|
||||
Status = "Active",
|
||||
Type = UsersTypeEnum.Normal,
|
||||
Status = UserStatusEnum.Active,
|
||||
GrowthPoints = 0,
|
||||
Points = 0,
|
||||
IsLastOnline = true
|
||||
@ -189,7 +190,7 @@ public class WeChatAuthService(BaseRepository<Users> usersRepository, IConfigura
|
||||
throw new BusinessException("无法切换到该用户", 403);
|
||||
}
|
||||
|
||||
if (targetUser.Status == "Disabled")
|
||||
if (targetUser.Status == UserStatusEnum.Disabled)
|
||||
{
|
||||
throw new BusinessException("目标账号已被禁用", 403);
|
||||
}
|
||||
@ -345,8 +346,8 @@ public class WeChatAuthService(BaseRepository<Users> usersRepository, IConfigura
|
||||
Phone = user.Phone,
|
||||
Points = user.Points,
|
||||
GrowthPoints = user.GrowthPoints,
|
||||
Type = user.Type,
|
||||
Status = user.Status,
|
||||
Type = user.Type.ToString(),
|
||||
Status = user.Status.ToString(),
|
||||
IsLastOnline = user.IsLastOnline,
|
||||
CreatedAt = user.CreatedAt,
|
||||
UpdatedAt = user.UpdatedAt,
|
||||
|
||||
Reference in New Issue
Block a user