PayController.java 715 B

123456789101112131415161718192021
  1. package cn.rankin.userservice.controller;
  2. import cn.rankin.common.utils.api.model.APIResult;
  3. import cn.rankin.data.api.user.dto.PayDTO;
  4. import cn.rankin.userservice.service.PayingService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.*;
  7. @RestController
  8. @RequestMapping(value = "/pay")
  9. public class PayController {
  10. @Autowired
  11. private PayingService payingService;
  12. @RequestMapping(value = "/buy", method = RequestMethod.POST)
  13. public APIResult<Boolean> buy(@RequestBody PayDTO payDTO) {
  14. return payingService.buy(payDTO.getMerchantId(), payDTO.getQuantity(), payDTO.getType(), payDTO.getReceiptId(), payDTO.getNote());
  15. }
  16. }