DeviceInfoModel.java 3.4 KB

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