using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Mirle.Component.API.ProgrammableLogicController.Models
{
///
/// 取消命令請求類別
///
public class TP007CancelCommandRequestDto : CommonMessage
{
///
/// 取消模式
///
///
/// 0 = Cancel
/// 1 = Force Cancel
/// 2 = Force Complete
///
[Required, JsonPropertyName("cancel_mode"), JsonPropertyOrder(5)]
public TaskCancelMode CancelMode { get; set; }
///
/// 取得取消命令請求
///
/// 交易名稱
/// 軟體編號
/// 任務編號
/// 取消模式
/// 取消命令請求
public static TP007CancelCommandRequestDto Get(TransactionName transName, string softwareID, string taskID, TaskCancelMode cancelMode)
{
return new TP007CancelCommandRequestDto()
{
Timetick = DateTime.Now,
TransactionName = transName.ToTransactionName(),
SoftwareID = softwareID,
TaskID = taskID,
CancelMode = cancelMode
};
}
}
///
/// 取消命令回應類別
///
public class FP008CancelCommandResponseDto : CommonMessage
{
///
/// 取消類別
///
///
/// 0 = Cancel
/// 1 = Force Cancel
/// 2 = Force Complete
///
[Required, JsonPropertyName("cancel_mode"), JsonPropertyOrder(101)]
public TaskCancelMode CancelMode { get; set; }
///
/// 結果代碼
///
///
/// 0 = Success
/// 1 = Reject
///
[Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
public CancelCommandResultCode ResultCode { get; set; }
}
}