1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package com.dy.common.mw.protocol4Mqtt.pSdV1.upVos;
 
import com.alibaba.fastjson2.annotation.JSONField;
import com.dy.common.mw.protocol4Mqtt.Vo4Up;
import com.dy.common.util.DateTime;
import lombok.Data;
 
/**
 * @Author: liurunyu
 * @Date: 2025/6/10 10:04
 * @Description
 */
@Data
public class WeatherVo implements Vo4Up {
    //{"PM10":10,"PM2.5":0,"flexem_message_id":1311,"flexem_timestamp":1749522958,"二氧化碳":10,"光照强度":0,"大气压力":20,"空气温度":0,"空气湿度":65}
    @JSONField(name = "flexem_message_id")
    public Integer messageId ;//消息ID
 
    @JSONField(name = "二氧化碳")
    public Integer carbonDioxide ;//二氧化碳
 
    @JSONField(name = "光照强度")
    public Integer lightIntensity ;//光照强度
 
    @JSONField(name = "大气压力")
    public Integer atmosphericPressure ;//大气压力
 
    @JSONField(name = "空气温度")
    public Integer airTemperature ;//空气温度
 
    @JSONField(name = "空气湿度")
    public Integer airHumidity ;//空气湿度
 
    @JSONField(name = "PM2.5")
    public Integer pm25 ;//PM2.5
 
    @JSONField(name = "PM10")
    public Integer pm10 ;//PM10
 
 
    @JSONField(name = "flexem_timestamp")
    public Long devDt ;//设备时间
 
    public String devDtStr ;//设备时间
    public String getDevDtStr() {
        if(devDt != null){
            return DateTime.yyyy_MM_dd_HH_mm_ss(DateTime.getDate(devDt)) ;
        }else{
            return "" ;
        }
    }
 
    @Override
    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append("气象数据=>") ;
        sb.append(" 消息ID:" + messageId + ", ") ;
        sb.append(" 二氧化碳:" + carbonDioxide + ", ") ;
        sb.append(" 光照强度:" + lightIntensity + ", ") ;
        sb.append(" 大气压力:" + atmosphericPressure + ", ") ;
        sb.append(" 空气温度:" + airTemperature + ", ") ;
        sb.append(" 空气湿度:" + airHumidity + ", ") ;
        sb.append(" PM2.5:" + pm25 + ", ") ;
        sb.append(" PM10:" + pm10 + ", ") ;
        sb.append(" 设备时间:" + devDt + ", ") ;
        sb.append(" 设备时间:" +  this.getDevDtStr() + ", ") ;
        sb.append("\n") ;
        return sb.toString() ;
    }
}