VIPCardController.java 971 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.example.cinema.controller;
  2. import com.example.cinema.bl.VIPService;
  3. import com.example.cinema.vo.VIPCardForm;
  4. import com.example.cinema.vo.ResponseVO;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.*;
  7. /**
  8. * Created by liying on 2019/4/14.
  9. */
  10. @RestController()
  11. @RequestMapping("/vip")
  12. public class VIPCardController {
  13. @Autowired
  14. VIPService vipService;
  15. @PostMapping("/add")
  16. public ResponseVO addVIP(@RequestParam int userId){
  17. return vipService.addVIPCard(userId);
  18. }
  19. @GetMapping("{id}/get")
  20. public ResponseVO getVIP(@PathVariable int id){
  21. return vipService.getCardById(id);
  22. }
  23. @GetMapping("/getVIPInfo")
  24. public ResponseVO getVIPInfo(){
  25. return vipService.getVIPInfo();
  26. }
  27. @PostMapping("/charge")
  28. public ResponseVO charge(@RequestBody VIPCardForm vipCardForm){
  29. return vipService.charge(vipCardForm);
  30. }
  31. }