Commit cf921cf7 by HlQ

格式化代码

1 parent 1ba251dd
package com.viontech.controller; package com.viontech.controller;
import com.viontech.service.impl.WeatherService; import com.viontech.service.impl.WeatherService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author HlQ * @author HlQ
......
...@@ -22,8 +22,8 @@ public class Aqi { ...@@ -22,8 +22,8 @@ public class Aqi {
} }
public String getValue() { public String getValue() {
if(value==null){ if (value == null) {
value="0"; value = "0";
} }
return value; return value;
} }
...@@ -97,7 +97,6 @@ public class Aqi { ...@@ -97,7 +97,6 @@ public class Aqi {
} }
// private String cityName; // private String cityName;
// private String pubtime; // private String pubtime;
// private String value; // private String value;
...@@ -121,5 +120,5 @@ public class Aqi { ...@@ -121,5 +120,5 @@ public class Aqi {
// public String getValue() { // public String getValue() {
// return value; // return value;
// } // }
} }
...@@ -2,70 +2,79 @@ package com.viontech.model; ...@@ -2,70 +2,79 @@ package com.viontech.model;
public class City { public class City {
private Integer cityId; private Integer cityId;
private String counname; private String counname;
private String name; private String name;
private String pname; private String pname;
private String timezone; private String timezone;
private Integer provinceId; private Integer provinceId;
private String weatherCode; private String weatherCode;
private String cityName; private String cityName;
private String provinceName; private String provinceName;
public Integer getProvinceId() { public Integer getProvinceId() {
return provinceId; return provinceId;
} }
public void setProvinceId(Integer provinceId) {
this.provinceId = provinceId; public void setProvinceId(Integer provinceId) {
} this.provinceId = provinceId;
}
public String getCityName() {
return cityName; public String getCityName() {
} return cityName;
public void setCityName(String cityName) { }
this.cityName = cityName;
} public void setCityName(String cityName) {
this.cityName = cityName;
}
public void setCityId(Integer cityId) { public void setCityId(Integer cityId) {
this.cityId = cityId; this.cityId = cityId;
} }
public Integer getCityId() {
return cityId; public Integer getCityId() {
} return cityId;
}
public void setCounname(String counname) { public void setCounname(String counname) {
this.counname = counname; this.counname = counname;
} }
public String getCounname() {
return counname; public String getCounname() {
} return counname;
}
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getName() {
return name; public String getName() {
} return name;
}
public void setPname(String pname) { public void setPname(String pname) {
this.pname = pname; this.pname = pname;
} }
public String getPname() {
return pname; public String getPname() {
} return pname;
}
public void setTimezone(String timezone) { public void setTimezone(String timezone) {
this.timezone = timezone; this.timezone = timezone;
} }
public String getTimezone() {
return timezone; public String getTimezone() {
} return timezone;
public String getProvinceName() { }
return provinceName;
} public String getProvinceName() {
public void setProvinceName(String provinceName) { return provinceName;
this.provinceName = provinceName; }
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getWeatherCode() { public String getWeatherCode() {
return weatherCode; return weatherCode;
......
...@@ -4,27 +4,32 @@ import java.util.List; ...@@ -4,27 +4,32 @@ import java.util.List;
public class Data { public class Data {
private Aqi aqi; private Aqi aqi;
private City city; private City city;
private List<Forecast> forecast; private List<Forecast> forecast;
public void setCity(City city) { public void setCity(City city) {
this.city = city; this.city = city;
} }
public City getCity() {
return city; public City getCity() {
} return city;
}
public void setForecast(List<Forecast> forecast) { public void setForecast(List<Forecast> forecast) {
this.forecast = forecast; this.forecast = forecast;
} }
public List<Forecast> getForecast() {
return forecast; public List<Forecast> getForecast() {
} return forecast;
public Aqi getAqi() { }
return aqi;
} public Aqi getAqi() {
public void setAqi(Aqi aqi) { return aqi;
this.aqi = aqi; }
}
public void setAqi(Aqi aqi) {
this.aqi = aqi;
}
} }
...@@ -4,7 +4,7 @@ import java.util.Date; ...@@ -4,7 +4,7 @@ import java.util.Date;
public class Forecast { public class Forecast {
private String conditionDay; private String conditionDay;
private String conditionIdDay; private String conditionIdDay;
private String conditionIdNight; private String conditionIdNight;
private String conditionNight; private String conditionNight;
...@@ -16,89 +16,102 @@ public class Forecast { ...@@ -16,89 +16,102 @@ public class Forecast {
private String windDirNight; private String windDirNight;
private String windLevelDay; private String windLevelDay;
private String windLevelNight; private String windLevelNight;
public void setConditionDay(String conditionDay) { public void setConditionDay(String conditionDay) {
this.conditionDay = conditionDay; this.conditionDay = conditionDay;
} }
public String getConditionDay() {
return conditionDay; public String getConditionDay() {
} return conditionDay;
}
public void setConditionIdDay(String conditionIdDay) { public void setConditionIdDay(String conditionIdDay) {
this.conditionIdDay = conditionIdDay; this.conditionIdDay = conditionIdDay;
} }
public String getConditionIdDay() {
return conditionIdDay; public String getConditionIdDay() {
} return conditionIdDay;
}
public void setConditionIdNight(String conditionIdNight) { public void setConditionIdNight(String conditionIdNight) {
this.conditionIdNight = conditionIdNight; this.conditionIdNight = conditionIdNight;
} }
public String getConditionIdNight() {
return conditionIdNight; public String getConditionIdNight() {
} return conditionIdNight;
}
public void setConditionNight(String conditionNight) { public void setConditionNight(String conditionNight) {
this.conditionNight = conditionNight; this.conditionNight = conditionNight;
} }
public String getConditionNight() {
return conditionNight; public String getConditionNight() {
} return conditionNight;
}
public void setPredictDate(Date predictDate) { public void setPredictDate(Date predictDate) {
this.predictDate = predictDate; this.predictDate = predictDate;
} }
public Date getPredictDate() {
return predictDate; public Date getPredictDate() {
} return predictDate;
}
public void setTempDay(String tempDay) { public void setTempDay(String tempDay) {
this.tempDay = tempDay; this.tempDay = tempDay;
} }
public String getTempDay() {
return tempDay; public String getTempDay() {
} return tempDay;
}
public void setTempNight(String tempNight) { public void setTempNight(String tempNight) {
this.tempNight = tempNight; this.tempNight = tempNight;
} }
public String getTempNight() {
return tempNight; public String getTempNight() {
} return tempNight;
}
public void setUpdatetime(Date updatetime) { public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime; this.updatetime = updatetime;
} }
public Date getUpdatetime() {
return updatetime; public Date getUpdatetime() {
} return updatetime;
}
public void setWindDirDay(String windDirDay) { public void setWindDirDay(String windDirDay) {
this.windDirDay = windDirDay; this.windDirDay = windDirDay;
} }
public String getWindDirDay() {
return windDirDay; public String getWindDirDay() {
} return windDirDay;
}
public void setWindDirNight(String windDirNight) { public void setWindDirNight(String windDirNight) {
this.windDirNight = windDirNight; this.windDirNight = windDirNight;
} }
public String getWindDirNight() {
return windDirNight; public String getWindDirNight() {
} return windDirNight;
}
public void setWindLevelDay(String windLevelDay) { public void setWindLevelDay(String windLevelDay) {
this.windLevelDay = windLevelDay; this.windLevelDay = windLevelDay;
} }
public String getWindLevelDay() {
return windLevelDay; public String getWindLevelDay() {
} return windLevelDay;
}
public void setWindLevelNight(String windLevelNight) { public void setWindLevelNight(String windLevelNight) {
this.windLevelNight = windLevelNight; this.windLevelNight = windLevelNight;
} }
public String getWindLevelNight() {
return windLevelNight; public String getWindLevelNight() {
} return windLevelNight;
}
} }
...@@ -2,19 +2,22 @@ package com.viontech.model; ...@@ -2,19 +2,22 @@ package com.viontech.model;
public class Rc { public class Rc {
private int c; private int c;
private String p; private String p;
public void setC(int c) { public void setC(int c) {
this.c = c; this.c = c;
} }
public int getC() {
return c; public int getC() {
} return c;
}
public void setP(String p) { public void setP(String p) {
this.p = p; this.p = p;
} }
public String getP() {
return p; public String getP() {
} return p;
}
} }
...@@ -2,86 +2,95 @@ package com.viontech.model; ...@@ -2,86 +2,95 @@ package com.viontech.model;
import java.util.Date; import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
public class SimpleWeather { public class SimpleWeather {
private int province_id; private int province_id;
private int city_id; private int city_id;
private int type; private int type;
private Date data_date; private Date data_date;
private String ltemp; private String ltemp;
private String htemp; private String htemp;
//private int pm25; //private int pm25;
private String aqi; private String aqi;
public String getFengli() { public String getFengli() {
return fengli; return fengli;
} }
public void setFengli(String fengli) { public void setFengli(String fengli) {
this.fengli = fengli; this.fengli = fengli;
} }
private String fengli; private String fengli;
public String getFengxiang() { public String getFengxiang() {
return fengxiang; return fengxiang;
} }
public void setFengxiang(String fengxiang) { public void setFengxiang(String fengxiang) {
this.fengxiang = fengxiang; this.fengxiang = fengxiang;
} }
private String fengxiang; private String fengxiang;
public int getProvince_id() { public int getProvince_id() {
return province_id; return province_id;
} }
public void setProvince_id(int province_id) {
this.province_id = province_id; public void setProvince_id(int province_id) {
} this.province_id = province_id;
public int getCity_id() { }
return city_id;
} public int getCity_id() {
public void setCity_id(int city_id) { return city_id;
this.city_id = city_id; }
}
public int getType() { public void setCity_id(int city_id) {
return type; this.city_id = city_id;
} }
public void setType(int type) {
this.type = type; public int getType() {
} return type;
public Date getData_date() { }
return data_date;
} public void setType(int type) {
public void setData_date(Date data_date) { this.type = type;
this.data_date = data_date; }
}
public String getLtemp() { public Date getData_date() {
return ltemp; return data_date;
} }
public void setLtemp(String ltemp) {
this.ltemp = ltemp; public void setData_date(Date data_date) {
} this.data_date = data_date;
public String getHtemp() { }
return htemp;
} public String getLtemp() {
public void setHtemp(String htemp) { return ltemp;
this.htemp = htemp; }
}
public String getAqi() { public void setLtemp(String ltemp) {
return aqi; this.ltemp = ltemp;
} }
public void setAqi(String aqi) {
this.aqi = aqi; public String getHtemp() {
} return htemp;
}
public void setHtemp(String htemp) {
this.htemp = htemp;
}
public String getAqi() {
return aqi;
}
public void setAqi(String aqi) {
this.aqi = aqi;
}
} }
...@@ -2,35 +2,40 @@ package com.viontech.model; ...@@ -2,35 +2,40 @@ package com.viontech.model;
public class WeatherMessage { public class WeatherMessage {
private int code; private int code;
private Data data; private Data data;
private String msg; private String msg;
private Rc rc; private Rc rc;
public void setCode(int code) { public void setCode(int code) {
this.code = code; this.code = code;
} }
public int getCode() {
return code; public int getCode() {
} return code;
}
public void setData(Data data) { public void setData(Data data) {
this.data = data; this.data = data;
} }
public Data getData() {
return data; public Data getData() {
} return data;
}
public void setMsg(String msg) { public void setMsg(String msg) {
this.msg = msg; this.msg = msg;
} }
public String getMsg() {
return msg; public String getMsg() {
} return msg;
}
public void setRc(Rc rc) { public void setRc(Rc rc) {
this.rc = rc; this.rc = rc;
} }
public Rc getRc() {
return rc; public Rc getRc() {
} return rc;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!