取消支付接口
This commit is contained in:
@@ -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")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user