From aa43a92c7ec9053dbaef92fe5ccb3011b670442c Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 12 七月 2023 11:46:21 +0800
Subject: [PATCH] 更新线上视频奖励模块接口

---
 cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java |  119 ++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 89 insertions(+), 30 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
index 2f7c1ea..d371b09 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
@@ -4,13 +4,16 @@
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.dsh.account.entity.TStudent;
 import com.dsh.account.feignclient.competition.model.PurchaseRecordVo;
+import com.dsh.account.model.vo.classDetails.ClasspaymentRequest;
 import com.dsh.account.model.vo.classDetails.classInsVo.*;
 import com.dsh.account.model.vo.commentDetail.StuCommentsVo;
+import com.dsh.account.model.vo.medalDetail.GongVo;
 import com.dsh.account.model.vo.medalDetail.StuMedalVo;
 import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo;
 import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp;
 import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest;
 import com.dsh.account.service.EvaluateStudentService;
+import com.dsh.account.service.StudentHonorService;
 import com.dsh.account.service.TAppUserService;
 import com.dsh.account.service.TStudentService;
 import com.dsh.account.util.DateUtil;
@@ -26,7 +29,6 @@
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
@@ -51,19 +53,22 @@
     private EvaluateStudentService evalstuService;
 
     @Autowired
+    private StudentHonorService honorService;
+
+    @Autowired
     private TokenUtil tokenUtil;
 
 
 
     @ResponseBody
-    @PostMapping("/base/startCource/queryStudentData")
+    @PostMapping("/api/startCource/queryStudentData")
     @ApiOperation(value = "上课首页", tags = {"APP-开始上课"})
     @ApiImplicitParams({
             @ApiImplicitParam(value = "经度值", name = "longitude", required = true, dataType = "String"),
             @ApiImplicitParam(value = "纬度值", name = "latitude", required = true, dataType = "String"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil<ClassInfoVo> queryCouponRecord(@RequestBody String longitude, @RequestBody String latitude){
+    public ResultUtil<ClassInfoVo> queryCouponRecord(String longitude, String latitude){
         try {
             Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
             if(null == userIdFormRedis){
@@ -78,13 +83,13 @@
 
 
     @ResponseBody
-    @PostMapping("/base/startCource/queryPhysical")
+    @PostMapping("/api/startCource/queryPhysical")
     @ApiOperation(value = "获取学员测试报告", tags = {"APP-开始上课"})
     @ApiImplicitParams({
             @ApiImplicitParam(value = "学员id", name = "id", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil<StuPhysicalVo> getStuPhysicalInfo(@RequestBody Integer stuID){
+    public ResultUtil<StuPhysicalVo> getStuPhysicalInfo(Integer stuID){
         StuPhysicalVo vo = new StuPhysicalVo();
         TStudent tStudent = istuService.getById(stuID);
         if (ToolUtil.isNotEmpty(tStudent)){
@@ -100,14 +105,13 @@
      * 添加学员信息
      */
     @ResponseBody
-    @PostMapping("/base/startCource/addData")
+    @PostMapping("/api/startCource/addData")
     @ApiOperation(value = "添加学员信息", tags = {"APP-开始上课"})
     @ApiImplicitParams({
-            @ApiImplicitParam(value = "学员信息", name = "stu", required = true, dataType = "int"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
     @Transactional
-    public ResultUtil addStu(@RequestBody StuDetailsReq stu){
+    public ResultUtil addStu(StuDetailsReq stu){
         try {
             Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
             if(null == userIdFormRedis){
@@ -124,7 +128,7 @@
      * 该APP用户下的学员列表
      */
     @ResponseBody
-    @PostMapping("/base/startCource/listOfStu")
+    @PostMapping("/api/startCource/listOfStu")
     @ApiOperation(value = "学员列表", tags = {"APP-开始上课"})
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
@@ -149,6 +153,7 @@
                     vo.setStuHeight(sts.getHeight());
                     vo.setStuWeight(sts.getWeight());
                     vo.setIsNot(sts.getIsDefault());
+                    stuListVos.add(vo);
                 });
             }
             return ResultUtil.success(stuListVos);
@@ -157,18 +162,44 @@
         }
     }
 
+
+    /**
+     * 切换学员
+     */
+    @ResponseBody
+    @PostMapping("/api/startCource/switchStu")
+    @ApiOperation(value = "切换学员", tags = {"APP-开始上课"})
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+            @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"),
+    })
+    public ResultUtil<List<StuListVo>> dealSwitchStudents(Integer stuId){
+        try {
+            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+            if(null == userIdFormRedis){
+                return ResultUtil.tokenErr();
+            }
+            return ResultUtil.success(istuService.switchStudentActions(userIdFormRedis,stuId));
+        }catch (Exception e){
+            return ResultUtil.runErr();
+        }
+
+
+    }
+
+
     /**
      * 课时详情
      */
     @ResponseBody
-    @PostMapping("/base/startCource/lessonDetails")
+    @PostMapping("/api/startCource/lessonDetails")
     @ApiOperation(value = "课时详情", tags = {"APP-开始上课"})
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
             @ApiImplicitParam(value = "课包id", name = "lessonId", required = true, dataType = "int"),
             @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"),
     })
-    public ResultUtil<ClassDetailsInsVo> coursePackageDetails(@RequestBody Integer lessonId, @RequestBody Integer stuId){
+    public ResultUtil<ClassDetailsInsVo> coursePackageDetails(Integer lessonId, Integer stuId){
         try {
             Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
             if(null == userIdFormRedis){
@@ -188,12 +219,12 @@
      * 课时详情-记录列表
      */
     @ResponseBody
-    @PostMapping("/base/startCource/recordDetails")
+    @PostMapping("/api/startCource/recordDetails")
     @ApiOperation(value = "课时详情-记录列表", tags = {"APP-开始上课"})
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
     })
-    public ResultUtil<List<PurchaseRecordVo>> recordList(@RequestBody RecordTimeRequest timeRequest){
+    public ResultUtil<List<PurchaseRecordVo>> recordList(RecordTimeRequest timeRequest){
         try {
             Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
             if(null == userIdFormRedis){
@@ -210,12 +241,12 @@
      * 课时详情-续课课包详情
      */
     @ResponseBody
-    @PostMapping("/base/startCource/renewal")
+    @PostMapping("/api/startCource/renewal")
     @ApiOperation(value = "课时详情-续课课包详情", tags = {"APP-开始上课"})
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(@RequestBody Integer lessonId, @RequestBody Integer stuId){
+    public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(Integer lessonId, Integer stuId){
         try {
             Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
             if(null == userIdFormRedis){
@@ -233,7 +264,7 @@
      * 课时详情-选择优惠券
      */
     @ResponseBody
-    @PostMapping("/base/startCource/conponList")
+    @PostMapping("/api/startCource/conponList")
     @ApiOperation(value = "课时详情-选择优惠券", tags = {"APP-开始上课"})
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
@@ -257,15 +288,18 @@
      * 课时详情-支付
      */
     @ResponseBody
-    @PostMapping("/base/startCource/payment")
+    @PostMapping("/api/startCource/payment")
     @ApiOperation(value = "课时详情-支付", tags = {"APP-开始上课"})
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
     })
-    public ResultUtil<?> continuationOperation(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){
+    public ResultUtil continuationOperation(ClasspaymentRequest request){
         try {
-
-            return ResultUtil.success();
+            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+            if(null == userIdFormRedis){
+                return ResultUtil.tokenErr();
+            }
+            return istuService.renewClassPayment(userIdFormRedis,request);
         }catch (Exception e){
             return ResultUtil.runErr();
         }
@@ -277,10 +311,11 @@
      * 学员评语
      */
     @ResponseBody
-    @PostMapping("/base/startCource/stuComment")
+    @PostMapping("/api/startCource/stuComment")
     @ApiOperation(value = "学员评语", tags = {"APP-开始上课"})
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+            @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"),
     })
     public ResultUtil<List<StuCommentsVo>> queryStuComment(@RequestParam("stuId") Integer stuId){
         try {
@@ -292,26 +327,50 @@
 
 
     /**
-     * 学员勋章
+     * 学员勋章详情
      */
     @ResponseBody
-    @PostMapping("/base/startCource/stuMedal")
-    @ApiOperation(value = "学员勋章", tags = {"APP-开始上课"})
+    @PostMapping("/api/startCource/stuMedal")
+    @ApiOperation(value = "学员勋章详情", tags = {"APP-开始上课"})
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+            @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"),
     })
-    public ResultUtil<StuMedalVo> queryStuMedal(@RequestParam("stuId") Integer stuId){
+    public ResultUtil<List<StuMedalVo>> queryStuMedal(@RequestParam("stuId") Integer stuId){
         try {
             Integer appUserId = tokenUtil.getUserIdFormRedis();
             if(null == appUserId){
                 return ResultUtil.tokenErr();
             }
-
-            return ResultUtil.success();
+            return ResultUtil.success(honorService.queryHonorDetails(stuId));
         }catch (Exception e){
             return ResultUtil.runErr();
         }
     }
 
 
+    /**
+     * 学员勋章
+     */
+    @ResponseBody
+    @PostMapping("/api/startCource/stuGoog")
+    @ApiOperation(value = "学员勋章", tags = {"APP-开始上课"})
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+            @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"),
+    })
+    public ResultUtil<List<GongVo>> queryStuGoog(@RequestParam("stuId") Integer stuId){
+        try {
+            Integer appUserId = tokenUtil.getUserIdFormRedis();
+            if(null == appUserId){
+                return ResultUtil.tokenErr();
+            }
+            return ResultUtil.success(honorService.queryStuOfMedalData(stuId));
+        }catch (Exception e){
+            return ResultUtil.runErr();
+        }
+    }
+
+
+
 }

--
Gitblit v1.7.1