add db sync
parent
50dfb7ad27
commit
7a534200a5
@ -0,0 +1,17 @@
|
||||
package com.rehome.disruptor_nmc.datasource;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据源实体类
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class DataSource {
|
||||
String id;
|
||||
String name;
|
||||
String url;
|
||||
String username;
|
||||
String password;
|
||||
String driver;
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.rehome.disruptor_nmc.dto;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class NmcNowWeatherDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String weather;
|
||||
|
||||
@SerializedName("weather_date")
|
||||
private String weatherDate;
|
||||
|
||||
private String code;
|
||||
|
||||
@SerializedName("create_date")
|
||||
private Date createDate;
|
||||
|
||||
@SerializedName("last_update_date")
|
||||
private Date lastUpdateDate;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.rehome.disruptor_nmc.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 返回值包装类
|
||||
*/
|
||||
@Data
|
||||
public class ResponseDto {
|
||||
String msg;
|
||||
Object data;
|
||||
boolean success;
|
||||
public static ResponseDto apiSuccess(Object data) {
|
||||
ResponseDto dto = new ResponseDto();
|
||||
dto.setData(data);
|
||||
dto.setSuccess(true);
|
||||
dto.setMsg("接口访问成功");
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static ResponseDto successWithMsg(String msg) {
|
||||
ResponseDto dto = new ResponseDto();
|
||||
dto.setData(null);
|
||||
dto.setSuccess(true);
|
||||
dto.setMsg(msg);
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static ResponseDto successWithData(Object data) {
|
||||
ResponseDto dto = new ResponseDto();
|
||||
dto.setData(data);
|
||||
dto.setSuccess(true);
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static ResponseDto fail(String msg) {
|
||||
ResponseDto dto = new ResponseDto();
|
||||
dto.setSuccess(false);
|
||||
dto.setMsg(msg);
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package com.rehome.disruptor_nmc.dto;
|
||||
|
||||
|
||||
import com.rehome.disruptor_nmc.entity.NmcNowWeather;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 返回值包装类
|
||||
*/
|
||||
@Data
|
||||
public class ResponseNmcNowWeatherDto {
|
||||
String msg;
|
||||
List<NmcNowWeatherDto> data;
|
||||
boolean success;
|
||||
}
|
||||
Loading…
Reference in New Issue