|
@@ -1,39 +1,34 @@
|
|
|
package com.fs.course.controller;
|
|
package com.fs.course.controller;
|
|
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
+import com.fs.common.annotation.Log;
|
|
|
|
|
+import com.fs.common.annotation.RepeatSubmit;
|
|
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.domain.model.LoginUser;
|
|
import com.fs.common.core.domain.model.LoginUser;
|
|
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
|
|
+import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
import com.fs.course.config.CourseConfig;
|
|
|
|
|
+import com.fs.course.domain.FsUserCourse;
|
|
|
import com.fs.course.params.FsUserCourseConfigParam;
|
|
import com.fs.course.params.FsUserCourseConfigParam;
|
|
|
|
|
+import com.fs.course.service.IFsUserCourseService;
|
|
|
import com.fs.course.service.IFsUserCourseVideoService;
|
|
import com.fs.course.service.IFsUserCourseVideoService;
|
|
|
import com.fs.course.vo.FsUserCourseListPVO;
|
|
import com.fs.course.vo.FsUserCourseListPVO;
|
|
|
import com.fs.framework.web.service.TokenService;
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
import com.fs.his.utils.RedisCacheUtil;
|
|
import com.fs.his.utils.RedisCacheUtil;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
import com.fs.his.vo.OptionsVO;
|
|
|
import com.fs.qw.param.FsUserCourseRedPageParam;
|
|
import com.fs.qw.param.FsUserCourseRedPageParam;
|
|
|
|
|
+import com.fs.sop.service.IQwSopTempService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
-import com.fs.common.annotation.Log;
|
|
|
|
|
-import com.fs.common.core.controller.BaseController;
|
|
|
|
|
-import com.fs.common.core.domain.AjaxResult;
|
|
|
|
|
-import com.fs.common.enums.BusinessType;
|
|
|
|
|
-import com.fs.course.domain.FsUserCourse;
|
|
|
|
|
-import com.fs.course.service.IFsUserCourseService;
|
|
|
|
|
-import com.fs.common.utils.poi.ExcelUtil;
|
|
|
|
|
-import com.fs.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 课程Controller
|
|
* 课程Controller
|
|
@@ -43,8 +38,7 @@ import com.fs.common.core.page.TableDataInfo;
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/course/userCourse")
|
|
@RequestMapping("/course/userCourse")
|
|
|
-public class FsUserCourseController extends BaseController
|
|
|
|
|
-{
|
|
|
|
|
|
|
+public class FsUserCourseController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsUserCourseService fsUserCourseService;
|
|
private IFsUserCourseService fsUserCourseService;
|
|
|
|
|
|
|
@@ -60,19 +54,21 @@ public class FsUserCourseController extends BaseController
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
private ISysConfigService configService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IQwSopTempService sopTempService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询课程列表
|
|
* 查询课程列表
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:list')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:list')")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo list(FsUserCourse fsUserCourse) {
|
|
|
startPage();
|
|
startPage();
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long userId = loginUser.getUser().getUserId();
|
|
Long userId = loginUser.getUser().getUserId();
|
|
|
String json = configService.selectConfigByKey("course.config");
|
|
String json = configService.selectConfigByKey("course.config");
|
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
|
|
|
fsUserCourse.setUserId(userId);
|
|
fsUserCourse.setUserId(userId);
|
|
|
}
|
|
}
|
|
|
List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
|
|
List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
|
|
@@ -84,14 +80,13 @@ public class FsUserCourseController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicList')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicList')")
|
|
|
@GetMapping("/publicList")
|
|
@GetMapping("/publicList")
|
|
|
- public TableDataInfo publicList(FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo publicList(FsUserCourse fsUserCourse) {
|
|
|
startPage();
|
|
startPage();
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long userId = loginUser.getUser().getUserId();
|
|
Long userId = loginUser.getUser().getUserId();
|
|
|
String json = configService.selectConfigByKey("course.config");
|
|
String json = configService.selectConfigByKey("course.config");
|
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
|
|
|
fsUserCourse.setUserId(userId);
|
|
fsUserCourse.setUserId(userId);
|
|
|
}
|
|
}
|
|
|
List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
|
|
List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
|
|
@@ -104,13 +99,12 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:export')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:export')")
|
|
|
@Log(title = "课程", businessType = BusinessType.EXPORT)
|
|
@Log(title = "课程", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult export(FsUserCourse fsUserCourse) {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long userId = loginUser.getUser().getUserId();
|
|
Long userId = loginUser.getUser().getUserId();
|
|
|
String json = configService.selectConfigByKey("course.config");
|
|
String json = configService.selectConfigByKey("course.config");
|
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
|
|
|
fsUserCourse.setUserId(userId);
|
|
fsUserCourse.setUserId(userId);
|
|
|
}
|
|
}
|
|
|
List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
|
|
List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
|
|
@@ -124,13 +118,12 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicExport')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicExport')")
|
|
|
@Log(title = "课程", businessType = BusinessType.EXPORT)
|
|
@Log(title = "课程", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/publicExport")
|
|
@GetMapping("/publicExport")
|
|
|
- public AjaxResult publicExport(FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult publicExport(FsUserCourse fsUserCourse) {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long userId = loginUser.getUser().getUserId();
|
|
Long userId = loginUser.getUser().getUserId();
|
|
|
String json = configService.selectConfigByKey("course.config");
|
|
String json = configService.selectConfigByKey("course.config");
|
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
|
|
|
fsUserCourse.setUserId(userId);
|
|
fsUserCourse.setUserId(userId);
|
|
|
}
|
|
}
|
|
|
List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
|
|
List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
|
|
@@ -143,8 +136,7 @@ public class FsUserCourseController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:query')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:query')")
|
|
|
@GetMapping(value = "/{courseId}")
|
|
@GetMapping(value = "/{courseId}")
|
|
|
- public AjaxResult getInfo(@PathVariable("courseId") Long courseId)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("courseId") Long courseId) {
|
|
|
return AjaxResult.success(fsUserCourseService.selectFsUserCourseByCourseId(courseId));
|
|
return AjaxResult.success(fsUserCourseService.selectFsUserCourseByCourseId(courseId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -153,8 +145,7 @@ public class FsUserCourseController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicQuery')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicQuery')")
|
|
|
@GetMapping(value = "/public/{courseId}")
|
|
@GetMapping(value = "/public/{courseId}")
|
|
|
- public AjaxResult publicGetInfo(@PathVariable("courseId") Long courseId)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult publicGetInfo(@PathVariable("courseId") Long courseId) {
|
|
|
return AjaxResult.success(fsUserCourseService.selectFsUserCourseByCourseId(courseId));
|
|
return AjaxResult.success(fsUserCourseService.selectFsUserCourseByCourseId(courseId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -164,13 +155,12 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:add')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:add')")
|
|
|
@Log(title = "课程", businessType = BusinessType.INSERT)
|
|
@Log(title = "课程", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult add(@RequestBody FsUserCourse fsUserCourse) {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long userId = loginUser.getUser().getUserId();
|
|
Long userId = loginUser.getUser().getUserId();
|
|
|
String json = configService.selectConfigByKey("course.config");
|
|
String json = configService.selectConfigByKey("course.config");
|
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
|
|
|
fsUserCourse.setUserId(userId);
|
|
fsUserCourse.setUserId(userId);
|
|
|
}
|
|
}
|
|
|
fsUserCourseService.insertFsUserCourse(fsUserCourse);
|
|
fsUserCourseService.insertFsUserCourse(fsUserCourse);
|
|
@@ -185,13 +175,12 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicAdd')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicAdd')")
|
|
|
@Log(title = "课程", businessType = BusinessType.INSERT)
|
|
@Log(title = "课程", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/public")
|
|
@PostMapping("/public")
|
|
|
- public AjaxResult publicAdd(@RequestBody FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult publicAdd(@RequestBody FsUserCourse fsUserCourse) {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
Long userId = loginUser.getUser().getUserId();
|
|
Long userId = loginUser.getUser().getUserId();
|
|
|
String json = configService.selectConfigByKey("course.config");
|
|
String json = configService.selectConfigByKey("course.config");
|
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
|
|
|
fsUserCourse.setUserId(userId);
|
|
fsUserCourse.setUserId(userId);
|
|
|
}
|
|
}
|
|
|
fsUserCourseService.insertFsUserCourse(fsUserCourse);
|
|
fsUserCourseService.insertFsUserCourse(fsUserCourse);
|
|
@@ -206,8 +195,7 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:edit')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:edit')")
|
|
|
@Log(title = "课程", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult edit(@RequestBody FsUserCourse fsUserCourse) {
|
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
@@ -219,8 +207,7 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:editRedPage')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:editRedPage')")
|
|
|
@Log(title = "修改课程红包", businessType = BusinessType.UPDATE)
|
|
@Log(title = "修改课程红包", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/editRedPage")
|
|
@PostMapping("/editRedPage")
|
|
|
- public AjaxResult editRedPage(@RequestBody FsUserCourseRedPageParam redPageParam)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult editRedPage(@RequestBody FsUserCourseRedPageParam redPageParam) {
|
|
|
courseVideoService.updateFsUserCourseRedPage(redPageParam);
|
|
courseVideoService.updateFsUserCourseRedPage(redPageParam);
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
|
}
|
|
}
|
|
@@ -231,8 +218,7 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicEdit')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicEdit')")
|
|
|
@Log(title = "课程", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping("/public")
|
|
@PutMapping("/public")
|
|
|
- public AjaxResult publicEdit(@RequestBody FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult publicEdit(@RequestBody FsUserCourse fsUserCourse) {
|
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
@@ -244,8 +230,7 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:copy')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:copy')")
|
|
|
@Log(title = "课程", businessType = BusinessType.DELETE)
|
|
@Log(title = "课程", businessType = BusinessType.DELETE)
|
|
|
@GetMapping("/copy/{courseId}")
|
|
@GetMapping("/copy/{courseId}")
|
|
|
- public AjaxResult copy(@PathVariable Long courseId)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult copy(@PathVariable Long courseId) {
|
|
|
int i = fsUserCourseService.copyFsUserCourse(courseId);
|
|
int i = fsUserCourseService.copyFsUserCourse(courseId);
|
|
|
return toAjax(i);
|
|
return toAjax(i);
|
|
|
}
|
|
}
|
|
@@ -255,8 +240,8 @@ public class FsUserCourseController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:remove')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:remove')")
|
|
|
@Log(title = "课程", businessType = BusinessType.DELETE)
|
|
@Log(title = "课程", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{courseIds}")
|
|
|
|
|
- public AjaxResult remove(@PathVariable Long[] courseIds){
|
|
|
|
|
|
|
+ @DeleteMapping("/{courseIds}")
|
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] courseIds) {
|
|
|
fsUserCourseService.deleteFsUserCourseByCourseIds(courseIds);
|
|
fsUserCourseService.deleteFsUserCourseByCourseIds(courseIds);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
@@ -268,8 +253,7 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicRemove')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicRemove')")
|
|
|
@Log(title = "课程", businessType = BusinessType.DELETE)
|
|
@Log(title = "课程", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/public/{courseIds}")
|
|
@DeleteMapping("/public/{courseIds}")
|
|
|
- public AjaxResult publicRemove(@PathVariable Long[] courseIds)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult publicRemove(@PathVariable Long[] courseIds) {
|
|
|
fsUserCourseService.deleteFsUserCourseByCourseIds(courseIds);
|
|
fsUserCourseService.deleteFsUserCourseByCourseIds(courseIds);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
@@ -277,8 +261,7 @@ public class FsUserCourseController extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getAllList")
|
|
@GetMapping("/getAllList")
|
|
|
- public R getAllList()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public R getAllList() {
|
|
|
List<OptionsVO> list = fsUserCourseService.selectFsUserCourseAllList();
|
|
List<OptionsVO> list = fsUserCourseService.selectFsUserCourseAllList();
|
|
|
return R.ok().put("data", list);
|
|
return R.ok().put("data", list);
|
|
|
}
|
|
}
|
|
@@ -286,18 +269,16 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:updateIsShow')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:updateIsShow')")
|
|
|
@Log(title = "课程上架", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程上架", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/updateIsShow")
|
|
@PostMapping("/updateIsShow")
|
|
|
- public AjaxResult updateIsShow(@RequestBody FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult updateIsShow(@RequestBody FsUserCourse fsUserCourse) {
|
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
- return toAjax(1);
|
|
|
|
|
|
|
+ return toAjax(1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicUpdateIsShow')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicUpdateIsShow')")
|
|
|
@Log(title = "课程上架", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程上架", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/publicUpdateIsShow")
|
|
@PostMapping("/publicUpdateIsShow")
|
|
|
- public AjaxResult publicUpdateIsShow(@RequestBody FsUserCourse fsUserCourse)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult publicUpdateIsShow(@RequestBody FsUserCourse fsUserCourse) {
|
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
fsUserCourseService.updateFsUserCourse(fsUserCourse);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
@@ -306,9 +287,8 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:putOn')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:putOn')")
|
|
|
@Log(title = "课程批量上架", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程批量上架", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/putOn/{courseIds}")
|
|
@PostMapping("/putOn/{courseIds}")
|
|
|
- public AjaxResult putOn(@PathVariable Long[] courseIds)
|
|
|
|
|
- {
|
|
|
|
|
- fsUserCourseService.updateFsUserCourseIsShow(courseIds,1);
|
|
|
|
|
|
|
+ public AjaxResult putOn(@PathVariable Long[] courseIds) {
|
|
|
|
|
+ fsUserCourseService.updateFsUserCourseIsShow(courseIds, 1);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
|
}
|
|
}
|
|
@@ -316,9 +296,8 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicPutOn')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicPutOn')")
|
|
|
@Log(title = "课程批量上架", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程批量上架", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/publicPutOn/{courseIds}")
|
|
@PostMapping("/publicPutOn/{courseIds}")
|
|
|
- public AjaxResult publicPutOn(@PathVariable Long[] courseIds)
|
|
|
|
|
- {
|
|
|
|
|
- fsUserCourseService.updateFsUserCourseIsShow(courseIds,1);
|
|
|
|
|
|
|
+ public AjaxResult publicPutOn(@PathVariable Long[] courseIds) {
|
|
|
|
|
+ fsUserCourseService.updateFsUserCourseIsShow(courseIds, 1);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
|
}
|
|
}
|
|
@@ -326,9 +305,8 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:putOn')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:putOn')")
|
|
|
@Log(title = "课程批量下架", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程批量下架", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/pullOff/{courseIds}")
|
|
@PostMapping("/pullOff/{courseIds}")
|
|
|
- public AjaxResult pullOff(@PathVariable Long[] courseIds)
|
|
|
|
|
- {
|
|
|
|
|
- fsUserCourseService.updateFsUserCourseIsShow(courseIds,0);
|
|
|
|
|
|
|
+ public AjaxResult pullOff(@PathVariable Long[] courseIds) {
|
|
|
|
|
+ fsUserCourseService.updateFsUserCourseIsShow(courseIds, 0);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
|
}
|
|
}
|
|
@@ -336,9 +314,8 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicPutOff')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:publicPutOff')")
|
|
|
@Log(title = "课程批量下架", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程批量下架", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/publicPutOff/{courseIds}")
|
|
@PostMapping("/publicPutOff/{courseIds}")
|
|
|
- public AjaxResult publicPutOff(@PathVariable Long[] courseIds)
|
|
|
|
|
- {
|
|
|
|
|
- fsUserCourseService.updateFsUserCourseIsShow(courseIds,0);
|
|
|
|
|
|
|
+ public AjaxResult publicPutOff(@PathVariable Long[] courseIds) {
|
|
|
|
|
+ fsUserCourseService.updateFsUserCourseIsShow(courseIds, 0);
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
return toAjax(1);
|
|
return toAjax(1);
|
|
|
}
|
|
}
|
|
@@ -349,7 +326,7 @@ public class FsUserCourseController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:editConfig')")
|
|
@PreAuthorize("@ss.hasPermi('course:userCourse:editConfig')")
|
|
|
@Log(title = "课程配置", businessType = BusinessType.UPDATE)
|
|
@Log(title = "课程配置", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/editConfig")
|
|
@PostMapping("/editConfig")
|
|
|
- public R editConfig(@RequestBody FsUserCourseConfigParam params){
|
|
|
|
|
|
|
+ public R editConfig(@RequestBody FsUserCourseConfigParam params) {
|
|
|
fsUserCourseService.editConfig(params.getId(), params.getConfigJson());
|
|
fsUserCourseService.editConfig(params.getId(), params.getConfigJson());
|
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
redisCacheUtil.delRedisKey("getCourseList");
|
|
|
redisCacheUtil.delRedisKey("h5user:course:video:list:all");
|
|
redisCacheUtil.delRedisKey("h5user:course:video:list:all");
|
|
@@ -357,4 +334,24 @@ public class FsUserCourseController extends BaseController
|
|
|
redisCacheUtil.delRedisKey("cache:video");
|
|
redisCacheUtil.delRedisKey("cache:video");
|
|
|
return R.ok();
|
|
return R.ok();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 同步课程模板
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('course:userCourseVideo:sync')")
|
|
|
|
|
+ @Log(title = "同步课程模板", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @RepeatSubmit
|
|
|
|
|
+ @PostMapping("/syncTemplate/{courseId}")
|
|
|
|
|
+ public AjaxResult syncTemplate(@PathVariable Long courseId) {
|
|
|
|
|
+ sopTempService.syncTemplate(courseId);
|
|
|
|
|
+ return toAjax(1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 课程下拉列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/selectCourseOptionsList")
|
|
|
|
|
+ public R getCourseList() {
|
|
|
|
|
+ return R.ok().put("data",fsUserCourseService.selectCourseOptionsList());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|