package com.example.cinema.controller; import com.example.cinema.bl.VIPService; import com.example.cinema.vo.VIPCardForm; import com.example.cinema.vo.ResponseVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * Created by liying on 2019/4/14. */ @RestController() @RequestMapping("/vip") public class VIPCardController { @Autowired VIPService vipService; @PostMapping("/add") public ResponseVO addVIP(@RequestParam int userId){ return vipService.addVIPCard(userId); } @GetMapping("{id}/get") public ResponseVO getVIP(@PathVariable int id){ return vipService.getCardById(id); } @GetMapping("/getVIPInfo") public ResponseVO getVIPInfo(){ return vipService.getVIPInfo(); } @PostMapping("/charge") public ResponseVO charge(@RequestBody VIPCardForm vipCardForm){ return vipService.charge(vipCardForm); } }