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.

90 lines
3.3 KiB

8 months ago
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Text.Json.Serialization;
  4. namespace Mirle.Component.API.ProgrammableLogicController.Models
  5. {
  6. /// <summary>
  7. /// 使用維修門請求
  8. /// </summary>
  9. public class FP031UseRapairDoorRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 站點編號
  13. /// </summary>
  14. [Required, StringLength(9), JsonPropertyName("stationd_id"), JsonPropertyOrder(101)]
  15. public string StationID { get; set; }
  16. /// <summary>
  17. /// 維修門編號
  18. /// </summary>
  19. [Required, StringLength(9), JsonPropertyName("repair_door_id"), JsonPropertyOrder(102)]
  20. public string RepairDoorID { get; set; }
  21. /// <summary>
  22. /// 動作模式
  23. /// </summary>
  24. /// <value>
  25. /// 0 = Open <br/>
  26. /// 1 = Close <br/>
  27. /// </value>
  28. [Required, JsonPropertyName("action_mode"), JsonPropertyOrder(103)]
  29. public RepairDoorActionMode ActionMode { get; set; }
  30. }
  31. /// <summary>
  32. /// 使用維修門回應類別
  33. /// </summary>
  34. public class TP032UseRepairDoorResponseDto : CommonMessage
  35. {
  36. /// <summary>
  37. /// 站點編號
  38. /// </summary>
  39. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  40. public string StationID { get; set; }
  41. /// <summary>
  42. /// 維修門編號
  43. /// </summary>
  44. [Required, StringLength(9), JsonPropertyName("repair_door_id"), JsonPropertyOrder(102)]
  45. public string RepairDoorID { get; set; }
  46. /// <summary>
  47. /// 動作模式
  48. /// </summary>
  49. /// <value>
  50. /// 0 = Open <br/>
  51. /// 1 = Close <br/>
  52. /// </value>
  53. [Required, JsonPropertyName("action_mode"), JsonPropertyOrder(103)]
  54. public RepairDoorActionMode ActionMode { get; set; }
  55. /// <summary>
  56. /// 結果代碼
  57. /// </summary>
  58. /// <value>
  59. /// 0 = Success <br/>
  60. /// 1 = Repair Door Not Exist <br/>
  61. /// </value>
  62. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)]
  63. public UseRepairDoorResultCode ResultCode { get; set; }
  64. /// <summary>
  65. /// 取得使用維修門回應
  66. /// </summary>
  67. /// <param name="transName">交易名稱</param>
  68. /// <param name="softwareID">軟體編號</param>
  69. /// <param name="stationID">站點編號</param>
  70. /// <param name="reapirDoorID">維修門編號</param>
  71. /// <param name="actionMode">動作模式</param>
  72. /// <param name="resultCode">使用維修門回應</param>
  73. /// <returns>使用維修門回應</returns>
  74. public static TP032UseRepairDoorResponseDto Get(TransactionName transName, string softwareID,
  75. string stationID, string reapirDoorID, RepairDoorActionMode actionMode, UseRepairDoorResultCode resultCode)
  76. {
  77. return new TP032UseRepairDoorResponseDto()
  78. {
  79. Timetick = DateTime.Now,
  80. TransactionName = transName.ToTransactionName(),
  81. SoftwareID = softwareID,
  82. StationID = stationID,
  83. RepairDoorID = reapirDoorID,
  84. ActionMode = actionMode,
  85. ResultCode = resultCode
  86. };
  87. }
  88. }
  89. }