package com.ruoyi.order.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; import com.ruoyi.order.vo.Price; import lombok.extern.slf4j.Slf4j; import com.ruoyi.order.model.Order; import com.ruoyi.order.model.OrderGood; import org.springframework.cloud.openfeign.FallbackFactory; import java.util.List; import java.util.Set; @Slf4j public class RemoteOrderGoodsFallbackFactory implements FallbackFactory { @Override public RemoteOrderGoodsClient create(Throwable cause) { return new RemoteOrderGoodsClient(){ @Override public R> goodsOrder(List goodsIds) { log.error("获取订单商品失败:{}", cause.getMessage()); throw new RuntimeException("获取订单商品失败"); } @Override public R> getOrderListByIds(List orderIds) { log.error("获取订单列表失败:{}", cause.getMessage()); throw new RuntimeException("获取订单列表失败"); } @Override public R> getOrderListByUserIdAndGoodsId(Long userId, Integer goodsId) { return R.fail("获取订单列表失败"); } @Override public R updateOrderStatus(Order order) { return R.fail("更新订单状态失败"); } @Override public R subscribe(Long id, Integer technicianId) { return R.fail("预约失败"); } @Override public R calculationCommission(Set orderIds) { return R.fail("计算佣金失败"); } @Override public R getGoodsPrice(Long appUserId, Integer goodsId, Integer shopId) { return R.fail("获取商品价格失败"); } @Override public R getLastOrder(Long appUserId) { return R.fail("获取订单失败"); } @Override public R> byUserId(Long appUserId) { return R.fail(); } @Override public R> byShopId(Integer shopId) { return R.fail(); } }; } }