Browse Source

perf 开发公厕用电用水设备对接接口

master
yingsl 3 years ago
parent
commit
207d272149
  1. 5
      src/main/java/com/example/modular/api/controller/DeviceDataPushController.java
  2. 4
      src/main/java/com/example/modular/api/service/DeviceDataPushService.java
  3. 4
      src/main/java/com/example/modular/api/service/impl/DeviceDataPushServiceImpl.java

5
src/main/java/com/example/modular/api/controller/DeviceDataPushController.java

@ -1,7 +1,6 @@
package com.example.modular.api.controller; package com.example.modular.api.controller;
import com.example.modular.api.service.DeviceDataPushService; import com.example.modular.api.service.DeviceDataPushService;
import com.example.util.Result;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -34,7 +33,7 @@ public class DeviceDataPushController {
public String deviceWaterSave (@RequestParam(value = "base64",required = false)String base64, public String deviceWaterSave (@RequestParam(value = "base64",required = false)String base64,
@RequestParam(value = "imgUrl",required = false)String imgUrl, @RequestParam(value = "imgUrl",required = false)String imgUrl,
@RequestParam(value = "devId",required = false)String devId, @RequestParam(value = "devId",required = false)String devId,
@RequestParam(value = "devVol",required = false)Integer devVol,
@RequestParam(value = "devVol",required = false)String devVol,
@RequestParam(value = "isPointerMeter",required = false,defaultValue = "false")boolean isPointerMeter, @RequestParam(value = "isPointerMeter",required = false,defaultValue = "false")boolean isPointerMeter,
@RequestParam(value = "createTime",required = false)String createTime, @RequestParam(value = "createTime",required = false)String createTime,
@RequestParam(value = "result",required = false)String result) { @RequestParam(value = "result",required = false)String result) {
@ -59,7 +58,7 @@ public class DeviceDataPushController {
public String deviceElectricitySave (@RequestParam(value = "base64",required = false)String base64, public String deviceElectricitySave (@RequestParam(value = "base64",required = false)String base64,
@RequestParam(value = "imgUrl",required = false)String imgUrl, @RequestParam(value = "imgUrl",required = false)String imgUrl,
@RequestParam(value = "devId",required = false)String devId, @RequestParam(value = "devId",required = false)String devId,
@RequestParam(value = "devVol",required = false)Integer devVol,
@RequestParam(value = "devVol",required = false)String devVol,
@RequestParam(value = "isPointerMeter",required = false,defaultValue = "false")boolean isPointerMeter, @RequestParam(value = "isPointerMeter",required = false,defaultValue = "false")boolean isPointerMeter,
@RequestParam(value = "createTime",required = false)String createTime, @RequestParam(value = "createTime",required = false)String createTime,
@RequestParam(value = "result",required = false)String result) { @RequestParam(value = "result",required = false)String result) {

4
src/main/java/com/example/modular/api/service/DeviceDataPushService.java

@ -21,7 +21,7 @@ public interface DeviceDataPushService {
* @return * @return
* @author ysl * @author ysl
*/ */
String deviceWaterSave(String base64,String imgUrl,String devId,Integer devVol,boolean isPointerMeter,String createTime,String result);
String deviceWaterSave(String base64,String imgUrl,String devId,String devVol,boolean isPointerMeter,String createTime,String result);
/** /**
@ -36,5 +36,5 @@ public interface DeviceDataPushService {
* @return * @return
* @author ysl * @author ysl
*/ */
String deviceElectricitySave(String base64,String imgUrl,String devId,Integer devVol,boolean isPointerMeter,String createTime,String result);
String deviceElectricitySave(String base64,String imgUrl,String devId,String devVol,boolean isPointerMeter,String createTime,String result);
} }

4
src/main/java/com/example/modular/api/service/impl/DeviceDataPushServiceImpl.java

@ -43,7 +43,7 @@ public class DeviceDataPushServiceImpl implements DeviceDataPushService {
private IToiletElectricityConsumptionService toiletElectricityConsumptionService; private IToiletElectricityConsumptionService toiletElectricityConsumptionService;
@Override @Override
public String deviceWaterSave(String base64, String imgUrl, String devId, Integer devVol, boolean isPointerMeter, String createTime, String result) {
public String deviceWaterSave(String base64, String imgUrl, String devId, String devVol, boolean isPointerMeter, String createTime, String result) {
//校验参数是否正确 //校验参数是否正确
if (StringUtils.isBlank(devId) || StringUtils.isBlank(createTime) || StringUtils.isBlank(result)) { if (StringUtils.isBlank(devId) || StringUtils.isBlank(createTime) || StringUtils.isBlank(result)) {
return "PARAMS ERROR"; return "PARAMS ERROR";
@ -118,7 +118,7 @@ public class DeviceDataPushServiceImpl implements DeviceDataPushService {
} }
@Override @Override
public String deviceElectricitySave(String base64, String imgUrl, String devId, Integer devVol, boolean isPointerMeter, String createTime, String result) {
public String deviceElectricitySave(String base64, String imgUrl, String devId, String devVol, boolean isPointerMeter, String createTime, String result) {
//校验参数是否正确 //校验参数是否正确
if (StringUtils.isBlank(devId) || StringUtils.isBlank(createTime) || StringUtils.isBlank(result)) { if (StringUtils.isBlank(devId) || StringUtils.isBlank(createTime) || StringUtils.isBlank(result)) {
return "PARAMS ERROR"; return "PARAMS ERROR";

Loading…
Cancel
Save