RtMallOrderRefundApi.java
2.59 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
package com.diligrp.cashier.mall.api;
import com.diligrp.cashier.mall.domain.rtmall.RtMarkMessage;
import com.diligrp.cashier.mall.domain.rtmall.co.RefundCO;
import com.diligrp.cashier.mall.domain.rtmall.co.RefundStatusCO;
import com.diligrp.cashier.mall.domain.rtmall.vo.RefundSuccessVO;
import com.diligrp.cashier.mall.domain.rtmall.vo.RefundVO;
import com.diligrp.cashier.mall.service.biz.MallBizRefundService;
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 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 RtMallOrderRefundApi.java
* @author dengwei
* @version 1.0.0
* @Description RtMallOrderRefundApi
*/
@RestController
@RequestMapping(path = {"/api/rt/mall", "/rt/mall"})
@Validated
public class RtMallOrderRefundApi {
@Resource
private MallBizRefundService mallBizRefundService;
/**
* refund
* @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC
* 申请退款接口
*/
@PostMapping("/refund/v1")
@ParamLogPrint(outPrint = true)
@Sign(sign = RtMallSign.class)
@RepeatSubmit(prefix = "refund:", value = "#req['order_id']", duplicationSubmit = SpelDuplicationSubmit.class)
public RtMarkMessage<RefundSuccessVO> refund(@RequestBody Object req) {
RefundCO refundCo = JsonUtils.convertValue(req, RefundCO.class);
RtMallValidateUtils.valid(refundCo);
return RtMarkMessage.success(mallBizRefundService.refund(refundCo));
}
/**
* info
* @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC
* 查询退款状态
*/
@PostMapping("/refund/v1/info")
@ParamLogPrint(outPrint = true)
@Sign(sign = RtMallSign.class)
public RtMarkMessage<RefundVO> info(@RequestBody Object req) {
RefundStatusCO refundStatusCo = JsonUtils.convertValue(req, RefundStatusCO.class);
RtMallValidateUtils.valid(refundStatusCo);
return RtMarkMessage.success(mallBizRefundService.info(refundStatusCo));
}
}