DeviceLocationFallbackImpl.java
1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package cn.com.glsx.stdinterface.fallback;
import cn.com.glsx.stdinterface.api.DeviceLocationClient;
import cn.com.glsx.stdinterface.dto.DeviceLocationDto;
import com.glsx.plat.core.web.R;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.Collection;
import java.util.List;
/**
* 设备上点服务异常处理实现类
*
* @author yll
*/
@Slf4j
@Component
public class DeviceLocationFallbackImpl implements DeviceLocationClient {
@Setter
private Throwable cause;
@Override
public R<Integer> dropLibrary(Collection<DeviceLocationDto> deviceLocationDtos) {
log.warn("dropLibrary===设备位置数据落库熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
@Override
public R<List<String>> getAllSn() {
log.warn("getAllSn===熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
@Override
public R<List<DeviceLocationDto>> getAllDeviceLocationData() {
log.warn("getAllDeviceLocationData===熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
}