luo
2023-09-25 35fec86ca49916eb8a8082f7f1e99185ee1e3c24
cloud-server-course/src/main/java/com/dsh/course/controller/CourseController.java
@@ -128,7 +128,6 @@
    @ResponseBody
    @PostMapping("/api/course/queryCourseList")
    @ApiOperation(value = "获取课程列表", tags = {"APP-课程列表"})
@@ -148,6 +147,24 @@
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/base/course/queryCourseListOne")
    @ApiOperation(value = "获取课程列表", tags = {"APP-课程列表"})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<CoursePackageListVo>> queryCourseListOne(CoursePackageList coursePackageList){
        try {
            List<CoursePackageListVo> coursePackageListVos = coursePackageService.queryCourseListOne( coursePackageList);
            return ResultUtil.success(coursePackageListVos);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
@@ -177,7 +194,6 @@
    @ResponseBody
    @PostMapping("/api/course/paymentCourse")
    @ApiOperation(value = "支付课程", tags = {"APP-课程列表"})
@@ -190,6 +206,10 @@
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            Long couponId = paymentCourseVo.getCouponId();
            if(couponId==null || couponId==0){
                paymentCourseVo.setCouponId(null);
            }
            return coursePackageService.paymentCourse(uid, paymentCourseVo);
        }catch (Exception e){
            e.printStackTrace();
@@ -197,6 +217,25 @@
        }
    }
    // 2.0
    @ResponseBody
    @PostMapping("/api/course/paymentCourseCouponList")
    @ApiOperation(value = "支付课程--完成后优惠券列表", tags = {"APP-课程列表"})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil paymentCourseCouponList(Integer coursePackagePaymentConfigId){
        try {
            Integer uid = tokenUtil.getUserIdFormRedis();
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return coursePackageService.paymentCourseCouponList(uid, coursePackagePaymentConfigId);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 购买课程微信支付回调