package com.ruoyi.other.api.factory;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.other.api.domain.Shop;
|
import com.ruoyi.other.api.feignClient.ShopClient;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
|
@Slf4j
|
public class ShopClientFallbackFactory implements FallbackFactory<ShopClient> {
|
@Override
|
public ShopClient create(Throwable cause) {
|
return new ShopClient(){
|
@Override
|
public R<Shop> getShopById(Integer id) {
|
return R.fail("根据id获取门店信息失败:" + cause.getMessage());
|
}
|
};
|
}
|
}
|