Pu Zhibing
2025-02-28 8baab7959e8efd5be4c0276b7759c2b677eeb7df
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.ruoyi.system.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysLoginLog;
import com.ruoyi.system.api.feignClient.SysLoginLogClient;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
@Component
public class SysLoginLogFallbackFactory implements FallbackFactory<SysLoginLogClient> {
    @Override
    public SysLoginLogClient create(Throwable cause) {
        return new SysLoginLogClient(){
    
    
            @Override
            public R saveLoginLog(SysLoginLog loginLog) {
                return R.fail("添加登录日志失败!" + cause.getMessage());
            }
        };
    }
}