using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
///
/// 維修門狀態回報類別
///
public class FP035RepairDoorStatusReportDto : CommonMessage
{
///
/// 維修門編號
///
[Required, StringLength(9), JsonPropertyName("repair_door_id"), JsonPropertyOrder(101)]
public string RepairDoorID { get; set; }
///
/// 維修門狀態
///
///
/// 0 = Open
/// 1 = Force Open
/// 2 = Close
///
[Required, JsonPropertyName("repair_door_status"), JsonPropertyOrder(102)]
public RepairDoorStatus RepairDoorStatus { get; set; }
}
///
/// 維修門狀態回應類別
///
public class TP036RepairDoorStatusAckDto : CommonMessage
{
///
/// 維修門編號
///
[Required, StringLength(9), JsonPropertyName("repair_door_id"), JsonPropertyOrder(101)]
public string RepairDoorID { get; set; }
///
/// 維修門狀態
///
///
/// 0 = Open
/// 1 = Force Open
/// 2 = Close
///
[Required, JsonPropertyName("repair_door_status"), JsonPropertyOrder(102)]
public RepairDoorStatus RepairDoorStatus { get; set; }
///
/// 回應代碼
///
///
/// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(103)]
public ReplyCode ReplyCode { get; set; }
///
/// 取得維修門狀態回應
///
/// 交易名稱
/// 軟體編號
/// 維修門編號
/// 維修門狀態
/// 回應代碼
/// 維修門狀態回應
public static TP036RepairDoorStatusAckDto Get(TransactionName transName, string softwareID, string repairDoorID, RepairDoorStatus repairDoorStatus, ReplyCode replyCode)
{
return new TP036RepairDoorStatusAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
RepairDoorID = repairDoorID,
RepairDoorStatus = repairDoorStatus,
ReplyCode = replyCode
};
}
}
}