Commit f184bf0c by 向延琳

电量批量接口

1 parent 421fa7ba
...@@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
/** /**
* @author xiangyanlin * @author xiangyanlin
* @date 2022/4/12 * @date 2022/4/12
...@@ -31,4 +34,13 @@ public interface BatteryClient { ...@@ -31,4 +34,13 @@ public interface BatteryClient {
*/ */
@GetMapping("/queryOneBySn") @GetMapping("/queryOneBySn")
R<DevicePowerDTO> getDevicePowerBySn(@RequestParam("sn") String sn); R<DevicePowerDTO> getDevicePowerBySn(@RequestParam("sn") String sn);
/**
* 根据设备sn获取设备电量
* @param sn 设备号
* @return 设备电量
*/
@GetMapping("/queryListBySn")
R<List<DevicePowerDTO>> getDevicePowerListBySn(@RequestParam("sn") Collection<String> sn);
} }
...@@ -7,6 +7,9 @@ import lombok.Setter; ...@@ -7,6 +7,9 @@ import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Collection;
import java.util.List;
/** /**
* @author xiangyanlin * @author xiangyanlin
* @date 2022/4/12 * @date 2022/4/12
...@@ -29,4 +32,10 @@ public class BatteryFallbackImpl implements BatteryClient { ...@@ -29,4 +32,10 @@ public class BatteryFallbackImpl implements BatteryClient {
log.warn("getDevicePowerBySn 熔断啦 {}", cause.getMessage()); log.warn("getDevicePowerBySn 熔断啦 {}", cause.getMessage());
return R.ok("服务异常"); return R.ok("服务异常");
} }
@Override
public R<List<DevicePowerDTO>> getDevicePowerListBySn(Collection<String> sn) {
log.warn("getDevicePowerListBySn 熔断啦 {}", 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!