package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.RemoteMemberService; import com.ruoyi.system.api.RemoteShopService; import com.ruoyi.system.api.domain.poji.shop.Shop; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; /** * 商户服务 * * @author jqs */ @Component public class RemoteShopFallbackFactory implements FallbackFactory { private static final Logger log = LoggerFactory.getLogger(RemoteShopFallbackFactory.class); @Override public RemoteShopService create(Throwable throwable) { log.error("商户服务调用失败:{}", throwable.getMessage()); return new RemoteShopService() { @Override public R getShop(Long shopId) { return R.fail("获取商户失败:" + throwable.getMessage()); } }; } }