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