Commit 08e75f25 by 向延琳

查询电量

1 parent 01d4569a
......@@ -4,7 +4,9 @@ import cn.com.glsx.stdinterface.dto.DevicePowerDTO;
import cn.com.glsx.stdinterface.factory.FreqRecordFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author xiangyanlin
......@@ -21,4 +23,12 @@ public interface BatteryClient {
*/
@PostMapping(value = "/save")
R saveBatteryInfo(DevicePowerDTO devicePowerDTO);
/**
* 根据设备sn获取设备
* @param sn 设备号
* @return 设备电量
*/
@GetMapping("/queryOneBySn")
R<DevicePowerDTO> getDevicePowerBySn(@RequestParam("sn") String sn);
}
package cn.com.glsx.stdinterface.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
......@@ -44,6 +45,7 @@ public class DevicePowerDTO implements Serializable {
/**
* 创建时间|入库时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdDate;
/**
......@@ -54,6 +56,7 @@ public class DevicePowerDTO implements Serializable {
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
......
......@@ -20,7 +20,13 @@ public class BatteryFallbackImpl implements BatteryClient {
@Override
public R saveBatteryInfo(DevicePowerDTO devicePowerDTO) {
log.warn("DevicePowerDTO 熔断啦 {}", cause.getMessage());
log.warn("saveBatteryInfo 熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
@Override
public R<DevicePowerDTO> getDevicePowerBySn(String sn) {
log.warn("getDevicePowerBySn 熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!