CouponController.java 781 B

12345678910111213141516171819202122232425262728
  1. package com.example.cinema.controller.promotion;
  2. import com.example.cinema.bl.promotion.CouponService;
  3. import com.example.cinema.vo.ResponseVO;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PathVariable;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RestController;
  9. /**
  10. * Created by liying on 2019/4/16.
  11. */
  12. @RestController
  13. @RequestMapping("/coupon")
  14. public class CouponController {
  15. @Autowired
  16. CouponService couponService;
  17. @GetMapping("{userId}/get")
  18. public ResponseVO getCoupons(@PathVariable int userId){
  19. return couponService.getCouponsByUser(userId);
  20. }
  21. }