Commit 5f19867a by 杨林龙

开发获取设备上点总个数feign接口

1 parent 0562df1b
...@@ -38,4 +38,13 @@ public interface DeviceFeignService { ...@@ -38,4 +38,13 @@ public interface DeviceFeignService {
*/ */
@GetMapping(value = "/getDeviceStatusBySn") @GetMapping(value = "/getDeviceStatusBySn")
R<DeviceStatusModel> getDeviceStatusBySn(@NotBlank(message = "设备号不能为空") @RequestParam(value = "sn") String sn, Long offlineTime); R<DeviceStatusModel> getDeviceStatusBySn(@NotBlank(message = "设备号不能为空") @RequestParam(value = "sn") String sn, Long offlineTime);
/**
* 获取设备上点总个数
*
* @param sn 设备号
* @return
*/
@GetMapping(value = "/getDevicesTotalCount")
R getDevicesTotalCount(@RequestParam(value = "sn") String sn);
} }
...@@ -35,8 +35,8 @@ public interface GpsBsService { ...@@ -35,8 +35,8 @@ public interface GpsBsService {
@GetMapping(value = "/devicemonitorinfo") @GetMapping(value = "/devicemonitorinfo")
public R<List<DeviceLocationBo>> listDeviceMonitorInfo(@NotBlank(message = "设备号不能为空") @RequestParam(value = "sns") String sns, R<List<DeviceLocationBo>> listDeviceMonitorInfo(@NotBlank(message = "设备号不能为空") @RequestParam(value = "sns") String sns,
@NotBlank(message = "设备编码不能为空") @RequestParam(value = "deviceCode") String deviceCode); @NotBlank(message = "设备编码不能为空") @RequestParam(value = "deviceCode") String deviceCode);
/** /**
* 通过设备号批量查询 设备位置信息 * 通过设备号批量查询 设备位置信息
...@@ -45,7 +45,7 @@ public interface GpsBsService { ...@@ -45,7 +45,7 @@ public interface GpsBsService {
* @return * @return
*/ */
@PostMapping(value = "/lastgpsbs/batch") @PostMapping(value = "/lastgpsbs/batch")
public R<List<GpsBsData>> getLastGpsBsBatch(@RequestBody GpsBsLastBatchRequest gpsBsLastBatchRequest); R<List<GpsBsData>> getLastGpsBsBatch(@RequestBody GpsBsLastBatchRequest gpsBsLastBatchRequest);
/** /**
* 获取单个设备的最新位置和基站数据 * 获取单个设备的最新位置和基站数据
...@@ -55,7 +55,7 @@ public interface GpsBsService { ...@@ -55,7 +55,7 @@ public interface GpsBsService {
* @return * @return
*/ */
@GetMapping(value = "/single") @GetMapping(value = "/single")
public R<GpsBsData> getLastGpsBsBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "deviceCode") String deviceCode); R<GpsBsData> getLastGpsBsBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "deviceCode") String deviceCode);
/** /**
* 获取设备的历史轨迹 * 获取设备的历史轨迹
...@@ -65,6 +65,6 @@ public interface GpsBsService { ...@@ -65,6 +65,6 @@ public interface GpsBsService {
* @return * @return
*/ */
@GetMapping(value = "/single/history") @GetMapping(value = "/single/history")
public R<List<GpsLocation>> getLastGpsBsHistoryBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "deviceCode") String deviceCode, R<List<GpsLocation>> getLastGpsBsHistoryBySn(@RequestParam(value = "sn") String sn, @RequestParam(value = "deviceCode") String deviceCode,
@RequestParam(value = "startTime") String startTime, @RequestParam(value = "endTime") String endTime); @RequestParam(value = "startTime") String startTime, @RequestParam(value = "endTime") String endTime);
} }
...@@ -17,11 +17,19 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService { ...@@ -17,11 +17,19 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService {
@Override @Override
public R<DeviceDTO> getDeviceBySn(String sn) { public R<DeviceDTO> getDeviceBySn(String sn) {
log.info("getDeviceBySn 熔断啦===", cause.getMessage());
return R.ok("无数据"); return R.ok("无数据");
} }
@Override @Override
public R<DeviceStatusModel> getDeviceStatusBySn(String sn, Long offlineTime) { public R<DeviceStatusModel> getDeviceStatusBySn(String sn, Long offlineTime) {
log.info("getDeviceStatusBySn 熔断啦===", cause.getMessage());
return R.ok("无数据");
}
@Override
public R getDevicesTotalCount(String sn) {
log.info("getDevicesTotalCount 熔断啦===", cause.getMessage());
return R.ok("无数据"); return R.ok("无数据");
} }
} }
...@@ -33,33 +33,36 @@ import java.util.List; ...@@ -33,33 +33,36 @@ import java.util.List;
* @version 1.0.0 * @version 1.0.0
* @ClassName GpsBsService.java * @ClassName GpsBsService.java
* @description: GpsBsService fallback impl * @description: GpsBsService fallback impl
*
* @createTime 2021年05月21日 15:19:00 * @createTime 2021年05月21日 15:19:00
*/ */
@Slf4j @Slf4j
@Component @Component
public class GpsBsServiceFallbackImpl implements GpsBsService { public class GpsBsServiceFallbackImpl implements GpsBsService {
@Setter @Setter
private Throwable cause; private Throwable cause;
@Override @Override
public R<List<DeviceLocationBo>> listDeviceMonitorInfo(String sns, String deviceCode) { public R<List<DeviceLocationBo>> listDeviceMonitorInfo(String sns, String deviceCode) {
return R.ok("无数据"); log.info("listDeviceMonitorInfo 熔断啦===", cause.getMessage());
} return R.ok("无数据");
}
@Override @Override
public R getLastGpsBsBatch(GpsBsLastBatchRequest gpsBsLastBatchRequest) { public R getLastGpsBsBatch(GpsBsLastBatchRequest gpsBsLastBatchRequest) {
return R.ok("无数据"); log.info("getLastGpsBsBatch 熔断啦===", cause.getMessage());
} return R.ok("无数据");
}
@Override @Override
public R getLastGpsBsBySn(String sn, String deviceCode) { public R getLastGpsBsBySn(String sn, String deviceCode) {
return R.ok("无数据"); log.info("getLastGpsBsBySn 熔断啦===", cause.getMessage());
} return R.ok("无数据");
}
@Override @Override
public R getLastGpsBsHistoryBySn(String sn, String deviceCode, String startTime, String endTime) { public R getLastGpsBsHistoryBySn(String sn, String deviceCode, String startTime, String endTime) {
return R.ok("无数据"); log.info("getLastGpsBsHistoryBySn 熔断啦===", 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!