using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 呼叫電梯請求類別 /// public class TP021CallLifterRequestDto : CommonMessage { /// /// 當下任務編號 /// /// A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMDDHH][Sequnce * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 站點編號 /// [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// /// 目標樓層 /// [Required, JsonPropertyName("floor"), JsonPropertyOrder(103)] public int Floor { get; set; } /// /// 取得呼叫電梯請求 /// /// 交易名稱 /// 軟體編號 /// 當下任務編號 /// 站點編號 /// 目標樓層 /// 呼叫電梯請求 public static TP021CallLifterRequestDto Get(TransactionName transName, string softwareID, string currentTaskID, string stationID, int floor) { return new TP021CallLifterRequestDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, CurrentTaskID = currentTaskID, StationID = stationID, Floor = floor }; } } /// /// 呼叫電梯回應類別 /// public class FP022CallLifterReponseDto : CommonMessage { /// /// 當下任務編號 /// /// A[YYYYMMDDHH][Sequnce * 5] [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)] public string CurrentTaskID { get; set; } /// /// 站點編號 /// [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)] public string StationID { get; set; } /// /// 目標樓層 /// [Required, JsonPropertyName("floor"), JsonPropertyOrder(103)] public int Floor { get; set; } /// /// 結果代碼 /// /// /// 0 = Success
/// 1 = Reject
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)] public CallLifterResultCode ResultCode { get; set; } } }