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 TP037UseRollingDoorRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 當前任務編號
  13. /// </summary>
  14. /// <remarks>S[YYYYMMDDHH][Sequnce * 5]</remarks>
  15. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  16. public string CurrentTaskID { get; set; }
  17. /// <summary>
  18. /// 鐵捲門編號
  19. /// </summary>
  20. [Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)]
  21. public string RollingDoorID { get; set; }
  22. /// <summary>
  23. /// 動作模式
  24. /// </summary>
  25. /// <value>
  26. /// 0 = Open <br/>
  27. /// 1 = Close <br/>
  28. /// </value>
  29. [Required, JsonPropertyName("action_mode"), JsonPropertyOrder(103)]
  30. public RollingDoorActionMode ActionMode { get; set; }
  31. /// <summary>
  32. /// 取得使用鐵捲門請求
  33. /// </summary>
  34. /// <param name="transName">交易名稱</param>
  35. /// <param name="softwareID">軟體編號</param>
  36. /// <param name="currentTaskID">當前任務編號</param>
  37. /// <param name="rollingDoorID">鐵捲門編號</param>
  38. /// <param name="actionMode">動作模式</param>
  39. /// <returns>使用鐵捲門請求</returns>
  40. public static TP037UseRollingDoorRequestDto Get(TransactionName transName, string softwareID,
  41. string currentTaskID, string rollingDoorID, RollingDoorActionMode actionMode)
  42. {
  43. return new TP037UseRollingDoorRequestDto()
  44. {
  45. Timetick = DateTime.Now,
  46. TransactionName = transName.ToTransactionName(),
  47. SoftwareID = softwareID,
  48. CurrentTaskID = currentTaskID,
  49. RollingDoorID = rollingDoorID,
  50. ActionMode = actionMode
  51. };
  52. }
  53. }
  54. /// <summary>
  55. /// 使用鐵捲門回應類別
  56. /// </summary>
  57. public class FP038UseRollingDoorResponseDto : CommonMessage
  58. {
  59. /// <summary>
  60. /// 當前任務編號
  61. /// </summary>
  62. /// <remarks>S[YYYYMMDDHH][SEQ * 5]</remarks>
  63. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  64. public string CurrentTaskID { get; set; }
  65. /// <summary>
  66. /// 鐵捲門編號
  67. /// </summary>
  68. [Required, StringLength(9), JsonPropertyName("rolling_door_id"), JsonPropertyOrder(102)]
  69. public string RollingDoorID { get; set; }
  70. /// <summary>
  71. /// 動作模式
  72. /// </summary>
  73. /// <value>
  74. /// 0 = Open <br/>
  75. /// 1 = Close <br/>
  76. /// </value>
  77. [Required, JsonPropertyName("action_mode"), JsonPropertyOrder(103)]
  78. public RollingDoorActionMode ActionMode { get; set; }
  79. /// <summary>
  80. /// 結果代碼
  81. /// </summary>
  82. /// <value>
  83. /// 0 = Success <br/>
  84. /// 1 = Reject <br/>
  85. /// </value>
  86. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)]
  87. public UseRollingDoorResultCode ResultCode { get; set; }
  88. }
  89. }