取消支付接口

This commit is contained in:
2024-10-10 13:51:56 +08:00
parent b3c243cf43
commit 21c39032d5
3 changed files with 30 additions and 4 deletions

View File

@@ -2,12 +2,13 @@ package com.chaozhanggui.system.cashierservice.controller;
import com.alibaba.fastjson.JSON;
import com.chaozhanggui.system.cashierservice.service.OrderService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
@CrossOrigin(origins = "*")
@@ -17,6 +18,11 @@ import java.util.Map;
public class NotifyController {
private final OrderService orderService;
public NotifyController(OrderService orderService) {
this.orderService = orderService;
}
@RequestMapping("notifyPay")
public String notifyPay(@RequestBody Map<String,Object> map){
@@ -24,4 +30,13 @@ public class NotifyController {
return null;
}
/**
* 支付取消
* @return 影响数量
*/
@PostMapping("cancel")
public Result notifyCancel(@RequestBody HashMap<String, Integer> data) {
return Result.success(CodeEnum.SUCCESS, orderService.cancelOrder(data.get("orderId")));
}
}