DeviceInfoModel.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. package com.github.microservice.busInfoModel.device;
  2. import cn.hutool.json.JSONObject;
  3. import com.github.microservice.models.baseParam.SuperModel;
  4. import com.github.microservice.types.common.DataState;
  5. import com.github.microservice.types.deviceUse.DeviceSpecType;
  6. import com.github.microservice.types.deviceUse.DeviceType;
  7. import com.github.microservice.types.deviceUse.OnLineState;
  8. import io.swagger.v3.oas.annotations.media.Schema;
  9. import lombok.Data;
  10. import lombok.extern.slf4j.Slf4j;
  11. import org.apache.commons.lang3.ObjectUtils;
  12. import org.apache.commons.lang3.StringUtils;
  13. /**
  14. * @author TRX
  15. * @date 2024/5/16
  16. */
  17. @Data
  18. @Slf4j
  19. public class DeviceInfoModel extends SuperModel {
  20. @Schema(description = "设备ID")
  21. private String deviceId;
  22. @Schema(description = "设备名称")
  23. private String deviceName;
  24. @Schema(description = "产品code")
  25. private String productCode;
  26. @Schema(description = "产品名称")
  27. private String productName;
  28. @Schema(description = "产品信息")
  29. private IotTemplateSimpleModel iotTemplate;
  30. @Schema(description = "在线状态")
  31. private OnLineState onLineState;
  32. private String onLineStateStr;
  33. public String getOnLineStateStr() {
  34. if (onLineState != null) {
  35. return onLineState.getRemark();
  36. }
  37. return "";
  38. }
  39. @Schema(description = "设备型号")
  40. private DeviceSpecType specType;
  41. private String deviceModelStr;
  42. public String getDeviceModelStr() {
  43. if (specType != null) {
  44. return specType.getRemark();
  45. }
  46. return "";
  47. }
  48. @Schema(description = "设备类型:消费机 闸机")
  49. private DeviceType deviceType;
  50. private String deviceTypeStr;
  51. public String getDeviceTypeStr() {
  52. if (deviceType != null) {
  53. return deviceType.getRemark();
  54. }
  55. return "";
  56. }
  57. @Schema(description = "数据状态")
  58. private DataState state;
  59. private String stateStr;
  60. public String getStateStr() {
  61. if (state != null) {
  62. return state.getRemark();
  63. }
  64. return "";
  65. }
  66. @Schema(description = "mqtt账号名称")
  67. private String mqttUserName;
  68. @Schema(description = "账号密码")
  69. private String mqttPassword;
  70. @Schema(description = "ip地址")
  71. private String ip;
  72. @Schema(description = "激活时间")
  73. private Long activityTime;
  74. @Schema(description = "最后上线时间")
  75. private Long lastOnlineTime;
  76. @Schema(description = "所属分组")
  77. private ProjectInfoSimpleModel projectInfo;
  78. @Schema(description = "分组code")
  79. private String projectInfoCode;
  80. @Schema(description = "分组名称")
  81. private String projectInfoName;
  82. public String getProjectInfoName() {
  83. if (ObjectUtils.isNotEmpty(projectInfo)) {
  84. return projectInfo.getName();
  85. }
  86. return "";
  87. }
  88. @Schema(description = "固件版本")
  89. private String firmwareVersion;
  90. @Schema(description = "连接参数")
  91. private JSONObject connectParam;
  92. @Schema(description = "最后离线时间")
  93. private Long lastOffLineTime;
  94. @Schema(description = "设备本地日志上报")
  95. private Boolean isReportLogs = Boolean.TRUE;
  96. }