2025-09-22 22:58:51 +08:00
|
|
|
using System.Collections.Generic;
|
2025-09-16 12:29:09 +08:00
|
|
|
using DMS.Core.Models.Triggers;
|
2025-09-14 16:16:10 +08:00
|
|
|
|
2025-09-16 12:29:09 +08:00
|
|
|
// 引入枚举
|
|
|
|
|
|
|
|
|
|
namespace DMS.Application.DTOs
|
2025-09-14 16:16:10 +08:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 触发器定义 DTO (用于应用层与表示层之间的数据传输)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class TriggerDefinitionDto
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 触发器唯一标识符
|
|
|
|
|
/// </summary>
|
2025-09-14 19:58:18 +08:00
|
|
|
public int Id { get; set; }
|
2025-09-14 16:16:10 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
2025-09-22 22:58:51 +08:00
|
|
|
/// 关联的变量 ID 列表
|
2025-09-14 16:16:10 +08:00
|
|
|
/// </summary>
|
2025-09-22 22:58:51 +08:00
|
|
|
public List<int> VariableIds { get; set; } = new List<int>();
|
2025-09-14 16:16:10 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 触发器是否处于激活状态
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsActive { get; set; }
|
|
|
|
|
|
|
|
|
|
// --- 条件部分 ---
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 触发条件类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ConditionType Condition { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 阈值 (用于 GreaterThan, LessThan, EqualTo, NotEqualTo)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double? Threshold { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 下限 (用于 InRange, OutOfRange)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double? LowerBound { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 上限 (用于 InRange, OutOfRange)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double? UpperBound { get; set; }
|
|
|
|
|
|
|
|
|
|
// --- 动作部分 ---
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 动作类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ActionType Action { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 动作配置 JSON 字符串
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ActionConfigurationJson { get; set; }
|
|
|
|
|
|
|
|
|
|
// --- 抑制与状态部分 ---
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 抑制持续时间
|
|
|
|
|
/// </summary>
|
|
|
|
|
public TimeSpan? SuppressionDuration { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 上次触发的时间
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DateTime? LastTriggeredAt { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 触发器描述
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Description { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 创建时间
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DateTime CreatedAt { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 最后更新时间
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DateTime UpdatedAt { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|