|
|
@@ -1,6 +1,8 @@
|
|
|
package com.example.cinema.controller;
|
|
|
|
|
|
+import com.example.cinema.bl.CouponService;
|
|
|
import com.example.cinema.vo.ResponseVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -13,9 +15,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/coupon")
|
|
|
public class CouponController {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ CouponService couponService;
|
|
|
+
|
|
|
@GetMapping("{userId}/get")
|
|
|
public ResponseVO getCoupons(@PathVariable int userId){
|
|
|
- return null;
|
|
|
+ return couponService.getCouponsByUser(userId);
|
|
|
}
|
|
|
|
|
|
|