Newer
Older
huludao / src / main / java / com / newfiber / api / pc / model / gaofen / SmartWeather.java
package com.newfiber.api.pc.model.gaofen;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 高分天气-智能天气实况(2分钟更新一次的级别)
 * @ClassName SmartWeather
 * @Description TODO
 * @Author 张鸿志
 * @Date 2021年8月18日15:05:09 15:05
 * Version 1.0
 **/
@Data
@ApiModel
public class SmartWeather implements Serializable {

    @ApiModelProperty("天气现象")
    private String text;

    @ApiModelProperty("天气现象编码")
    private String code;

    @ApiModelProperty("气温,单位℃")
    private BigDecimal temp;

    @ApiModelProperty("体感温度,单位℃")
    private Integer feelsLike;

    @ApiModelProperty("相对湿度")
    private Integer rh;

    @ApiModelProperty("蒲福氏风级")
    private String windClass;

    @ApiModelProperty("风速,单位m/s")
    private BigDecimal windSpeed;

    @ApiModelProperty("风向")
    private String windDir;

    @ApiModelProperty("风向角度")
    private Integer windAngle;

    @ApiModelProperty("过去一小时降水量")
    private BigDecimal prec;

    @ApiModelProperty("云量,单位%")
    private Integer clouds;

    @ApiModelProperty("能见度,单位米(m)")
    private Integer vis;

    @ApiModelProperty("气压,单位百帕(hPa)")
    private Integer pressure;

    @ApiModelProperty("露点温度,单位℃")
    private Integer dew;

    @ApiModelProperty("紫外线指数")
    private Integer uv;

    @ApiModelProperty("最低温度")
    private Integer low;

    @ApiModelProperty("最高温度")
    private Integer high;


    public SmartWeather(){

    }

    public SmartWeather(JSONObject jsonObject){
        this.text = jsonObject.get("text").toString();
        this.code = jsonObject.get("code").toString();
        this.temp = (BigDecimal) jsonObject.get("temp");
        this.feelsLike = (Integer) jsonObject.get("feels_like");
        this.rh = (Integer) jsonObject.get("rh");
        this.windClass = jsonObject.get("wind_class").toString();
        this.windSpeed = (BigDecimal) jsonObject.get("wind_speed");
        this.windDir = jsonObject.get("wind_dir").toString();
        this.windAngle = (Integer) jsonObject.get("wind_angle");
        this.prec = (BigDecimal) jsonObject.get("prec");
        this.clouds = (Integer) jsonObject.get("clouds");
        this.vis = (Integer) jsonObject.get("vis");
        this.pressure = (Integer) jsonObject.get("pressure");
        this.dew = (Integer) jsonObject.get("dew");
        this.uv = (Integer) jsonObject.get("uv");
    }
}