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.domain.ShopBalanceStatement; import com.ruoyi.other.api.feignClient.ShopClient; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; import java.util.List; import java.util.Set; @Slf4j public class ShopClientFallbackFactory implements FallbackFactory { @Override public ShopClient create(Throwable cause) { return new ShopClient(){ @Override public R getShopById(Integer id) { return R.fail("根据id获取门店信息失败:" + cause.getMessage()); } @Override public R> getShopByUserId(Long id) { return R.fail("根据用户id集合获取门店数据失败"); } @Override public R getShopByPhone(String phone) { return R.fail("根据店铺管理员电话获取门店数据失败:" + cause.getMessage()); } @Override public R> getShopByUserIds(List userIds) { return R.fail("根据用户id集合获取门店数据失败"); } @Override public R> getShopIdByName(String shopName) { return R.fail("根据门店名称获取门店id失败:" + cause.getMessage()); } @Override public R> getShopBalanceStatementList(ShopBalanceStatement shopBalanceStatement) { return R.fail(); } }; } }