Browse Source

Merge branch '过程页配置'

Long 1 week ago
parent
commit
e3c5f3ddc6

+ 16 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseController.java

@@ -8,6 +8,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.utils.ServletUtils;
 import com.fs.course.config.CourseConfig;
+import com.fs.course.params.FsUserCourseConfigParam;
 import com.fs.course.service.IFsUserCourseVideoService;
 import com.fs.course.vo.FsUserCourseListPVO;
 import com.fs.framework.web.service.TokenService;
@@ -341,4 +342,19 @@ public class FsUserCourseController extends BaseController
         redisCacheUtil.delRedisKey("getCourseList");
         return toAjax(1);
     }
+
+    /**
+     * 修改配置
+     **/
+    @PreAuthorize("@ss.hasPermi('course:userCourse:editConfig')")
+    @Log(title = "课程配置", businessType = BusinessType.UPDATE)
+    @PostMapping("/editConfig")
+    public R editConfig(@RequestBody FsUserCourseConfigParam params){
+        fsUserCourseService.editConfig(params.getId(), params.getConfigJson());
+        redisCacheUtil.delRedisKey("getCourseList");
+        redisCacheUtil.delRedisKey("h5user:course:video:list:all");
+        redisCacheUtil.delRedisKey("h5user:course:list:all");
+        redisCacheUtil.delRedisKey("cache:video");
+        return R.ok();
+    }
 }

+ 21 - 0
fs-admin/src/main/java/com/fs/course/params/FsUserCourseConfigParam.java

@@ -0,0 +1,21 @@
+package com.fs.course.params;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@ApiModel("过程页配置参数实体")
+@Data
+public class FsUserCourseConfigParam {
+
+    @NotNull(message = "课程ID不能为空")
+    @ApiModelProperty("课程ID")
+    private Long id;
+
+    @NotBlank(message = "配置信息不能为空")
+    @ApiModelProperty("配置信息")
+    private String configJson;
+}

+ 5 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCourse.java

@@ -152,4 +152,9 @@ public class FsUserCourse extends BaseEntity
     @TableField(exist = false)
     private Long[] companyIdsList;
 
+    /**
+     * 课堂配置
+     */
+    private String configJson;
+
 }

+ 8 - 1
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseMapper.java

@@ -193,7 +193,7 @@ public interface FsUserCourseMapper
 
 
     @Select("select v.video_id,v.title,v.course_id,v.video_url,v.question_bank_id," +
-            "SEC_TO_TIME(c.duration) as total_duration,c.views,c.course_name,c.description,c.img_url " +
+            "SEC_TO_TIME(c.duration) as total_duration,c.views,c.course_name,c.description,c.img_url,c.config_json  " +
             " from fs_user_course_video v " +
             "left join fs_user_course c on v.course_id = c.course_id " +
             "where v.video_id = #{videoId}")
@@ -328,4 +328,11 @@ public interface FsUserCourseMapper
 
     @Select("select course_id,course_name,description,img_url,second_img secondImg,views from fs_user_course where course_id = #{courseId} and is_del = 0")
     List<FsUserCourseVideoAppletVO> selectFsUserCourseVideoAppletListByCourseId(@Param("courseId") Long courseId);
+
+
+    /**
+     * 修改课堂配置
+     */
+    @Update("update fs_user_course set config_json = #{configJson} where course_id = #{id}")
+    void editConfig(@Param("id") Long id, @Param("configJson") String configJson);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/course/service/IFsUserCourseService.java

@@ -13,6 +13,7 @@ import com.fs.course.vo.*;
 import com.fs.course.vo.newfs.FsUserCourseListVO;
 import com.fs.his.vo.OptionsVO;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 
 /**
@@ -134,4 +135,9 @@ public interface IFsUserCourseService
     List<FsUserCourseVideoAppletVO> selectFsUserCourseVideoAppletListByCourseId(Long courseId);
 
     R createAppCourseSortLink(FsCourseLinkCreateParam fsCourseLinkCreateParam);
+
+    /**
+     * 修改课堂配置
+     */
+    void editConfig(Long id, String configJson);
 }

+ 8 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseServiceImpl.java

@@ -762,6 +762,14 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
         return R.error("生成链接失败!");
     }
 
+    /**
+     * 修改课堂配置
+     */
+    @Override
+    public void editConfig(Long id, String configJson) {
+        fsUserCourseMapper.editConfig(id, configJson);
+    }
+
 
     private Graphics2D initializeGraphics(BufferedImage combined) {
         Graphics2D graphics = combined.createGraphics();

+ 5 - 0
fs-service/src/main/java/com/fs/course/vo/FsUserCourseListPVO.java

@@ -52,4 +52,9 @@ public class FsUserCourseListPVO extends BaseEntity
      * 项目名称
      */
     private String projectName;
+
+    /**
+     * 课堂配置
+     */
+    private String configJson;
 }

+ 2 - 2
fs-service/src/main/java/com/fs/course/vo/FsUserCourseVideoH5VO.java

@@ -35,7 +35,7 @@ public class FsUserCourseVideoH5VO extends BaseEntity
     /** 总播放量 */
     private Long views;
 
-
-
+    /** 课堂配置 **/
+    private String configJson;
 
 }

+ 6 - 3
fs-service/src/main/resources/mapper/course/FsUserCourseMapper.xml

@@ -43,11 +43,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isPrivate"    column="is_private"    />
         <result property="secondImg"    column="second_img"    />
         <result property="companyIds"    column="company_ids"    />
-
+        <result property="configJson"    column="config_json"    />
     </resultMap>
 
     <sql id="selectFsUserCourseVo">
-        select course_id,is_private,company_ids,is_next,talent_id,second_img,is_del, cate_id,sub_cate_id, course_name, title, img_url, sort, create_time, update_time, status, is_vip, is_hot, is_show, views, duration, description, hot_ranking, integral, price, sell_price, project, tags, likes, favorite_num, shares, is_auto_play, is_fast, is_best, is_tui, hot_num, is_integral, course_type from fs_user_course
+        select course_id,is_private,company_ids,is_next,talent_id,second_img,is_del, cate_id,sub_cate_id, course_name, title, img_url, sort, create_time, update_time, status, is_vip, is_hot, is_show, views, duration, description, hot_ranking, integral, price, sell_price, project, tags, likes, favorite_num, shares, is_auto_play, is_fast, is_best, is_tui, hot_num, is_integral, course_type, config_json from fs_user_course
     </sql>
 
     <select id="selectFsUserCourseList" parameterType="FsUserCourse" resultMap="FsUserCourseResult">
@@ -86,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isNext != null "> and is_next = #{isNext}</if>
             <if test="isPrivate != null "> and is_private = #{isPrivate}</if>
             <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="configJson != null "> and config_json = #{configJson}</if>
         </where>
     </select>
 
@@ -204,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="secondImg != null">second_img,</if>
             <if test="companyIds != null">company_ids,</if>
             <if test="userId != null">user_id,</if>
+            <if test="configJson != null">config_json,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="cateId != null">#{cateId},</if>
@@ -244,7 +246,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="secondImg != null">#{secondImg},</if>
             <if test="companyIds != null">#{companyIds},</if>
             <if test="userId != null">#{userId},</if>
-         </trim>
+            <if test="configJson != null">config_json = #{configJson},</if>
+        </trim>
     </insert>
 
     <update id="updateFsUserCourse" parameterType="FsUserCourse">