|
@@ -3,13 +3,16 @@ package com.yonge.cooleshow.admin.controller;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.dto.AdjustModel;
|
|
import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
|
|
import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
|
|
import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
|
|
import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
|
|
import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
|
|
import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
|
|
import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail;
|
|
import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail;
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupDetailService;
|
|
import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupDetailService;
|
|
import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupService;
|
|
import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupService;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.valid.UpdateGroup;
|
|
import com.yonge.toolset.base.util.StringUtil;
|
|
import com.yonge.toolset.base.util.StringUtil;
|
|
import com.yonge.toolset.mybatis.support.PageUtil;
|
|
import com.yonge.toolset.mybatis.support.PageUtil;
|
|
import com.yonge.cooleshow.biz.dal.valid.AddGroup;
|
|
import com.yonge.cooleshow.biz.dal.valid.AddGroup;
|
|
@@ -22,12 +25,15 @@ import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import javax.validation.Valid;
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.NotNull;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -188,4 +194,77 @@ public class VideoLessonController extends BaseController {
|
|
public HttpResponseResult<CountVideoGroupVo> countVideoGroup() {
|
|
public HttpResponseResult<CountVideoGroupVo> countVideoGroup() {
|
|
return succeed(lessonGroupService.countVideoGroup());
|
|
return succeed(lessonGroupService.countVideoGroup());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 新增视频课组&视频课
|
|
|
|
+ * @Author: cy
|
|
|
|
+ * @Date: 2022/4/1
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "新增视频课组&视频课", httpMethod = "POST", consumes = "application/json", produces = "application/json")
|
|
|
|
+ @PostMapping(value = "/add", consumes = "application/json", produces = "application/json")
|
|
|
|
+ public HttpResponseResult<Object> add(@Validated(AddGroup.class) @RequestBody VideoLessonVo lessonVo) {
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+
|
|
|
|
+ if (sysUser == null || sysUser.getId() == null) {
|
|
|
|
+ return failed("用户信息获取失败");
|
|
|
|
+ }
|
|
|
|
+ if (CollectionUtils.isEmpty(lessonVo.getLessonList())) {
|
|
|
|
+ return failed("课程不能为空");
|
|
|
|
+ }
|
|
|
|
+ lessonGroupService.add(lessonVo, sysUser);
|
|
|
|
+ return succeed();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 修改视频课组&视频课
|
|
|
|
+ * @Author: cy
|
|
|
|
+ * @Date: 2022/4/7
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "修改视频课组&视频课", httpMethod = "POST", consumes = "application/json", produces = "application/json")
|
|
|
|
+ @PostMapping(value = "/update", consumes = "application/json", produces = "application/json")
|
|
|
|
+ public HttpResponseResult<Object> update(@Validated(UpdateGroup.class) @RequestBody VideoLessonVo lessonVo) {
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+
|
|
|
|
+ if (sysUser == null || sysUser.getId() == null) {
|
|
|
|
+ return failed("用户信息获取失败");
|
|
|
|
+ }
|
|
|
|
+ if (CollectionUtils.isEmpty(lessonVo.getLessonList())) {
|
|
|
|
+ return failed("课程不能为空");
|
|
|
|
+ }
|
|
|
|
+ lessonGroupService.update(lessonVo, sysUser);
|
|
|
|
+ return succeed();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 置顶
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/top/{id}")
|
|
|
|
+ @ApiOperation(value = "置顶", notes = "传入id")
|
|
|
|
+ public HttpResponseResult<Boolean> top(@ApiParam(value = "视频课编号", required = true) @PathVariable Long id) {
|
|
|
|
+ if (StringUtil.isEmpty(id)) {
|
|
|
|
+ return failed("参数不能为空");
|
|
|
|
+ }
|
|
|
|
+ return status(lessonGroupService.top(id));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 设置排序值 和加精
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/adjust")
|
|
|
|
+ @ApiOperation(value = "视频课调整排序")
|
|
|
|
+ public HttpResponseResult<Boolean> adjust(@RequestBody @Valid AdjustModel model) {
|
|
|
|
+
|
|
|
|
+ VideoLessonGroup videoLessonGroup = new VideoLessonGroup();
|
|
|
|
+ videoLessonGroup.setId(model.getId());
|
|
|
|
+ videoLessonGroup.setSortNumber(model.getSort());
|
|
|
|
+
|
|
|
|
+ lessonGroupService.updateById(videoLessonGroup);
|
|
|
|
+
|
|
|
|
+ return succeed();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|