RtMallOrderApi.java
3.02 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.diligrp.cashier.mall.api;
import com.diligrp.cashier.mall.domain.rtmall.RtMarkMessage;
import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO;
import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO;
import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO;
import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO;
import com.diligrp.cashier.mall.service.biz.MallBizOrderService;
import com.diligrp.cashier.mall.sign.RtMallSign;
import com.diligrp.cashier.mall.util.RtMallValidateUtils;
import com.diligrp.cashier.shared.annotation.ParamLogPrint;
import com.diligrp.cashier.shared.annotation.RepeatSubmit;
import com.diligrp.cashier.shared.annotation.Sign;
import com.diligrp.cashier.shared.handler.duplication.SpelDuplicationSubmit;
import com.diligrp.cashier.shared.util.JsonUtils;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
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 RtMallOrderApi.java
* @author dengwei
* @version 1.0.0
* @Description RtMallOrderApi
* @date 2025-12-26 11:31
*/
@RestController
@RequestMapping(path = {"/api/rt/mall", "/rt/mall"})
@Validated
public class RtMallOrderApi {
@Resource
private MallBizOrderService mallBizOrderService;
/**
* createOrder
* @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC
* 创建订单接口
*/
@PostMapping("/order/v1")
@ParamLogPrint(outPrint = true)
@Sign(sign = RtMallSign.class)
@RepeatSubmit(prefix = "order_sync:", value = "#req['order_id']", duplicationSubmit = SpelDuplicationSubmit.class)
public RtMarkMessage<OrderSuccessVO> createOrder(@Valid @RequestBody Object req) {
OrderCO orderCo = JsonUtils.convertValue(req, OrderCO.class);
RtMallValidateUtils.valid(orderCo);
return RtMarkMessage.success(mallBizOrderService.createOrder(orderCo));
}
/**
* info
* @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC
* 查询订单状态
*/
@PostMapping("/order/v1/info")
@ParamLogPrint(outPrint = true)
@Sign(sign = RtMallSign.class)
public RtMarkMessage<OrderPaymentVO> info(@Valid @RequestBody Object req) {
OrderInfoCO orderInfoCo = JsonUtils.convertValue(req, OrderInfoCO.class);
RtMallValidateUtils.valid(orderInfoCo);
return RtMarkMessage.success(mallBizOrderService.info(orderInfoCo));
}
/**
* statusCallback
* @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC
* 查询订单状态
*/
@PostMapping("/order/v1/status/callback")
@ParamLogPrint(outPrint = true)
@Sign(sign = RtMallSign.class)
public RtMarkMessage<?> statusCallback(@Valid @RequestBody Object req) {
return RtMarkMessage.success();
}
}