123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- package com.xy.dto;
- import com.fasterxml.jackson.annotation.JsonFormat;
- import com.xy.utils.PageBean;
- import io.swagger.annotations.ApiModel;
- import io.swagger.annotations.ApiModelProperty;
- import lombok.Data;
- import lombok.experimental.Accessors;
- import javax.validation.constraints.NotBlank;
- import java.time.LocalDate;
- import java.time.LocalDateTime;
- @Data
- @ApiModel("指令交互类")
- @Accessors(chain = true)
- public class MqttDto {
- @NotBlank(message = "deviceId不能为空")
- @ApiModelProperty(value = "设备id", required = true)
- private Long deviceId;
- @ApiModelProperty("是否调试模式 默认=false")
- private Boolean debug = false;
- @ApiModelProperty("消息级别qs 默认=1")
- private Integer level = 1;
- @ApiModelProperty("消息消费时间(延迟消费) yyyy-MM-dd HH:mm:ss")
- private String delayTime;
- @ApiModelProperty("指令有效期,单位:s 默认=60")
- private Integer timeout = 60;
- @ApiModelProperty(value = "指令对象", required = true)
- private PaterDto pater;
- @Data
- @Accessors(chain = true)
- public static class Page extends Vo2 {
- @ApiModelProperty("分页对象")
- private PageBean page;
- @JsonFormat(pattern = "yyyy-MM-dd")
- @ApiModelProperty(value = "发送时间-起")
- private LocalDate beginSendTime;
- @JsonFormat(pattern = "yyyy-MM-dd")
- @ApiModelProperty(value = "发送时间-始")
- private LocalDate endSendTime;
- @JsonFormat(pattern = "yyyy-MM-dd")
- @ApiModelProperty(value = "过期时间-起")
- private LocalDate beginTimeout;
- @JsonFormat(pattern = "yyyy-MM-dd")
- @ApiModelProperty(value = "过期时间-始")
- private LocalDate endTimeout;
- @JsonFormat(pattern = "yyyy-MM-dd")
- @ApiModelProperty(value = "延迟消费时间-起")
- private LocalDate beginDelayTime;
- @JsonFormat(pattern = "yyyy-MM-dd")
- @ApiModelProperty(value = "延迟消费时间-始")
- private LocalDate endDelayTime;
- public LocalDateTime getBeginSendTime() {
- return beginSendTime == null ? null : beginSendTime.atTime(0, 0, 0);
- }
- public LocalDateTime getEndSendTime() {
- return endSendTime == null ? null : endSendTime.atTime(23, 59, 59);
- }
- public LocalDateTime getBeginTimeout() {
- return beginTimeout == null ? null : beginTimeout.atTime(0, 0, 0);
- }
- public LocalDateTime getEndTimeout() {
- return endTimeout == null ? null : endTimeout.atTime(23, 59, 59);
- }
- public LocalDateTime getBeginDelayTime() {
- return beginDelayTime == null ? null : beginDelayTime.atTime(0, 0, 0);
- }
- public LocalDateTime getEndDelayTime() {
- return endDelayTime == null ? null : endDelayTime.atTime(23, 59, 59);
- }
- }
- @Data
- @Accessors(chain = true)
- public static class Vo2 {
- @ApiModelProperty("id")
- private String id;
- @ApiModelProperty("是否调试")
- private Boolean debug;
- @ApiModelProperty("指令大类")
- private String type1;
- @ApiModelProperty("指令小类")
- private String type2;
- @ApiModelProperty("指令状态 1=已发送 2=发送失败 3=已执行 4=执行失败,5=执行超时 6=已完成")
- private Integer status;
- @ApiModelProperty("指令完整值")
- private String value;
- @ApiModelProperty("指令发送时间")
- private String sendTime;
- @ApiModelProperty("指令执行时间")
- private String execTime;
- @ApiModelProperty("指令过期时间")
- private String timeout;
- @ApiModelProperty("接收指令的topic")
- private String topic;
- @ApiModelProperty("是否应答")
- private Boolean ack;
- @ApiModelProperty("消息级别")
- private Integer level;
- @ApiModelProperty("已发送次数")
- private Integer num;
- @ApiModelProperty("消息消费时间(延迟消费)")
- private String delayTime;
- @ApiModelProperty("错误日志")
- private String error;
- }
- }
|