bug
jiangqs
2023-07-20 882edc4b8ac7cb11ec9d536b5573df2c7ed512ef
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
package com.ruoyi.system.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.dto.MerEditUserDto;
import com.ruoyi.system.api.service.RemoteSysStaffService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
 
/**
 * @ClassName RemoteStaffFallbackFactory
 * @Description TODO
 * @Author jqs
 * @Date 2023/7/14 10:30
 * @Version 1.0
 */
public class RemoteStaffFallbackFactory implements FallbackFactory<RemoteSysStaffService> {
 
    private static final Logger log = LoggerFactory.getLogger(RemoteStaffFallbackFactory.class);
 
    @Override
    public RemoteSysStaffService create(Throwable throwable)
    {
        log.error("员工服务调用失败:{}", throwable.getMessage());
        return new RemoteSysStaffService()
        {
 
            @Override
            public Boolean isLeader() {
                return null;
            }
 
            @Override
            public R editUserInfo(MerEditUserDto merEditUserDto) {
                return R.fail("修改用户失败:" + throwable.getMessage());            }
        };
    }
 
}