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.

78 lines
2.6 KiB

8 months ago
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Text.Json.Serialization;
  4. namespace Mirle.Component.API.WarehouseExecutionSystem.Models
  5. {
  6. /// <summary>
  7. /// 緊急應變請求類別
  8. /// </summary>
  9. public class TW017EmergencyEventRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 緊急事件類別
  13. /// </summary>
  14. /// <value>
  15. /// 0 = Earthquake
  16. /// 1 = Fire
  17. /// </value>
  18. [Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)]
  19. public EmergencyEvent EventType { get; set; }
  20. /// <summary>
  21. /// 取得緊急應變請求
  22. /// </summary>
  23. /// <param name="transName">交易名稱</param>
  24. /// <param name="eventType">緊急事件類別</param>
  25. /// <returns>緊急應變請求</returns>
  26. public static TW017EmergencyEventRequestDto Get(TransactionName transName, EmergencyEvent eventType)
  27. {
  28. return new TW017EmergencyEventRequestDto()
  29. {
  30. Timetick = DateTime.Now,
  31. TransactionName = transName.ToTransactionName(),
  32. EventType = eventType
  33. };
  34. }
  35. }
  36. /// <summary>
  37. /// 緊急應變回應類別
  38. /// </summary>
  39. public class FW018EmergencyEventResponseDto : CommonMessage
  40. {
  41. /// <summary>
  42. /// 緊急事件類別
  43. /// </summary>
  44. /// <value>
  45. /// 0 = Earthquake
  46. /// 1 = Fire
  47. /// </value>
  48. [Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)]
  49. public EmergencyEvent EventType { get; set; }
  50. /// <summary>
  51. /// 結果代碼
  52. /// </summary>
  53. /// <value>
  54. /// 0 = Success <br/>
  55. /// 1 = Failed <br/>
  56. /// </value>
  57. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
  58. public EmergencyEventResultCode ResultCode { get; set; }
  59. /// <summary>
  60. /// 取得緊急應變回應
  61. /// </summary>
  62. /// <param name="transName">交易名稱</param>
  63. /// <param name="eventType">事件類別</param>
  64. /// <param name="resultCode">結果代碼</param>
  65. /// <returns>緊急應變回應</returns>
  66. public static FW018EmergencyEventResponseDto Get(TransactionName transName, EmergencyEvent eventType, EmergencyEventResultCode resultCode)
  67. {
  68. return new FW018EmergencyEventResponseDto()
  69. {
  70. Timetick = DateTime.Now,
  71. TransactionName = transName.ToTransactionName(),
  72. EventType = eventType,
  73. ResultCode = resultCode
  74. };
  75. }
  76. }
  77. }