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()); }
|
};
|
}
|
|
}
|