Commit 4a3f1e71 by 黄小葱

新增批量查询设备状态接口

1 parent 775697b4
...@@ -6,8 +6,12 @@ import cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory; ...@@ -6,8 +6,12 @@ import cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
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;
/** /**
* 设备查询相关服务 * 设备查询相关服务
...@@ -39,6 +43,14 @@ public interface DeviceFeignService { ...@@ -39,6 +43,14 @@ public interface DeviceFeignService {
R<DeviceStatusModel> getDeviceStatusBySn(@RequestParam(value = "sn") String sn, Long offlineTime); R<DeviceStatusModel> getDeviceStatusBySn(@RequestParam(value = "sn") String sn, Long offlineTime);
/** /**
* 批量获取设备状态
* @param sns
* @param offlineTime
* @return
*/
@PostMapping(value = "listDeviceStatusBySns")
R<List<DeviceStatusModel>> listDeviceStatusBySns(@RequestParam(value = "sns") Collection<String> sns, Long offlineTime);
/**
* 获取设备上点总个数 * 获取设备上点总个数
* *
* @param sn 设备号 * @param sn 设备号
......
...@@ -8,6 +8,9 @@ import lombok.Setter; ...@@ -8,6 +8,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;
@Slf4j @Slf4j
@Component @Component
public class DeviceServiceFallbackImpl implements DeviceFeignService { public class DeviceServiceFallbackImpl implements DeviceFeignService {
...@@ -28,6 +31,12 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService { ...@@ -28,6 +31,12 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService {
} }
@Override @Override
public R<List<DeviceStatusModel>> listDeviceStatusBySns(Collection<String> sns, Long offlineTime) {
log.info("listDeviceStatusBySns 熔断啦==={}", cause.getMessage());
return R.ok("无数据");
}
@Override
public R getDevicesTotalCount(String sn) { public R getDevicesTotalCount(String sn) {
log.info("getDevicesTotalCount 熔断啦==={}", cause.getMessage()); log.info("getDevicesTotalCount 熔断啦==={}", cause.getMessage());
return R.ok("无数据"); return R.ok("无数据");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!