| 1234567891011121314151617181920212223242526 |
- package com.izouma.yags.web;
- import com.izouma.yags.enums.PayMethod;
- import com.izouma.yags.service.OrderPayService;
- import com.izouma.yags.utils.SecurityUtils;
- import lombok.AllArgsConstructor;
- import org.springframework.web.bind.annotation.*;
- @RestController
- @RequestMapping("/order/pay")
- @AllArgsConstructor
- public class OrderPayController {
- private OrderPayService orderPayService;
- @GetMapping("/{id}/{method}")
- @ResponseBody
- public Object pay(@PathVariable Long id, @PathVariable PayMethod method) throws Exception {
- return orderPayService.pay(SecurityUtils.getAuthenticatedUser().getId(), id, method);
- }
- @RequestMapping(value = "/form/{id}", produces = "text/html")
- @ResponseBody
- public String pay(@PathVariable Long id) {
- return orderPayService.getForm(id);
- }
- }
|