MqttDto.java 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. package com.xy.dto;
  2. import com.fasterxml.jackson.annotation.JsonFormat;
  3. import com.xy.utils.PageBean;
  4. import io.swagger.annotations.ApiModel;
  5. import io.swagger.annotations.ApiModelProperty;
  6. import lombok.Data;
  7. import lombok.experimental.Accessors;
  8. import javax.validation.constraints.NotBlank;
  9. import java.time.LocalDate;
  10. import java.time.LocalDateTime;
  11. @Data
  12. @ApiModel("指令交互类")
  13. @Accessors(chain = true)
  14. public class MqttDto {
  15. @NotBlank(message = "deviceId不能为空")
  16. @ApiModelProperty(value = "设备id", required = true)
  17. private Long deviceId;
  18. @ApiModelProperty("是否调试模式 默认=false")
  19. private Boolean debug = false;
  20. @ApiModelProperty("消息级别qs 默认=1")
  21. private Integer level = 1;
  22. @ApiModelProperty("消息消费时间(延迟消费) yyyy-MM-dd HH:mm:ss")
  23. private String delayTime;
  24. @ApiModelProperty("指令有效期,单位:s 默认=60")
  25. private Integer timeout = 60;
  26. @ApiModelProperty(value = "指令对象", required = true)
  27. private PaterDto pater;
  28. @Data
  29. @Accessors(chain = true)
  30. public static class Page extends Vo2 {
  31. @ApiModelProperty("分页对象")
  32. private PageBean page;
  33. @JsonFormat(pattern = "yyyy-MM-dd")
  34. @ApiModelProperty(value = "发送时间-起")
  35. private LocalDate beginSendTime;
  36. @JsonFormat(pattern = "yyyy-MM-dd")
  37. @ApiModelProperty(value = "发送时间-始")
  38. private LocalDate endSendTime;
  39. @JsonFormat(pattern = "yyyy-MM-dd")
  40. @ApiModelProperty(value = "过期时间-起")
  41. private LocalDate beginTimeout;
  42. @JsonFormat(pattern = "yyyy-MM-dd")
  43. @ApiModelProperty(value = "过期时间-始")
  44. private LocalDate endTimeout;
  45. @JsonFormat(pattern = "yyyy-MM-dd")
  46. @ApiModelProperty(value = "延迟消费时间-起")
  47. private LocalDate beginDelayTime;
  48. @JsonFormat(pattern = "yyyy-MM-dd")
  49. @ApiModelProperty(value = "延迟消费时间-始")
  50. private LocalDate endDelayTime;
  51. public LocalDateTime getBeginSendTime() {
  52. return beginSendTime == null ? null : beginSendTime.atTime(0, 0, 0);
  53. }
  54. public LocalDateTime getEndSendTime() {
  55. return endSendTime == null ? null : endSendTime.atTime(23, 59, 59);
  56. }
  57. public LocalDateTime getBeginTimeout() {
  58. return beginTimeout == null ? null : beginTimeout.atTime(0, 0, 0);
  59. }
  60. public LocalDateTime getEndTimeout() {
  61. return endTimeout == null ? null : endTimeout.atTime(23, 59, 59);
  62. }
  63. public LocalDateTime getBeginDelayTime() {
  64. return beginDelayTime == null ? null : beginDelayTime.atTime(0, 0, 0);
  65. }
  66. public LocalDateTime getEndDelayTime() {
  67. return endDelayTime == null ? null : endDelayTime.atTime(23, 59, 59);
  68. }
  69. }
  70. @Data
  71. @Accessors(chain = true)
  72. public static class Vo2 {
  73. @ApiModelProperty("id")
  74. private String id;
  75. @ApiModelProperty("是否调试")
  76. private Boolean debug;
  77. @ApiModelProperty("指令大类")
  78. private String type1;
  79. @ApiModelProperty("指令小类")
  80. private String type2;
  81. @ApiModelProperty("指令状态 1=已发送 2=发送失败 3=已执行 4=执行失败,5=执行超时 6=已完成")
  82. private Integer status;
  83. @ApiModelProperty("指令完整值")
  84. private String value;
  85. @ApiModelProperty("指令发送时间")
  86. private String sendTime;
  87. @ApiModelProperty("指令执行时间")
  88. private String execTime;
  89. @ApiModelProperty("指令过期时间")
  90. private String timeout;
  91. @ApiModelProperty("接收指令的topic")
  92. private String topic;
  93. @ApiModelProperty("是否应答")
  94. private Boolean ack;
  95. @ApiModelProperty("消息级别")
  96. private Integer level;
  97. @ApiModelProperty("已发送次数")
  98. private Integer num;
  99. @ApiModelProperty("消息消费时间(延迟消费)")
  100. private String delayTime;
  101. @ApiModelProperty("错误日志")
  102. private String error;
  103. }
  104. }