添加信息

This commit is contained in:
孙小云 2026-01-20 10:53:38 +08:00
parent 406a1e9e5f
commit 4a2a6c3c0a
2 changed files with 223 additions and 0 deletions

View File

@ -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<BatteryInfo> 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<BatteryInfo> getBatteries() {
return batteries;
}
public void setBatteries(List<BatteryInfo> 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 +
'}';
}
}

View File

@ -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 +
'}';
}
}