ManualHandlerApi.java
1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.diligrp.cashier.mall.api;
import com.diligrp.cashier.shared.domain.Message;
import com.diligrp.cashier.shared.spi.IPaymentEventListener;
import com.diligrp.cashier.shared.spi.domain.PaymentResultBO;
import com.diligrp.cashier.shared.spi.domain.RefundResultBO;
import jakarta.annotation.Resource;
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;
/**
* @ClassName ManualHandlerApi.java
* @author dengwei
* @version 1.0.0
* @Description ManualHandlerApi
*/
@RestController
@RequestMapping(path = "/mall/manual")
@Validated
public class ManualHandlerApi {
@Resource
private IPaymentEventListener payNotifyServiceImpl;
@PostMapping("/payment/event")
public Message<?> handlePaymentEvent(@RequestBody PaymentResultBO payment) {
payNotifyServiceImpl.onEvent(payment);
return Message.success();
}
@PostMapping("/refund/event")
public Message<?> handlePaymentEvent(@RequestBody RefundResultBO refund) {
payNotifyServiceImpl.onEvent(refund);
return Message.success();
}
}