package com.ruoyi.other.api.factory;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.other.api.domain.IntegralRecord;
|
import com.ruoyi.other.api.domain.Shop;
|
import com.ruoyi.other.api.domain.TIntegralRule;
|
import com.ruoyi.other.api.feignClient.OtherClient;
|
import com.ruoyi.other.api.feignClient.StoreClient;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 充电订单服务降级处理
|
*
|
* @author ruoyi
|
*/
|
@Component
|
public class OtherFallbackFactory implements FallbackFactory<OtherClient>
|
{
|
private static final Logger log = LoggerFactory.getLogger(OtherFallbackFactory.class);
|
|
|
@Override
|
public OtherClient create(Throwable cause) {
|
log.error("other服务调用失败:{}", cause.getMessage());
|
return new OtherClient() {
|
@Override
|
public R<TIntegralRule> getSetBySiteId(Integer id) {
|
return R.fail("根据站点id查询积分设置:" + cause.getMessage());
|
}
|
|
@Override
|
public R saveIntegralRecord(IntegralRecord record) {
|
return R.fail("保存用户充电记录:" + cause.getMessage());
|
}
|
|
@Override
|
public R<String> getServiceStatus(Integer userId) {
|
return R.fail("查询站点账号服务费缴纳去情况失败:" + cause.getMessage());
|
}
|
|
|
};
|
}
|
}
|