@PostMapping(value = "/demo",produces = "application/json")
public String TotalOutputAndBeats(@RequestBody @Valid ParamsDTO paramsDTO) {
JSONObject jsonObject = dataService.TotalOutputAndBeats(paramsDTO);
return JSON.toJSONString( jsonObject );
}
@Data
@Accessors(chain = true)
public class ParamsDTO {
@Valid
@NotNull(message = "设备ID不能为空")
@NotEmpty(message = "设备ID必填")
private String device_id;
@Valid
@NotNull(message = "传感器ID不能为空")
@NotEmpty(message = "传感器ID必填")
private String sensor_id;
@NotNull(message = "开始时间不能为空")
private String startTime;
@NotNull(message = "结束时间不能为空")
private String endTime;
}