package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.dto.AppShoppingCartDelDto; import com.ruoyi.system.api.service.RemoteShoppingCartService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; /** * @author jqs34 * @ClassName RemoteShoppingCartFallbackFactory * @description: TODO * @date 2023年05月23日 * @version: 1.0 */ @Component public class RemoteShoppingCartFallbackFactory implements FallbackFactory { private static final Logger log = LoggerFactory.getLogger(RemoteMemberFallbackFactory.class); @Override public RemoteShoppingCartService create(Throwable throwable) { log.error("购物车服务调用失败:{}", throwable.getMessage()); return new RemoteShoppingCartService() { @Override public R deleteShoppingCart(AppShoppingCartDelDto appShoppingCartDelDto) { return R.fail("删除购物车户失败:" + throwable.getMessage()); } }; } }