فهرست منبع

Merge remote-tracking branch 'origin/master'

zyp 1 هفته پیش
والد
کامیت
34c4d24618

+ 12 - 1
fs-admin/src/main/java/com/fs/web/controller/system/SysDictDataController.java

@@ -26,7 +26,7 @@ import com.fs.system.service.ISysDictTypeService;
 
 
 /**
 /**
  * 数据字典信息
  * 数据字典信息
- * 
+ *
 
 
  */
  */
 @RestController
 @RestController
@@ -117,4 +117,15 @@ public class SysDictDataController extends BaseController
         dictDataService.deleteDictDataByIds(dictCodes);
         dictDataService.deleteDictDataByIds(dictCodes);
         return success();
         return success();
     }
     }
+
+
+    /**
+     * 不分页获取列表
+     */
+    @GetMapping("/allList")
+    public AjaxResult allList(SysDictData dictData) {
+        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
+        return AjaxResult.success(list);
+    }
+
 }
 }

+ 151 - 0
fs-admin/src/main/java/com/fs/web/controller/system/SysKeywordController.java

@@ -0,0 +1,151 @@
+package com.fs.web.controller.system;
+
+import com.fs.common.annotation.Log;
+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.redis.RedisCache;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.system.domain.SysKeyword;
+import com.fs.system.service.ISysKeywordService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.PostConstruct;
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 系统关键字Controller
+ *
+ * @author fs
+ * @date 2025-05-14
+ */
+@RestController
+@RequestMapping("/system/keyword")
+public class SysKeywordController extends BaseController
+{
+    @Autowired
+    private ISysKeywordService sysKeywordService;
+
+    @Autowired
+    RedisCache redisCache;
+
+    @Autowired
+    public RedisTemplate<String,String> redisTemplate;
+
+    private static final String REDIS_KEY = "sys:keywords";
+
+    /**
+     * 查询系统关键字列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:keyword:list')")
+    @GetMapping("/list")
+    public R list(SysKeyword sysKeyword)
+    {
+//        startPage();
+        PageHelper.startPage(sysKeyword.getPageNum(), sysKeyword.getPageSize());
+        List<SysKeyword> list = sysKeywordService.selectSysKeywordList(sysKeyword);
+
+        PageInfo<SysKeyword> pageInfo = new PageInfo<>(list);
+        Map<String, Object> result = new HashMap<>();
+        result.put("rows", pageInfo.getList());
+        result.put("total", pageInfo.getTotal());
+        return R.ok(result);
+    }
+
+    /**
+     * 导出系统关键字列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:keyword:export')")
+    @Log(title = "系统关键字", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(SysKeyword sysKeyword)
+    {
+        List<SysKeyword> list = sysKeywordService.selectSysKeywordList(sysKeyword);
+        ExcelUtil<SysKeyword> util = new ExcelUtil<SysKeyword>(SysKeyword.class);
+        return util.exportExcel(list, "系统关键字数据");
+    }
+
+    /**
+     * 获取系统关键字详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:keyword:query')")
+    @GetMapping(value = "/{keywordId}")
+    public AjaxResult getInfo(@PathVariable("keywordId") Long keywordId)
+    {
+        return AjaxResult.success(sysKeywordService.selectSysKeywordById(keywordId));
+    }
+
+    /**
+     * 新增系统关键字
+     */
+    @PreAuthorize("@ss.hasPermi('system:keyword:add')")
+    @Log(title = "系统关键字", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysKeyword sysKeyword)
+    {
+        int i = sysKeywordService.insertSysKeyword(sysKeyword);
+        // 缓存
+        redisTemplate.opsForSet().add(REDIS_KEY, sysKeyword.getKeyword());
+        return toAjax(i);
+    }
+
+    /**
+     * 修改系统关键字
+     */
+    @PreAuthorize("@ss.hasPermi('system:keyword:edit')")
+    @Log(title = "系统关键字", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysKeyword sysKeyword)
+    {
+        //获取之前的数据
+        SysKeyword sysKeywordOld = sysKeywordService.selectSysKeywordById(sysKeyword.getKeywordId());
+        String keywordOld = sysKeywordOld.getKeyword();
+        int i = sysKeywordService.updateSysKeyword(sysKeyword);
+        // 更新缓存
+        redisTemplate.opsForSet().remove(REDIS_KEY, keywordOld);
+        redisTemplate.opsForSet().add(REDIS_KEY, sysKeyword.getKeyword());
+        return toAjax(i);
+    }
+
+    /**
+     * 删除系统关键字
+     */
+    @PreAuthorize("@ss.hasPermi('system:keyword:remove')")
+    @Log(title = "系统关键字", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{keywordIds}")
+    public AjaxResult remove(@PathVariable Long[] keywordIds)
+    {
+        List<SysKeyword> sysKeywords = sysKeywordService.selectSysKeywordByIds(keywordIds);
+        int i = sysKeywordService.deleteSysKeywordByIds(keywordIds);
+        if (!CollectionUtils.isEmpty(sysKeywords)) {
+            redisTemplate.opsForSet().remove(REDIS_KEY, sysKeywords.stream().map(SysKeyword::getKeyword).toArray(String[]::new));
+        }
+        return toAjax(i);
+    }
+
+    /**
+     * 启动加载全部关键字到缓存
+     */
+    @PostConstruct
+    public void initKeywords() {
+        SysKeyword sysKeywordParam = new SysKeyword();
+        List<SysKeyword> sysKeywords = sysKeywordService.selectSysKeywordList(sysKeywordParam);
+        List<String> keywords = sysKeywords.stream()
+                .map(SysKeyword::getKeyword)
+                .collect(Collectors.toList());
+
+        if (!keywords.isEmpty()) {
+            redisTemplate.opsForSet().add(REDIS_KEY, keywords.toArray(new String[0]));
+        }
+        System.out.println("加载全部关键字到缓存");
+    }
+}

+ 42 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchCommentServiceImpl.java

@@ -1,13 +1,22 @@
 package com.fs.course.service.impl;
 package com.fs.course.service.impl;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.course.param.FsCourseWatchCommentListParam;
 import com.fs.course.param.FsCourseWatchCommentListParam;
 import com.fs.course.param.FsCourseWatchCommentSaveParam;
 import com.fs.course.param.FsCourseWatchCommentSaveParam;
 import com.fs.course.vo.FsCourseWatchCommentVO;
 import com.fs.course.vo.FsCourseWatchCommentVO;
+import com.fs.qw.mapper.QwExternalContactMapper;
+import com.fs.system.domain.SysKeyword;
+import com.fs.system.mapper.SysKeywordMapper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.fs.course.mapper.FsCourseWatchCommentMapper;
 import com.fs.course.mapper.FsCourseWatchCommentMapper;
 import com.fs.course.domain.FsCourseWatchComment;
 import com.fs.course.domain.FsCourseWatchComment;
@@ -22,6 +31,20 @@ import com.fs.course.service.IFsCourseWatchCommentService;
 @Service
 @Service
 public class FsCourseWatchCommentServiceImpl extends ServiceImpl<FsCourseWatchCommentMapper, FsCourseWatchComment> implements IFsCourseWatchCommentService {
 public class FsCourseWatchCommentServiceImpl extends ServiceImpl<FsCourseWatchCommentMapper, FsCourseWatchComment> implements IFsCourseWatchCommentService {
 
 
+    private static final String REDIS_KEY = "sys:keywords";
+
+    @Autowired
+    RedisCache redisCache;
+
+    @Autowired
+    private QwExternalContactMapper qwExternalContactMapper;
+
+    @Autowired
+    public RedisTemplate<String,String> redisTemplate;
+
+    @Autowired
+    private SysKeywordMapper mapper;
+
     /**
     /**
      * 查询看课评论
      * 查询看课评论
      *
      *
@@ -98,12 +121,29 @@ public class FsCourseWatchCommentServiceImpl extends ServiceImpl<FsCourseWatchCo
 
 
     @Override
     @Override
     public R saveH5CourseWatchComment(FsCourseWatchCommentSaveParam param) {
     public R saveH5CourseWatchComment(FsCourseWatchCommentSaveParam param) {
+        // 需求:查询是否包含关键字,包含则不保存,并且需要将用户标记为黑名单;
+        Set<String>  keywords = redisTemplate.opsForSet().members(REDIS_KEY);
+        if(keywords == null || keywords.isEmpty()){
+            SysKeyword sysKeywordParam = new SysKeyword();
+            List<SysKeyword> sysKeywords = mapper.selectSysKeywordList(sysKeywordParam);
+            keywords = sysKeywords.stream().map(SysKeyword::getKeyword).collect(Collectors.toSet());
+        }
+        if (keywords.isEmpty()) {
+            return R.ok().put("status", true);
+        }
+        for (String keyword : keywords) {
+            if (param.getContent().contains(keyword)) {
+                //标记用户为黑名单
+                qwExternalContactMapper.updateQwExternalContactByFsUserId(1, param.getUserId());
+                return R.ok().put("status", false);
+            }
+        }
         FsCourseWatchComment fsCourseWatchComment = new FsCourseWatchComment();
         FsCourseWatchComment fsCourseWatchComment = new FsCourseWatchComment();
         BeanUtils.copyProperties(param, fsCourseWatchComment);
         BeanUtils.copyProperties(param, fsCourseWatchComment);
         fsCourseWatchComment.setCreateTime(DateUtils.getNowDate());
         fsCourseWatchComment.setCreateTime(DateUtils.getNowDate());
         int i = baseMapper.insertFsCourseWatchComment(fsCourseWatchComment);
         int i = baseMapper.insertFsCourseWatchComment(fsCourseWatchComment);
-        if (i > 0){
-            return R.ok();
+        if (i > 0) {
+            return R.ok().put("status", true);
         } else {
         } else {
             return R.error();
             return R.error();
         }
         }

+ 3 - 0
fs-service/src/main/java/com/fs/course/vo/FsCourseWatchCommentVO.java

@@ -16,6 +16,9 @@ public class FsCourseWatchCommentVO{
     @ApiModelProperty(value = "用户id")
     @ApiModelProperty(value = "用户id")
     private Long userId;
     private Long userId;
 
 
+    @ApiModelProperty(value = "用户名称")
+    private String nickName;
+
     @ApiModelProperty(value = "用户类型,1-管理员,2-用户")
     @ApiModelProperty(value = "用户类型,1-管理员,2-用户")
     private Integer userType;
     private Integer userType;
 
 

+ 3 - 0
fs-service/src/main/java/com/fs/qw/domain/QwExternalContact.java

@@ -121,4 +121,7 @@ public class QwExternalContact extends BaseEntity
 
 
     private Integer lastWatchTime;
     private Integer lastWatchTime;
 
 
+    //看课评论状态,1-拉黑;0-正常
+    private Integer commentStatus;
+
 }
 }

+ 4 - 0
fs-service/src/main/java/com/fs/qw/mapper/QwExternalContactMapper.java

@@ -366,4 +366,8 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
 
 
     @Select("select * from qw_external_contact where fs_user_id = #{fsUserId}")
     @Select("select * from qw_external_contact where fs_user_id = #{fsUserId}")
     List<QwExternalContact> selectQwExternalContactListVOByfsUserId(Long fsUserId);
     List<QwExternalContact> selectQwExternalContactListVOByfsUserId(Long fsUserId);
+
+    @Update("update qw_external_contact set comment_status = #{commentStatus} where fs_user_id = #{fsUserId}")
+    int updateQwExternalContactByFsUserId(@Param("commentStatus") Integer commentStatus, @Param("fsUserId")Long fsUserId);
+
 }
 }

+ 48 - 0
fs-service/src/main/java/com/fs/system/domain/SysKeyword.java

@@ -0,0 +1,48 @@
+package com.fs.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 系统关键字对象 sys_keyword
+ *
+ * @author fs
+ * @date 2025-05-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SysKeyword extends BaseEntity{
+
+    @TableField(exist = false)
+    private Integer pageNum;
+
+    @TableField(exist = false)
+    private Integer pageSize;
+
+    /** 关键字id */
+    private Long keywordId;
+
+    /** 关键字 */
+    @Excel(name = "关键字")
+    private String keyword;
+
+//    /** 类型:1-看课弹幕; */
+//    @Excel(name = "类型:1-看课弹幕;")
+//    private Integer type;
+
+    /** 所属公司 */
+    @Excel(name = "所属公司")
+    private Long companyId;
+
+    @TableField(exist = false)
+    @Excel(name = "类型名称")
+    private String typeName;
+
+    @TableField(exist = false)
+    @Excel(name = "公司名称")
+    private String companyName;
+
+}

+ 65 - 0
fs-service/src/main/java/com/fs/system/mapper/SysKeywordMapper.java

@@ -0,0 +1,65 @@
+package com.fs.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.system.domain.SysKeyword;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 系统关键字Mapper接口
+ *
+ * @author fs
+ * @date 2025-05-14
+ */
+public interface SysKeywordMapper extends BaseMapper<SysKeyword>{
+    /**
+     * 查询系统关键字
+     *
+     * @param keywordId 系统关键字主键
+     * @return 系统关键字
+     */
+    SysKeyword selectSysKeywordById(Long keywordId);
+
+    /**
+     * 查询系统关键字列表
+     *
+     * @param sysKeyword 系统关键字
+     * @return 系统关键字集合
+     */
+    List<SysKeyword> selectSysKeywordList(SysKeyword sysKeyword);
+
+    /**
+     * 新增系统关键字
+     *
+     * @param sysKeyword 系统关键字
+     * @return 结果
+     */
+    int insertSysKeyword(SysKeyword sysKeyword);
+
+    /**
+     * 修改系统关键字
+     *
+     * @param sysKeyword 系统关键字
+     * @return 结果
+     */
+    int updateSysKeyword(SysKeyword sysKeyword);
+
+    /**
+     * 删除系统关键字
+     *
+     * @param keywordId 系统关键字主键
+     * @return 结果
+     */
+    int deleteSysKeywordById(Long keywordId);
+
+    /**
+     * 批量删除系统关键字
+     *
+     * @param keywordIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteSysKeywordByIds(@Param("keywordIds") Long[] keywordIds);
+
+    List<SysKeyword> selectSysKeywordByIds(@Param("keywordIds") Long[] keywordIds);
+}

+ 69 - 0
fs-service/src/main/java/com/fs/system/service/ISysKeywordService.java

@@ -0,0 +1,69 @@
+package com.fs.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.system.domain.SysKeyword;
+
+import java.util.List;
+
+/**
+ * 系统关键字Service接口
+ *
+ * @author fs
+ * @date 2025-05-14
+ */
+public interface ISysKeywordService extends IService<SysKeyword>{
+    /**
+     * 查询系统关键字
+     *
+     * @param keywordId 系统关键字主键
+     * @return 系统关键字
+     */
+    SysKeyword selectSysKeywordById(Long keywordId);
+
+    /**
+     * 查询系统关键字列表
+     *
+     * @param sysKeyword 系统关键字
+     * @return 系统关键字集合
+     */
+    List<SysKeyword> selectSysKeywordList(SysKeyword sysKeyword);
+
+    /**
+     * 新增系统关键字
+     *
+     * @param sysKeyword 系统关键字
+     * @return 结果
+     */
+    int insertSysKeyword(SysKeyword sysKeyword);
+
+    /**
+     * 修改系统关键字
+     *
+     * @param sysKeyword 系统关键字
+     * @return 结果
+     */
+    int updateSysKeyword(SysKeyword sysKeyword);
+
+    /**
+     * 批量删除系统关键字
+     *
+     * @param keywordIds 需要删除的系统关键字主键集合
+     * @return 结果
+     */
+    int deleteSysKeywordByIds(Long[] keywordIds);
+
+    /**
+     * 删除系统关键字信息
+     *
+     * @param keywordId 系统关键字主键
+     * @return 结果
+     */
+    int deleteSysKeywordById(Long keywordId);
+
+    /**
+     * 查询指定ids的关键字
+     * @param keywordIds
+     * @return
+     */
+    List<SysKeyword> selectSysKeywordByIds(Long[] keywordIds);
+}

+ 98 - 0
fs-service/src/main/java/com/fs/system/service/impl/SysKeywordServiceImpl.java

@@ -0,0 +1,98 @@
+package com.fs.system.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.DateUtils;
+import com.fs.system.domain.SysKeyword;
+import com.fs.system.mapper.SysKeywordMapper;
+import com.fs.system.service.ISysKeywordService;
+import org.springframework.stereotype.Service;
+import java.util.List;
+
+/**
+ * 系统关键字Service业务层处理
+ *
+ * @author fs
+ * @date 2025-05-14
+ */
+@Service
+public class SysKeywordServiceImpl extends ServiceImpl<SysKeywordMapper, SysKeyword> implements ISysKeywordService {
+
+    /**
+     * 查询系统关键字
+     *
+     * @param keywordId 系统关键字主键
+     * @return 系统关键字
+     */
+    @Override
+    public SysKeyword selectSysKeywordById(Long keywordId)
+    {
+        return baseMapper.selectSysKeywordById(keywordId);
+    }
+
+    /**
+     * 查询系统关键字列表
+     *
+     * @param sysKeyword 系统关键字
+     * @return 系统关键字
+     */
+    @Override
+    public List<SysKeyword> selectSysKeywordList(SysKeyword sysKeyword)
+    {
+        return baseMapper.selectSysKeywordList(sysKeyword);
+    }
+
+    /**
+     * 新增系统关键字
+     *
+     * @param sysKeyword 系统关键字
+     * @return 结果
+     */
+    @Override
+    public int insertSysKeyword(SysKeyword sysKeyword)
+    {
+        sysKeyword.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertSysKeyword(sysKeyword);
+    }
+
+    /**
+     * 修改系统关键字
+     *
+     * @param sysKeyword 系统关键字
+     * @return 结果
+     */
+    @Override
+    public int updateSysKeyword(SysKeyword sysKeyword)
+    {
+        sysKeyword.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateSysKeyword(sysKeyword);
+    }
+
+    /**
+     * 批量删除系统关键字
+     *
+     * @param keywordIds 需要删除的系统关键字主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysKeywordByIds(Long[] keywordIds)
+    {
+        return baseMapper.deleteSysKeywordByIds(keywordIds);
+    }
+
+    /**
+     * 删除系统关键字信息
+     *
+     * @param keywordId 系统关键字主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysKeywordById(Long keywordId)
+    {
+        return baseMapper.deleteSysKeywordById(keywordId);
+    }
+
+    @Override
+    public List<SysKeyword> selectSysKeywordByIds(Long[] keywordIds) {
+        return baseMapper.selectSysKeywordByIds(keywordIds);
+    }
+}

+ 5 - 3
fs-service/src/main/resources/mapper/course/FsCourseWatchCommentMapper.xml

@@ -98,11 +98,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
     </delete>
 
 
     <select id="selectH5CourseWatchComments" resultType="com.fs.course.vo.FsCourseWatchCommentVO">
     <select id="selectH5CourseWatchComments" resultType="com.fs.course.vo.FsCourseWatchCommentVO">
-        select comment_id, user_id, user_type, course_id, video_id, type, content, create_time from fs_course_watch_comment
+        select cwc.comment_id, cwc.user_id, cwc.user_type, cwc.course_id, cwc.video_id, cwc.type, cwc.content, cwc.create_time,
+        fs_user.nick_name from fs_course_watch_comment cwc
+        left join fs_user on fs_user.user_id = cwc.user_id
         <where>
         <where>
-           and is_revoke = 0
+           and cwc.is_revoke = 0
         </where>
         </where>
-        order by create_time desc
+        order by cwc.create_time desc
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 92 - 0
fs-service/src/main/resources/mapper/system/SysKeywordMapper.xml

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.system.mapper.SysKeywordMapper">
+
+    <resultMap type="SysKeyword" id="SysKeywordResult">
+        <result property="keywordId"    column="keyword_id"    />
+        <result property="keyword"    column="keyword"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectSysKeyword">
+        select keyword_id, keyword, company_id, create_time, update_time from sys_keyword
+    </sql>
+
+    <sql id="selectSysKeywordVo">
+        SELECT
+            keyword_id,
+            keyword,
+            sys_keyword.company_id,
+            sys_keyword.create_time,
+            sys_keyword.update_time,
+            company.company_name
+        FROM
+            sys_keyword
+                LEFT JOIN company ON company.company_id = sys_keyword.company_id
+    </sql>
+
+    <select id="selectSysKeywordList" parameterType="SysKeyword" resultMap="SysKeywordResult">
+        <include refid="selectSysKeywordVo"/>
+        <where>
+            <if test="keyword != null  and keyword != ''"> and keyword like concat('%', #{keyword}, '%')</if>
+            <if test="companyId != null "> and sys_keyword.company_id = #{companyId}</if>
+        </where>
+    </select>
+
+    <select id="selectSysKeywordById" parameterType="Long" resultMap="SysKeywordResult">
+        <include refid="selectSysKeywordVo"/>
+        where keyword_id = #{keywordId}
+    </select>
+
+    <insert id="insertSysKeyword" parameterType="SysKeyword" useGeneratedKeys="true" keyProperty="keywordId">
+        insert into sys_keyword
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="keyword != null">keyword,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="keyword != null">#{keyword},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSysKeyword" parameterType="SysKeyword">
+        update sys_keyword
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="keyword != null">keyword = #{keyword},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where keyword_id = #{keywordId}
+    </update>
+
+    <delete id="deleteSysKeywordById" parameterType="Long">
+        delete from sys_keyword where keyword_id = #{keywordId}
+    </delete>
+
+    <delete id="deleteSysKeywordByIds" parameterType="String">
+        delete from sys_keyword where keyword_id in
+        <foreach item="keywordId" collection="keywordIds" open="(" separator="," close=")">
+            #{keywordId}
+        </foreach>
+    </delete>
+
+
+    <select id="selectSysKeywordByIds" parameterType="Long" resultMap="SysKeywordResult">
+        <include refid="selectSysKeyword"/>
+        where keyword_id in
+        <foreach item="keywordId" collection="keywordIds" open="(" separator="," close=")">
+            #{keywordId}
+        </foreach>
+    </select>
+
+</mapper>

+ 43 - 0
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
 import com.fs.app.annotation.Login;
 import com.fs.app.annotation.Login;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.ResponseResult;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.StringUtils;
@@ -22,6 +23,7 @@ import com.github.pagehelper.PageInfo;
 import io.jsonwebtoken.Claims;
 import io.jsonwebtoken.Claims;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.Synchronized;
 import lombok.Synchronized;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -76,6 +78,9 @@ public class CourseController extends  AppBaseController{
     @Autowired
     @Autowired
     private CachingOperationNameGenerator cachingOperationNameGenerator;
     private CachingOperationNameGenerator cachingOperationNameGenerator;
 
 
+    @Autowired
+    private IFsCourseWatchCommentService courseWatchCommentService;
+
 
 
     @Cacheable(value="getCourseCate" )
     @Cacheable(value="getCourseCate" )
     @ApiOperation("获取分类")
     @ApiOperation("获取分类")
@@ -516,4 +521,42 @@ public class CourseController extends  AppBaseController{
 
 
 //        courseVideoService.updateVideoUrl();
 //        courseVideoService.updateVideoUrl();
     }
     }
+
+    @Login
+    @ApiOperation("保存评论数据")
+    @PostMapping("/saveMsg")
+    public R saveMsg(@RequestBody FsCourseWatchCommentSaveParam param)
+    {
+        param.setUserId(Long.parseLong(getUserId()));
+        return courseWatchCommentService.saveH5CourseWatchComment(param);
+    }
+
+    @Login
+    @ApiOperation("撤销评论")
+    @PutMapping("/revokeMsg")
+    public R revokeMsg(@ApiParam(value = "评论id", required = true) @RequestParam Long commentId)
+    {
+        return courseWatchCommentService.revokeH5CourseWatchComment(commentId);
+    }
+
+    @ApiOperation("获取历史评论数据")
+    @GetMapping("/getComments")
+    public ResponseResult<PageInfo<FsCourseWatchCommentVO>> getCourseWatchComments(@ApiParam(value = "页码", required = true) @RequestParam Integer pageNum,
+            @ApiParam(value = "每页大小", required = true) @RequestParam Integer pageSize)
+    {
+        //获取配置信息中需要查询的数据条数
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+
+        FsCourseWatchCommentListParam param = new FsCourseWatchCommentListParam();
+        param.setPageNum(pageNum);
+        param.setPageSize(pageSize);
+//        param.setListNum(config.getViewCommentNum() != null &&  config.getViewCommentNum() != 0 ? config.getViewCommentNum() : 200);
+
+        PageHelper.startPage(pageNum, pageSize);
+        List<FsCourseWatchCommentVO> list = courseWatchCommentService.selectH5CourseWatchComments(param);
+        PageInfo<FsCourseWatchCommentVO> pageInfo = new PageInfo<>(list);
+        return ResponseResult.ok(pageInfo);
+    }
+
 }
 }

+ 0 - 51
fs-user-app/src/main/java/com/fs/app/controller/CourseH5Controller.java

@@ -2,27 +2,21 @@ package com.fs.app.controller;
 
 
 
 
 import cn.hutool.json.JSONUtil;
 import cn.hutool.json.JSONUtil;
-import com.fs.app.annotation.Login;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.R;
-import com.fs.common.core.domain.ResponseResult;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.*;
 import com.fs.course.domain.*;
 import com.fs.course.param.*;
 import com.fs.course.param.*;
 import com.fs.course.service.*;
 import com.fs.course.service.*;
 import com.fs.course.vo.*;
 import com.fs.course.vo.*;
 import com.fs.system.service.ISysConfigService;
 import com.fs.system.service.ISysConfigService;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
-import java.util.List;
 
 
 @Api("h5课堂接口")
 @Api("h5课堂接口")
 @RestController
 @RestController
@@ -43,10 +37,6 @@ public class CourseH5Controller extends  AppBaseController{
     @Autowired
     @Autowired
     private IFsCourseWatchLogService courseWatchLogService;
     private IFsCourseWatchLogService courseWatchLogService;
 
 
-    @Autowired
-    private IFsCourseWatchCommentService courseWatchCommentService;
-
-
     @ApiOperation("h5课程简介")
     @ApiOperation("h5课程简介")
     @GetMapping("/getH5CourseByVideoId")
     @GetMapping("/getH5CourseByVideoId")
     public R getCourseByVideoId(@RequestParam("videoId") Long videoId,HttpServletRequest request)
     public R getCourseByVideoId(@RequestParam("videoId") Long videoId,HttpServletRequest request)
@@ -126,45 +116,4 @@ public class CourseH5Controller extends  AppBaseController{
     public void getErrMsg(@RequestParam("msg") String msg) {
     public void getErrMsg(@RequestParam("msg") String msg) {
         logger.error("zyp \n【h5看课中途报错】:{}",msg);
         logger.error("zyp \n【h5看课中途报错】:{}",msg);
     }
     }
-
-    @Login
-    @ApiOperation("保存评论数据")
-    @PostMapping("/saveMsg")
-    public R saveMsg(@RequestBody FsCourseWatchCommentSaveParam param)
-    {
-//        param.setUserId(Long.parseLong(getUserId()));
-        return courseWatchCommentService.saveH5CourseWatchComment(param);
-    }
-
-    @Login
-    @ApiOperation("撤销评论")
-    @PutMapping("/revokeMsg")
-    public R revokeMsg(@ApiParam(value = "评论id", required = true) @RequestParam Long commentId)
-    {
-        return courseWatchCommentService.revokeH5CourseWatchComment(commentId);
-    }
-
-    @ApiOperation("获取历史评论数据")
-    @GetMapping("/getComments")
-    public ResponseResult<PageInfo<FsCourseWatchCommentVO>> getCourseWatchComments(@ApiParam(value = "页码", required = true) @RequestParam Integer pageNum,
-                                                 @ApiParam(value = "每页大小", required = true) @RequestParam Integer pageSize)
-    {
-        //获取配置信息中需要查询的数据条数
-        String json = configService.selectConfigByKey("course.config");
-        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
-
-        FsCourseWatchCommentListParam param = new FsCourseWatchCommentListParam();
-        param.setPageNum(pageNum);
-        param.setPageSize(pageSize);
-        param.setListNum(config.getViewCommentNum() != null &&  config.getViewCommentNum() != 0 ? config.getViewCommentNum() : 200);
-
-        PageHelper.startPage(pageNum, pageSize);
-        List<FsCourseWatchCommentVO> list = courseWatchCommentService.selectH5CourseWatchComments(param);
-        PageInfo<FsCourseWatchCommentVO> pageInfo = new PageInfo<>(list);
-        return ResponseResult.ok(pageInfo);
-    }
-
-
-
-
 }
 }

+ 1 - 2
fs-user-app/src/main/java/com/fs/websocket/service/WebSocketServer.java

@@ -1,7 +1,6 @@
 package com.fs.websocket.service;
 package com.fs.websocket.service;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.StringUtils;
@@ -75,7 +74,7 @@ public class WebSocketServer {
                     break;
                     break;
                 case "sendMsg":
                 case "sendMsg":
                     // 分发消息
                     // 分发消息
-                    sendMessageToAll(JSONObject.toJSONString(R.ok().put("data", msg)));
+                    sendMessageToAll(JSONObject.toJSONString(msg));
                     break;
                     break;
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {