|
@@ -0,0 +1,47 @@
|
|
|
|
|
+package com.fs.app.controller;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+import com.fs.app.annotation.Login;
|
|
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
|
|
+import com.fs.his.domain.FsCourseCouponUser;
|
|
|
|
|
+import com.fs.his.param.FsCourseCouponUserUParam;
|
|
|
|
|
+import com.fs.his.service.IFsCourseCouponUserService;
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+@Api("用户课程优惠券接口")
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping(value="/app/courseCouponUser")
|
|
|
|
|
+public class FsCourseCouponUserController extends AppBaseController {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsCourseCouponUserService fsCourseCouponUserService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Login
|
|
|
|
|
+ @GetMapping("/myCouponList")
|
|
|
|
|
+ public R myCouponList(FsCourseCouponUserUParam param){
|
|
|
|
|
+ PageHelper.startPage(param.getPageNum(),param.getPageSize());
|
|
|
|
|
+ long userId = Long.parseLong(getUserId());
|
|
|
|
|
+ FsCourseCouponUser couponUser = new FsCourseCouponUser();
|
|
|
|
|
+ couponUser.setStatus(param.getStatus());
|
|
|
|
|
+ couponUser.setUserId(userId);
|
|
|
|
|
+ List<FsCourseCouponUser> fsCourseCouponUsers = fsCourseCouponUserService.selectFsCourseCouponUserList(couponUser);
|
|
|
|
|
+ PageInfo<FsCourseCouponUser> pageInfo = new PageInfo<>(fsCourseCouponUsers);
|
|
|
|
|
+ return R.ok().put("data",pageInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Login
|
|
|
|
|
+ @PostMapping("/useCoupon")
|
|
|
|
|
+ public R useCoupon(@RequestBody FsCourseCouponUser courseCouponUser) {
|
|
|
|
|
+ long userId = Long.parseLong(getUserId());
|
|
|
|
|
+ courseCouponUser.setUserId(userId);
|
|
|
|
|
+ return fsCourseCouponUserService.useCoupon(courseCouponUser.getUserId(), courseCouponUser.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|