优化支付通知的逻辑,解决并发的问题。

同时,收到支付结果时,立马回调业务,避免延迟
This commit is contained in:
YunaiV
2021-10-27 10:06:49 +08:00
parent 72b64dc526
commit dd2d8a2ba9
16 changed files with 363 additions and 10 deletions

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.userserver.modules.shop.controller;
import cn.iocoder.yudao.coreservice.modules.pay.service.notify.vo.PayNotifyOrderReqVO;
import cn.iocoder.yudao.coreservice.modules.pay.service.order.PayOrderCoreService;
import cn.iocoder.yudao.coreservice.modules.pay.service.order.dto.PayOrderCreateReqDTO;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
@ -10,10 +11,12 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.time.Duration;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -52,4 +55,11 @@ public class ShopOrderController {
.payOrderId(payOrderId).build());
}
@PostMapping("/pay-notify")
@ApiOperation("支付回调")
public CommonResult<Boolean> payNotify(@RequestBody @Valid PayNotifyOrderReqVO reqVO) {
log.info("[payNotify][回调成功]");
return success(true);
}
}