refactor: 批量新增枚举类型并完成实体、DTO、服务层枚举替换
- 新增30+业务枚举类型覆盖用户、宠物、商城、社区、积分等模块 - 完成实体类、DTO、服务层的字符串枚举替换为强类型枚举 - 修复用户状态枚举名称变更,将Frozen改为Disabled - 新增批量发布社区消息接口与控制器实现 - 新增操作日志、积分管理、补偿任务相关服务与DTO
This commit is contained in:
@ -1,56 +1,16 @@
|
||||
using QYZH.InteractiveMagazine.Models.Enum;
|
||||
|
||||
namespace QYZH.InteractiveMagazine.Models.Dto.Compensation;
|
||||
|
||||
/// <summary>
|
||||
/// 补偿任务类型常量
|
||||
/// </summary>
|
||||
public static class CompensationTaskType
|
||||
{
|
||||
/// <summary>
|
||||
/// 宠物喂养补偿
|
||||
/// Payload: { "PetId": long, "GrowthPoints": int }
|
||||
/// </summary>
|
||||
public const string PetFeeding = "PetFeeding";
|
||||
|
||||
/// <summary>
|
||||
/// 用户积分补偿
|
||||
/// Payload: { "Points": int, "ChangeType": string, "Description": string }
|
||||
/// </summary>
|
||||
public const string UserPoints = "UserPoints";
|
||||
|
||||
/// <summary>
|
||||
/// 用户成长值补偿
|
||||
/// Payload: { "GrowthPoints": int }
|
||||
/// </summary>
|
||||
public const string UserGrowth = "UserGrowth";
|
||||
|
||||
/// <summary>
|
||||
/// 发送通知补偿
|
||||
/// Payload: { "TemplateId": string, "Data": object }
|
||||
/// </summary>
|
||||
public const string SendNotification = "SendNotification";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 补偿任务状态常量
|
||||
/// </summary>
|
||||
public static class CompensationTaskStatus
|
||||
{
|
||||
public const string Pending = "Pending";
|
||||
public const string Processing = "Processing";
|
||||
public const string Success = "Success";
|
||||
public const string Failed = "Failed";
|
||||
public const string Cancelled = "Cancelled";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建补偿任务输入
|
||||
/// </summary>
|
||||
public class CreateCompensationTaskInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务类型(使用 CompensationTaskType 常量)
|
||||
/// 任务类型(使用 CompensationTaskTypeEnum 枚举)
|
||||
/// </summary>
|
||||
public string TaskType { get; set; } = string.Empty;
|
||||
public CompensationTaskTypeEnum TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务来源(如 CheckIn、Purchase)
|
||||
@ -94,7 +54,7 @@ public class CreateCompensationTaskInput
|
||||
public class CompensationTaskOutput
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string TaskType { get; set; } = string.Empty;
|
||||
public CompensationTaskTypeEnum TaskType { get; set; }
|
||||
public string BusinessSource { get; set; } = string.Empty;
|
||||
public string? BusinessId { get; set; }
|
||||
public long UserId { get; set; }
|
||||
@ -103,7 +63,7 @@ public class CompensationTaskOutput
|
||||
public string ErrorSource { get; set; } = string.Empty;
|
||||
public int RetryCount { get; set; }
|
||||
public int MaxRetries { get; set; }
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public CompensationTaskStatusEnum Status { get; set; }
|
||||
public DateTime? ProcessedAt { get; set; }
|
||||
public DateTime? ScheduledAt { get; set; }
|
||||
public string? ResultMessage { get; set; }
|
||||
@ -118,12 +78,12 @@ public class GetCompensationTasksInput
|
||||
/// <summary>
|
||||
/// 按状态筛选
|
||||
/// </summary>
|
||||
public string? Status { get; set; }
|
||||
public CompensationTaskStatusEnum? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 按任务类型筛选
|
||||
/// </summary>
|
||||
public string? TaskType { get; set; }
|
||||
public CompensationTaskTypeEnum? TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 按业务来源筛选
|
||||
@ -142,9 +102,9 @@ public class GetCompensationTasksInput
|
||||
public class UpdateCompensationStatusInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 目标状态(使用 CompensationTaskStatus 常量)
|
||||
/// 目标状态(使用 CompensationTaskStatusEnum 枚举)
|
||||
/// </summary>
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public CompensationTaskStatusEnum Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理结果描述
|
||||
|
||||
Reference in New Issue
Block a user