Pu Zhibing
2025-01-24 a155690a38eb156a4dbef88452b3d5decc833e77
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
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;
 
/**
 * @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());
            }
        };
    }
}