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.

82 lines
3.0 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 TP021CallLifterRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 當下任務編號
  13. /// </summary>
  14. /// <remarks>A[YYYYMMDDHH][Sequnce * 5]/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("station_id"), JsonPropertyOrder(102)]
  21. public string StationID { get; set; }
  22. /// <summary>
  23. /// 目標樓層
  24. /// </summary>
  25. [Required, JsonPropertyName("floor"), JsonPropertyOrder(103)]
  26. public int Floor { get; set; }
  27. /// <summary>
  28. /// 取得呼叫電梯請求
  29. /// </summary>
  30. /// <param name="transName">交易名稱</param>
  31. /// <param name="softwareID">軟體編號</param>
  32. /// <param name="currentTaskID">當下任務編號</param>
  33. /// <param name="stationID">站點編號</param>
  34. /// <param name="floor">目標樓層</param>
  35. /// <returns>呼叫電梯請求</returns>
  36. public static TP021CallLifterRequestDto Get(TransactionName transName, string softwareID,
  37. string currentTaskID, string stationID, int floor)
  38. {
  39. return new TP021CallLifterRequestDto()
  40. {
  41. Timetick = DateTime.Now,
  42. TransactionName = transName.ToTransactionName(),
  43. SoftwareID = softwareID,
  44. CurrentTaskID = currentTaskID,
  45. StationID = stationID,
  46. Floor = floor
  47. };
  48. }
  49. }
  50. /// <summary>
  51. /// 呼叫電梯回應類別
  52. /// </summary>
  53. public class FP022CallLifterReponseDto : CommonMessage
  54. {
  55. /// <summary>
  56. /// 當下任務編號
  57. /// </summary>
  58. /// <remarks>A[YYYYMMDDHH][Sequnce * 5]</remarks>
  59. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  60. public string CurrentTaskID { get; set; }
  61. /// <summary>
  62. /// 站點編號
  63. /// </summary>
  64. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  65. public string StationID { get; set; }
  66. /// <summary>
  67. /// 目標樓層
  68. /// </summary>
  69. [Required, JsonPropertyName("floor"), JsonPropertyOrder(103)]
  70. public int Floor { get; set; }
  71. /// <summary>
  72. /// 結果代碼
  73. /// </summary>
  74. /// <value>
  75. /// 0 = Success <br/>
  76. /// 1 = Reject <br/>
  77. /// </value>
  78. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)]
  79. public CallLifterResultCode ResultCode { get; set; }
  80. }
  81. }