package com.ruoyi.management.api.factory;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.management.api.feignClient.TApproveConfigClient;
|
import com.ruoyi.management.api.vo.ApproveConfigClientVO;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.stereotype.Component;
|
|
import java.util.List;
|
|
/**
|
* 门店服务降级处理
|
*
|
* @author ruoyi
|
*/
|
@Component
|
public class TApproveConfigFallbackFactory implements FallbackFactory<TApproveConfigClient>
|
{
|
private static final Logger log = LoggerFactory.getLogger(TApproveConfigFallbackFactory.class);
|
|
@Override
|
public TApproveConfigClient create(Throwable throwable)
|
{
|
log.error("审批服务调用失败:{}", throwable.getMessage());
|
return new TApproveConfigClient()
|
{
|
@Override
|
public R<Boolean> add(Integer companyId) {
|
return R.fail("默认添加审批流配置失败:" + throwable.getMessage());
|
}
|
|
@Override
|
public R<List<ApproveConfigClientVO>> queryConfigByCompanyId(Integer companyId) {
|
return R.fail("查询公司审批流配置通过公司id失败:" + throwable.getMessage());
|
}
|
};
|
}
|
}
|