using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 緊急應變請求類別 /// public class TP051EmergencyEventRequestDto : CommonMessage { /// /// 緊急事件 /// /// /// 0 = Earthquake /// 1 = Fire /// [Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)] public EmergencyEvent EventType { get; set; } /// /// 取得緊急應變請求 /// /// 交易名稱 /// 軟體編號 /// 事件類別 /// 緊急應變請求 public static TP051EmergencyEventRequestDto Get(TransactionName transName, string softwareID, EmergencyEvent eventType) { return new TP051EmergencyEventRequestDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, EventType = eventType }; } } /// /// 緊急應變請求類別 /// public class FP052EmergencyEventResponseDto : CommonMessage { /// /// 緊急事件類別 /// /// /// 0 = Earthquake
/// 1 = Fire
///
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)] public EmergencyEvent EventType { get; set; } /// /// 結果代碼 /// /// /// 0 = Success
/// 1 = Failed
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)] public EmergencyEventResultCode ResultCode { get; set; } } }