refactor: 重构勋章模块,拆分规则独立管理,优化期刊绑定逻辑
1. 新增MedalRule实体类,将勋章条件拆分独立为规则管理 2. 重构Medal相关服务和DTO,支持勋章规则的增删改查 3. 简化Journal绑定逻辑,移除冗余的实例化期刊校验和字段 4. 重命名部分实体类,统一命名前缀 5. 为勋章相关操作添加事务管理,优化异常处理逻辑
This commit is contained in:
101
QYZH.InteractiveMagazine.Models/Entity/MedalRule.cs
Normal file
101
QYZH.InteractiveMagazine.Models/Entity/MedalRule.cs
Normal file
@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
|
||||
namespace QYZH.InteractiveMagazine.Models.Entity
|
||||
{
|
||||
///<summary>
|
||||
///勋章获取规则配置表
|
||||
///</summary>
|
||||
[SugarTable("MedalRule")]
|
||||
public partial class MedalRule : SqlSugarBaseEntity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Desc:关联的勋章ID
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public long MedalId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:目标表名(如:JournalPageTask、UserAction等)
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string TargetTable {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:目标字段名(如:TotalScore、LoginDays等)
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string TargetField {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:比较运算符: >=, >, =, <=, <
|
||||
/// Default:>=
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string Operator {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:阈值数量
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public int ThresholdValue {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:额外筛选条件(JSON格式,如:{"Type": 1, "Status": 2})
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string FilterCondition {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:时间范围类型: All/CurrentMonth/CurrentWeek/Last7Days/Custom
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string DateRangeType {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:自定义起始时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? DateRangeStart {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:自定义结束时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? DateRangeEnd {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:多规则间的逻辑关系: AND/OR
|
||||
/// Default:AND
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string LogicOperator {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:规则执行顺序(多个规则时生效)
|
||||
/// Default:0
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public int RuleOrder {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:规则说明
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Description {get;set;}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user