BatteryFallbackImpl.java
1.08 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
package cn.com.glsx.stdinterface.fallback;
import cn.com.glsx.stdinterface.api.BatteryClient;
import cn.com.glsx.stdinterface.dto.DevicePowerDTO;
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 xiangyanlin
* @date 2022/4/12
*/
@Slf4j
@Component
public class BatteryFallbackImpl implements BatteryClient {
@Setter
private Throwable cause;
@Override
public R saveBatteryInfo(DevicePowerDTO devicePowerDTO) {
log.warn("saveBatteryInfo 熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
@Override
public R<DevicePowerDTO> getDevicePowerBySn(String sn) {
log.warn("getDevicePowerBySn 熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
@Override
public R<List<DevicePowerDTO>> getDevicePowerListBySn(Collection<String> sn) {
log.warn("getDevicePowerListBySn 熔断啦 {}", cause.getMessage());
return R.ok("服务异常");
}
}