Files
IOT_API/Model/Entity/System/SystemParamEntity.cs

61 lines
3.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using SqlSugar;
namespace Model.Entity.System
{
/// <summary>
/// 系统参数配置表(键值对形式存储业务可调参数,按 Group 分组展示)
/// 内置参数(IsSystem=1)禁止删除,仅允许修改 Value
/// </summary>
[SugarTable("sys_param")]
public class SystemParamEntity : BaseEntity
{
/// <summary>参数键(唯一,业务侧按 Key 取值,如 data_collect_default_frequency</summary>
[SugarColumn(ColumnName = "ParamKey", ColumnDescription = "参数键(唯一)", Length = 64, IsNullable = false)]
public string ParamKey { get; set; }
/// <summary>参数名称(中文展示名)</summary>
[SugarColumn(ColumnName = "ParamName", ColumnDescription = "参数名称", Length = 100, IsNullable = false)]
public string ParamName { get; set; }
/// <summary>参数值(统一字符串存储,业务侧按 ParamType 自行转换)</summary>
[SugarColumn(ColumnName = "ParamValue", ColumnDescription = "参数值", ColumnDataType = "text", IsNullable = true)]
public string? ParamValue { get; set; }
/// <summary>值类型(0=int, 1=text, 2=enum, 3=json)决定前端渲染控件</summary>
[SugarColumn(ColumnName = "ParamType", ColumnDescription = "值类型(0=int,1=text,2=enum,3=json", ColumnDataType = "smallint", DefaultValue = "1")]
public byte ParamType { get; set; }
/// <summary>枚举选项(JSON 数组,如 [{"value":"feishu","label":"飞书"}];仅 ParamType=enum 使用)</summary>
[SugarColumn(ColumnName = "ParamOptions", ColumnDescription = "枚举选项(JSON数组)", ColumnDataType = "text", IsNullable = true)]
public string? ParamOptions { get; set; }
/// <summary>单位(如 秒/MB,前端展示用)</summary>
[SugarColumn(ColumnName = "Unit", ColumnDescription = "单位", Length = 20, IsNullable = true)]
public string? Unit { get; set; }
/// <summary>分组(如 数据采集/告警/工单/文件,前端按分组卡片展示)</summary>
[SugarColumn(ColumnName = "Group", ColumnDescription = "分组", Length = 50, IsNullable = true)]
public string? Group { get; set; }
/// <summary>排序号</summary>
[SugarColumn(ColumnName = "Sort", ColumnDescription = "排序号", DefaultValue = "0")]
public int Sort { get; set; }
/// <summary>备注(注释提示,如工单编号规则占位符说明)</summary>
[SugarColumn(ColumnName = "Remark", ColumnDescription = "备注", Length = 500, IsNullable = true)]
public string? Remark { get; set; }
/// <summary>是否系统内置(1=内置不可删,0=用户自定义)</summary>
[SugarColumn(ColumnName = "IsSystem", ColumnDescription = "是否系统内置(1=不可删,0=可删)", ColumnDataType = "smallint", DefaultValue = "0")]
public byte IsSystem { get; set; }
/// <summary>最后修改人</summary>
[SugarColumn(ColumnName = "LastUpdateUser", ColumnDescription = "最后修改人", Length = 50, IsNullable = true)]
public string? LastUpdateUser { get; set; }
/// <summary>最后修改时间</summary>
[SugarColumn(ColumnName = "LastUpdateTime", ColumnDescription = "最后修改时间", IsNullable = true)]
public DateTime? LastUpdateTime { get; set; }
}
}