diff --git a/src/main/java/com/ruoyi/device/domain/model/thingsboard/attributes/battery/BatteryData.java b/src/main/java/com/ruoyi/device/domain/model/thingsboard/attributes/battery/BatteryData.java new file mode 100644 index 0000000..19d371b --- /dev/null +++ b/src/main/java/com/ruoyi/device/domain/model/thingsboard/attributes/battery/BatteryData.java @@ -0,0 +1,83 @@ +package com.ruoyi.device.domain.model.thingsboard.attributes.battery; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * 电池数据 + * 包含电池列表和相关状态信息 + */ +public class BatteryData { + + @JsonProperty("batteries") + private List batteries; + + @JsonProperty("capacity_percent") + private Integer capacityPercent; + + @JsonProperty("landing_power") + private Integer landingPower; + + @JsonProperty("remain_flight_time") + private Integer remainFlightTime; + + @JsonProperty("return_home_power") + private Integer returnHomePower; + + // 构造方法 + public BatteryData() { + } + + // Getter和Setter方法 + public List getBatteries() { + return batteries; + } + + public void setBatteries(List batteries) { + this.batteries = batteries; + } + + public Integer getCapacityPercent() { + return capacityPercent; + } + + public void setCapacityPercent(Integer capacityPercent) { + this.capacityPercent = capacityPercent; + } + + public Integer getLandingPower() { + return landingPower; + } + + public void setLandingPower(Integer landingPower) { + this.landingPower = landingPower; + } + + public Integer getRemainFlightTime() { + return remainFlightTime; + } + + public void setRemainFlightTime(Integer remainFlightTime) { + this.remainFlightTime = remainFlightTime; + } + + public Integer getReturnHomePower() { + return returnHomePower; + } + + public void setReturnHomePower(Integer returnHomePower) { + this.returnHomePower = returnHomePower; + } + + @Override + public String toString() { + return "BatteryData{" + + "batteries=" + batteries + + ", capacityPercent=" + capacityPercent + + ", landingPower=" + landingPower + + ", remainFlightTime=" + remainFlightTime + + ", returnHomePower=" + returnHomePower + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/domain/model/thingsboard/attributes/battery/BatteryInfo.java b/src/main/java/com/ruoyi/device/domain/model/thingsboard/attributes/battery/BatteryInfo.java new file mode 100644 index 0000000..aa7396d --- /dev/null +++ b/src/main/java/com/ruoyi/device/domain/model/thingsboard/attributes/battery/BatteryInfo.java @@ -0,0 +1,140 @@ +package com.ruoyi.device.domain.model.thingsboard.attributes.battery; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 单个电池信息 + */ +public class BatteryInfo { + + @JsonProperty("capacity_percent") + private Integer capacityPercent; + + @JsonProperty("firmware_version") + private String firmwareVersion; + + @JsonProperty("high_voltage_storage_days") + private Integer highVoltageStorageDays; + + @JsonProperty("index") + private Integer index; + + @JsonProperty("loop_times") + private Integer loopTimes; + + @JsonProperty("sn") + private String sn; + + @JsonProperty("sub_type") + private Integer subType; + + @JsonProperty("temperature") + private Double temperature; + + @JsonProperty("type") + private Integer type; + + @JsonProperty("voltage") + private Integer voltage; + + // 构造方法 + public BatteryInfo() { + } + + // Getter和Setter方法 + public Integer getCapacityPercent() { + return capacityPercent; + } + + public void setCapacityPercent(Integer capacityPercent) { + this.capacityPercent = capacityPercent; + } + + public String getFirmwareVersion() { + return firmwareVersion; + } + + public void setFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + } + + public Integer getHighVoltageStorageDays() { + return highVoltageStorageDays; + } + + public void setHighVoltageStorageDays(Integer highVoltageStorageDays) { + this.highVoltageStorageDays = highVoltageStorageDays; + } + + public Integer getIndex() { + return index; + } + + public void setIndex(Integer index) { + this.index = index; + } + + public Integer getLoopTimes() { + return loopTimes; + } + + public void setLoopTimes(Integer loopTimes) { + this.loopTimes = loopTimes; + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + public Integer getSubType() { + return subType; + } + + public void setSubType(Integer subType) { + this.subType = subType; + } + + public Double getTemperature() { + return temperature; + } + + public void setTemperature(Double temperature) { + this.temperature = temperature; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getVoltage() { + return voltage; + } + + public void setVoltage(Integer voltage) { + this.voltage = voltage; + } + + @Override + public String toString() { + return "BatteryInfo{" + + "capacityPercent=" + capacityPercent + + ", firmwareVersion='" + firmwareVersion + '\'' + + ", highVoltageStorageDays=" + highVoltageStorageDays + + ", index=" + index + + ", loopTimes=" + loopTimes + + ", sn='" + sn + '\'' + + ", subType=" + subType + + ", temperature=" + temperature + + ", type=" + type + + ", voltage=" + voltage + + '}'; + } +} \ No newline at end of file