无关风月
2025-02-13 8236caa8042288fcb9b584c21d6157f713183626
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
43
44
45
46
47
48
49
50
51
52
package com.ruoyi.integration.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.integration.api.feignClient.TCECClient;
import com.ruoyi.integration.api.vo.StartChargeResult;
import org.springframework.cloud.openfeign.FallbackFactory;
 
import java.util.List;
 
/**
 * @author zhibing.pu
 * @Date 2025/1/24 10:33
 */
public class TCECClientFallbackFactory implements FallbackFactory<TCECClient> {
    @Override
    public TCECClient create(Throwable cause) {
        
        
        return new TCECClient() {
            @Override
            public R pushChargingGunStatus(Integer id, Integer status) {
                return R.fail("接口状态变化后推送给第三方失败:" + cause.getMessage());
            }
            
            @Override
            public R notificationStartChargeResult(StartChargeResult result) {
                return R.fail("启动充电结果推送失败:" + cause.getMessage());
            }
            
            @Override
            public R notificationEquipChargeStatus(String startChargeSeq, Integer operatorId) {
                return R.fail("推送充电状态失败:" + cause.getMessage());
            }
            
            @Override
            public R notificationStopChargeResult(String startChargeSeq, String connectorID, Integer operatorId) {
                return R.fail("推送停止充电结果失败:" + cause.getMessage());
            }
            
            
            @Override
            public R notificationChargeOrderInfo(String startChargeSeq, Integer operatorId) {
                return R.fail("推送订单信息失败:" + cause.getMessage());
            }
            
            @Override
            public R notificationStationChange(List<Integer> siteIds) {
                return R.fail("站点变更推送通知失败:" + cause.getMessage());
            }
        };
    }
}