package com.ruoyi.account.api.factory;
|
|
import com.ruoyi.account.api.feignClient.AppUserCarClient;
|
import com.ruoyi.account.api.feignClient.AppUserClient;
|
import com.ruoyi.account.api.model.TAppUser;
|
import com.ruoyi.account.api.model.TAppUserCar;
|
import com.ruoyi.common.core.domain.R;
|
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 AppUserCarFallbackFactory implements FallbackFactory<AppUserCarClient>
|
{
|
private static final Logger log = LoggerFactory.getLogger(AppUserCarFallbackFactory.class);
|
|
@Override
|
public AppUserCarClient create(Throwable throwable) {
|
log.error("用户车辆服务调用失败:{}", throwable.getMessage());
|
return new AppUserCarClient() {
|
|
@Override
|
public R<List<TAppUserCar>> getCarByIds(List<Long> carIds) {
|
return R.fail("根据用户车辆id查询车辆信息失败:"+throwable.getMessage());
|
}
|
|
@Override
|
public R<TAppUserCar> getCarById(String id) {
|
return R.fail("根据用户车辆id查询车辆信息失败:"+throwable.getMessage());
|
}
|
|
@Override
|
public R<TAppUserCar> getAppUserCarByLicensePlate(String licensePlate) {
|
return R.fail("根据车牌号查询数据失败:" + throwable.getMessage());
|
}
|
|
@Override
|
public R<List<Long>> getAppUserCarByLicensePlates(String licensePlate) {
|
return null;
|
}
|
};
|
}
|
}
|