jiangqs
2023-07-15 b0b52cbabf7a4bc8e00fc328d14ac05336d0221e
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
package com.ruoyi.system.api.factory;
 
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;
            }
        };
    }
 
}