using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
///
/// 心跳包回報類別
///
public class FP041HeartbeatReportDto : CommonMessage
{
///
/// 取得心跳包回報
///
/// 交易名稱
/// 軟體編號
/// 心跳包回報
public static FP041HeartbeatReportDto Get(TransactionName transName, string softwareID)
{
return new FP041HeartbeatReportDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID
};
}
}
///
/// 心跳包回應類別
///
public class TP042HeartbeatAckDto : CommonMessage
{
///
/// 回應代碼
///
///
/// 0 = OK
/// 1 = NG
///
[Required, JsonPropertyName("reply_code"), JsonPropertyOrder(101)]
public ReplyCode ReplyCode { get; set; }
///
/// 取得心跳包回應
///
/// 交易名稱
/// 軟體編號
/// 回應代碼
/// 心跳包回應
public static TP042HeartbeatAckDto Get(TransactionName transName, string softwareID, ReplyCode replyCode)
{
return new TP042HeartbeatAckDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
ReplyCode = replyCode
};
}
}
}