using System; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Mirle.Component.API.ProgrammableLogicController.Models { /// /// 執行命令回報類別 /// public class FP003ExecuteCommandReportDto : CommonMessage { /// /// 設備編號 /// [Required, StringLength(10), JsonPropertyName("vehicle_id"), JsonPropertyOrder(101)] public string VehicleID { get; set; } /// /// 任務起始時間 /// [Required, JsonPropertyName("start_time"), JsonPropertyOrder(102)] public DateTime StartTime { get; set; } } /// /// 執行命令回應類別 /// public class TP004ExecuteCommandAckDto : CommonMessage { /// /// 回應代碼 /// /// /// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(101)] public ReplyCode ReplyCode { get; set; } /// /// 取得執行命令回應 /// /// 交易名稱 /// 軟體編號 /// 任務編號 /// 回應代碼 /// 執行命令回應 public static TP004ExecuteCommandAckDto Get(TransactionName transName, string softwareID, string taskID, ReplyCode replyCode) { return new TP004ExecuteCommandAckDto() { Timetick = DateTime.Now, TransactionName = transName.ToTransactionName(), SoftwareID = softwareID, TaskID = taskID, ReplyCode = replyCode }; } } }