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.

63 lines
2.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 TP051EmergencyEventRequestDto : 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="softwareID">軟體編號</param>
  25. /// <param name="eventType">事件類別</param>
  26. /// <returns>緊急應變請求</returns>
  27. public static TP051EmergencyEventRequestDto Get(TransactionName transName, string softwareID, EmergencyEvent eventType)
  28. {
  29. return new TP051EmergencyEventRequestDto()
  30. {
  31. Timetick = DateTime.Now,
  32. TransactionName = transName.ToTransactionName(),
  33. SoftwareID = softwareID,
  34. EventType = eventType
  35. };
  36. }
  37. }
  38. /// <summary>
  39. /// 緊急應變請求類別
  40. /// </summary>
  41. public class FP052EmergencyEventResponseDto : CommonMessage
  42. {
  43. /// <summary>
  44. /// 緊急事件類別
  45. /// </summary>
  46. /// <remarks>
  47. /// 0 = Earthquake <br/>
  48. /// 1 = Fire <br/>
  49. /// </remarks>
  50. [Required, JsonPropertyName("event_type"), JsonPropertyOrder(101)]
  51. public EmergencyEvent EventType { get; set; }
  52. /// <summary>
  53. /// 結果代碼
  54. /// </summary>
  55. /// <value>
  56. /// 0 = Success <br/>
  57. /// 1 = Failed <br/>
  58. /// </value>
  59. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
  60. public EmergencyEventResultCode ResultCode { get; set; }
  61. }
  62. }