feat(fallback): 添加订单出队和地理查询实体保存的降级处理
- 在XpOrderClientFallbackFactory中添加PopOrderDto导入
- 实现popOrder方法的降级逻辑并记录错误日志
- 在XpPricingClientFallbackFactory中添加XpGeoQueryEntity导入
- 实现saveXpGeoQueryEntity方法的降级逻辑并记录错误日志
- 完善熔断降级机制以提高系统稳定性
| | |
| | | import com.xiaopeng.api.dto.order.HistoryStartPointsDto; |
| | | import com.xiaopeng.api.feignClient.operation.XpPointClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpPricingClient; |
| | | import com.xiaopeng.api.model.operation.XpGeoQueryEntity; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.api.vo.order.XpHistoryStartPointsVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | |
| | | log.error("根据开通城市获取定价失败", cause); |
| | | return R.ok(null); |
| | | } |
| | | |
| | | @Override |
| | | public R<?> saveXpGeoQueryEntity(XpGeoQueryEntity xpGeoQueryEntity) { |
| | | log.error("保存XpGeoQueryEntity失败", cause); |
| | | return R.fail(); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.api.factory.order; |
| | | |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | | import com.xiaopeng.api.dto.order.PopOrderDto; |
| | | import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO; |
| | | import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO; |
| | | import com.xiaopeng.api.feignClient.order.XpOrderClient; |
| | |
| | | log.error("获取订单数量失败,原因: {}", cause.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R<?> popOrder(PopOrderDto dto) { |
| | | log.error("订单出队失败,原因: {}", cause.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | }; |
| | | } |
| | | } |