puzhibing
2026-04-18 2cb2c48e87f754236cc906c4db97e9d84be19d46
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
package com.xiaopeng.api.factory.operation;
 
import com.xiaopeng.api.feignClient.operation.XpSystemSettingClient;
import com.xiaopeng.api.model.operation.XpFeedbackType;
import com.xiaopeng.api.model.operation.XpSystemSetting;
import com.xiaopeng.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
@Slf4j
@Component
public class XpSystemSettingClientFallbackFactory implements FallbackFactory<XpSystemSettingClient> {
    @Override
    public XpSystemSettingClient create(Throwable cause) {
        return new XpSystemSettingClient(){
            @Override
            public R getOrderDistance() {
                log.error("获取下单距离失败:{}", cause.getMessage());
                return R.fail("获取下单距离失败");
            }
 
            @Override
            public R<Integer> getMinOrderDistance() {
                log.error("获取最小下单距离失败:{}", cause.getMessage());
                return R.fail("获取最小下单距离失败");
            }
 
            @Override
            public R<Integer> getOrderFinishTime() {
                log.error("获取自动结束行程时间失败:{}", cause.getMessage());
                return R.fail("获取自动结束行程时间失败,"+cause.getMessage());
            }
 
            @Override
            public R<XpFeedbackType> getFeedbackTypeById(Long id) {
                log.error("获取反馈类型名称失败:{}", cause.getMessage());
                return R.fail(null);
            }
 
            @Override
            public R<XpSystemSetting> getSystemSettingOne() {
                return R.fail("获取系统配置失败");
            }
        };
    }
}