bug
jiangqs
2023-09-11 3adbcc42d5f84c3c83d220543189361add81e04d
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package com.ruoyi.system.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.dto.MgtBaseBathDto;
import com.ruoyi.system.api.domain.dto.MgtClassNumDto;
import com.ruoyi.system.api.domain.dto.MgtUserIdByDept;
import com.ruoyi.system.api.domain.poji.config.*;
import com.ruoyi.system.api.domain.poji.sys.SysStaff;
import com.ruoyi.system.api.domain.vo.AppOtherConfigGetVo;
import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo;
import com.ruoyi.system.api.service.RemoteConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
import java.util.List;
import java.util.Map;
 
/**
 * 系统配置服务
 * 
 * @author jqs
 */
@Component
public class RemoteConfigFallbackFactory implements FallbackFactory<RemoteConfigService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteConfigFallbackFactory.class);
 
    @Override
    public RemoteConfigService create(Throwable throwable)
    {
        log.error("系统配置服务调用失败:{}", throwable.getMessage());
        return new RemoteConfigService()
        {
            @Override
            public R<SysTag> getSysTag(Long sysTagId) {
                return R.fail("获取标签失败:" + throwable.getMessage());
            }
 
            @Override
            public R<MgtUserIdByDept> getUserIdByDept(MgtUserIdByDept userIdByDept) {
                return R.fail("获取部门用户失败:" + throwable.getMessage());
            }
 
            @Override
            public R<List<MgtSysSimpleUserVo>> listSimpleUserVo(MgtBaseBathDto mgtBaseBathDto) {
                return R.fail("获取用户列表失败:" + throwable.getMessage());
            }
 
            @Override
            public R<Activeness> getActivenessByName(String name) {
                return R.fail("获取活跃度失败:" + throwable.getMessage());
            }
 
            @Override
            public R<DelayTask> getDelayTask(String key) {
                return null;
            }
 
            @Override
            public R addDelayTask(DelayTask delayTask) {
                return null;
            }
 
            @Override
            public R deleteDelayTask(String key) {
                return null;
            }
 
            @Override
            public R<AppOtherConfigGetVo> getAppOtherConfigGetVo() {
                return R.fail("获取其他设置失败:" + throwable.getMessage());
            }
 
            @Override
            public R changeClassNum(MgtClassNumDto mgtClassNumDto) {
                return R.fail("改变分类数量失败:" + throwable.getMessage());
            }
 
            @Override
            public R<String> getServicePhone() {
                return R.fail("获取客服电话失败:" + throwable.getMessage());
            }
 
            @Override
            public R<List<SysStaff>> listSysStaffByIds(List<Long> userIdList) {
                return R.fail("通过id获取员工列表失败:" + throwable.getMessage());
            }
 
            @Override
            public R createFileRecord(FileRecord fileRecord) {
                return R.fail("创建文件上传记录失败:" + throwable.getMessage());
            }
 
 
            @Override
            public R<List<SysTag>> listSysTag(Integer tagType) {
                return R.fail("获取标签失败:" + throwable.getMessage());
            }
 
            @Override
            public R<List<Activeness>> listActiveness() {
                return R.fail("获取活跃度列表失败:" + throwable.getMessage());
            }
 
            @Override
            public R<SysClassification> getSysClassification(Long classId) {
                return R.fail("获取分类失败:" + throwable.getMessage());
            }
 
            @Override
            public R<Map<Long, SysClassification>> getSysClassificationList(List<Long> classIds) {
                return R.fail("获取分类失败:" + throwable.getMessage());
            }
        };
    }
}