You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.0 KiB
63 lines
2.0 KiB
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Mirle.Component.API.ProgrammableLogicController.Models
|
|
{
|
|
/// <summary>
|
|
/// 緊急應變請求類別
|
|
/// </summary>
|
|
public class TP051EmergencyEventRequestDto : CommonMessage
|
|
{
|
|
/// <summary>
|
|
/// 緊急事件
|
|
/// </summary>
|
|
/// <value>
|
|
/// 0 = Earthquake
|
|
/// 1 = Fire
|
|
/// </value>
|
|
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)]
|
|
public EmergencyEvent EventType { get; set; }
|
|
/// <summary>
|
|
/// 取得緊急應變請求
|
|
/// </summary>
|
|
/// <param name="transName">交易名稱</param>
|
|
/// <param name="softwareID">軟體編號</param>
|
|
/// <param name="eventType">事件類別</param>
|
|
/// <returns>緊急應變請求</returns>
|
|
public static TP051EmergencyEventRequestDto Get(TransactionName transName, string softwareID, EmergencyEvent eventType)
|
|
{
|
|
return new TP051EmergencyEventRequestDto()
|
|
{
|
|
Timetick = DateTime.Now,
|
|
TransactionName = transName.ToTransactionName(),
|
|
SoftwareID = softwareID,
|
|
EventType = eventType
|
|
};
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 緊急應變請求類別
|
|
/// </summary>
|
|
public class FP052EmergencyEventResponseDto : CommonMessage
|
|
{
|
|
/// <summary>
|
|
/// 緊急事件類別
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 0 = Earthquake <br/>
|
|
/// 1 = Fire <br/>
|
|
/// </remarks>
|
|
[Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)]
|
|
public EmergencyEvent EventType { get; set; }
|
|
/// <summary>
|
|
/// 結果代碼
|
|
/// </summary>
|
|
/// <value>
|
|
/// 0 = Success <br/>
|
|
/// 1 = Failed <br/>
|
|
/// </value>
|
|
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
|
|
public EmergencyEventResultCode ResultCode { get; set; }
|
|
}
|
|
}
|