using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 使用鐵捲門請求類別 /// public class TP037UseRollingDoorRequestDto : CommonMessage { /// /// 當前任務編號 /// /// S[YYYYMMDDHH][Sequnce * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 鐵捲門編號 /// [Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)] public string RollingDoorID { get; set; } /// /// 動作模式 /// /// /// 0 = Open
/// 1 = Close
///
[Required, JsonPropertyName("action_mode"), JsonPropertyOrder(103)] public RollingDoorActionMode ActionMode { get; set; } /// /// 取得使用鐵捲門請求 /// /// 交易名稱 /// 軟體編號 /// 當前任務編號 /// 鐵捲門編號 /// 動作模式 /// 使用鐵捲門請求 public static TP037UseRollingDoorRequestDto Get(TransactionName transName, string softwareID, string currentTaskID, string rollingDoorID, RollingDoorActionMode actionMode) { return new TP037UseRollingDoorRequestDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, CurrentTaskID = currentTaskID, RollingDoorID = rollingDoorID, ActionMode = actionMode }; } } /// /// 使用鐵捲門回應類別 /// public class FP038UseRollingDoorResponseDto : CommonMessage { /// /// 當前任務編號 /// /// S[YYYYMMDDHH][SEQ * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 鐵捲門編號 /// [Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)] public string RollingDoorID { get; set; } /// /// 動作模式 /// /// /// 0 = Open
/// 1 = Close
///
[Required, JsonPropertyName("action_mode"), JsonPropertyOrder(103)] public RollingDoorActionMode ActionMode { get; set; } /// /// 結果代碼 /// /// /// 0 = Success
/// 1 = Reject
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)] public UseRollingDoorResultCode ResultCode { get; set; } } }