소스 검색

销售端代码提交

yuhongqi 1 주 전
부모
커밋
f0296d3132

+ 19 - 0
fs-live-app/src/main/java/com/fs/app/controller/AppBaseController.java

@@ -2,11 +2,16 @@ package com.fs.app.controller;
 
 
 import com.fs.app.utils.JwtUtils;
+import com.fs.common.constant.HttpStatus;
+import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.ServletUtils;
+import com.github.pagehelper.PageInfo;
 import io.jsonwebtoken.Claims;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.util.List;
+
 
 public class AppBaseController {
 	@Autowired
@@ -19,4 +24,18 @@ public class AppBaseController {
 		String userId = claims.getSubject().toString();
 		return userId;
 	}
+
+	/**
+	 * 响应请求分页数据
+	 */
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	protected TableDataInfo getDataTable(List<?> list)
+	{
+		TableDataInfo rspData = new TableDataInfo();
+		rspData.setCode(HttpStatus.SUCCESS);
+		rspData.setMsg("查询成功");
+		rspData.setRows(list);
+		rspData.setTotal(new PageInfo(list).getTotal());
+		return rspData;
+	}
 }

+ 3 - 3
fs-live-app/src/main/java/com/fs/app/controller/LiveController.java

@@ -7,6 +7,7 @@ import com.fs.app.vo.LiveInfoVo;
 import com.fs.app.vo.LiveVo;
 import com.fs.common.core.domain.BaseEntity;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.utils.bean.BeanUtils;
 import com.fs.live.domain.Live;
 import com.fs.live.domain.LiveMsg;
@@ -77,9 +78,8 @@ public class LiveController extends AppBaseController {
 	@ApiOperation("直播间列表")
 	@GetMapping("/liveList")
 	@ApiResponse(code = 200, message = "", response = LiveInfoVo.class)
-	public R liveList() {
-		List<Live> list = liveService.liveList();
-		return R.ok().put("data", list);
+	public TableDataInfo liveList() {
+		return getDataTable(liveService.liveList());
 	}
 
 

+ 3 - 2
fs-live-app/src/main/java/com/fs/app/controller/UserController.java

@@ -230,7 +230,7 @@ public class UserController extends AppBaseController {
 		// 根据手机号查询用户
 		FsUser user = findUserByPhone(param.getPhone());
 		if (user == null) {
-			createNewUser(param);
+			user = createNewUser(param);
 			//return R.ok().put("isNew",true).put("phone",encryptPhone(param.getPhone()));
 		} else {
 			if (user.getUnionId()==null){
@@ -281,7 +281,7 @@ public class UserController extends AppBaseController {
 		return user;
 	}
 
-	private void createNewUser(FsUserLoginParam param) {
+	private FsUser createNewUser(FsUserLoginParam param) {
 		FsUser newUser = new FsUser();
 		newUser.setLoginDevice(param.getLoginDevice() != null ? param.getLoginDevice() : null);
 		newUser.setSource(param.getSource() != null ? param.getSource() : null );
@@ -294,6 +294,7 @@ public class UserController extends AppBaseController {
 			newUser.setJpushId(param.getJpushId());
 		}*/
 		userService.insertFsUser(newUser);
+		return newUser;
 	}
 
 	//

+ 3 - 4
fs-live-app/src/main/java/com/fs/app/websocket/service/WebSocketServer.java

@@ -2,6 +2,7 @@ package com.fs.app.websocket.service;
 
 
 import com.alibaba.fastjson.JSONObject;
+import com.fs.app.config.ProductionWordFilter;
 import com.fs.app.websocket.auth.WebSocketConfigurator;
 import com.fs.app.websocket.bean.SendMsgVo;
 import com.fs.common.core.domain.R;
@@ -14,12 +15,10 @@ import com.fs.his.service.IFsUserService;
 import com.fs.live.domain.LiveData;
 import com.fs.live.domain.LiveMsg;
 import com.fs.live.domain.LiveWatchUser;
-import com.fs.live.service.ILiveDataService;
-import com.fs.live.service.ILiveMsgService;
-import com.fs.live.service.ILiveService;
-import com.fs.live.service.ILiveWatchUserService;
+import com.fs.live.service.*;
 import com.fs.live.vo.LiveWatchUserVO;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -75,6 +75,6 @@ public interface LiveMapper extends BaseMapper<Live>
      */
     public int deleteLiveByLiveIds(Long[] liveIds);
 
-    @Select("select * from live where status = 2 and is_show=1 and is_del = 0")
+    @Select("select * from live where status = 2 and is_show=1 and is_del != 1")
     List<Live> liveList();
 }

+ 13 - 7
fs-service/src/main/java/com/fs/live/mapper/LiveSensitiveWordsMapper.java

@@ -6,14 +6,14 @@ import com.fs.live.domain.LiveSensitiveWords;
 
 /**
  * 直播间敏感词过滤Mapper接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface LiveSensitiveWordsMapper extends BaseMapper<LiveSensitiveWords>{
     /**
      * 查询直播间敏感词过滤
-     * 
+     *
      * @param wordId 直播间敏感词过滤主键
      * @return 直播间敏感词过滤
      */
@@ -21,7 +21,7 @@ public interface LiveSensitiveWordsMapper extends BaseMapper<LiveSensitiveWords>
 
     /**
      * 查询直播间敏感词过滤列表
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 直播间敏感词过滤集合
      */
@@ -29,7 +29,7 @@ public interface LiveSensitiveWordsMapper extends BaseMapper<LiveSensitiveWords>
 
     /**
      * 新增直播间敏感词过滤
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface LiveSensitiveWordsMapper extends BaseMapper<LiveSensitiveWords>
 
     /**
      * 修改直播间敏感词过滤
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface LiveSensitiveWordsMapper extends BaseMapper<LiveSensitiveWords>
 
     /**
      * 删除直播间敏感词过滤
-     * 
+     *
      * @param wordId 直播间敏感词过滤主键
      * @return 结果
      */
@@ -53,9 +53,15 @@ public interface LiveSensitiveWordsMapper extends BaseMapper<LiveSensitiveWords>
 
     /**
      * 批量删除直播间敏感词过滤
-     * 
+     *
      * @param wordIds 需要删除的数据主键集合
      * @return 结果
      */
     int deleteLiveSensitiveWordsByWordIds(Long[] wordIds);
+
+    /**
+     * 查询所有敏感词
+     * @return
+     */
+    List<String> selectAllWords();
 }

+ 12 - 7
fs-service/src/main/java/com/fs/live/service/ILiveSensitiveWordsService.java

@@ -6,14 +6,14 @@ import com.fs.live.domain.LiveSensitiveWords;
 
 /**
  * 直播间敏感词过滤Service接口
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
 public interface ILiveSensitiveWordsService extends IService<LiveSensitiveWords>{
     /**
      * 查询直播间敏感词过滤
-     * 
+     *
      * @param wordId 直播间敏感词过滤主键
      * @return 直播间敏感词过滤
      */
@@ -21,7 +21,7 @@ public interface ILiveSensitiveWordsService extends IService<LiveSensitiveWords>
 
     /**
      * 查询直播间敏感词过滤列表
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 直播间敏感词过滤集合
      */
@@ -29,7 +29,7 @@ public interface ILiveSensitiveWordsService extends IService<LiveSensitiveWords>
 
     /**
      * 新增直播间敏感词过滤
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface ILiveSensitiveWordsService extends IService<LiveSensitiveWords>
 
     /**
      * 修改直播间敏感词过滤
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface ILiveSensitiveWordsService extends IService<LiveSensitiveWords>
 
     /**
      * 批量删除直播间敏感词过滤
-     * 
+     *
      * @param wordIds 需要删除的直播间敏感词过滤主键集合
      * @return 结果
      */
@@ -53,9 +53,14 @@ public interface ILiveSensitiveWordsService extends IService<LiveSensitiveWords>
 
     /**
      * 删除直播间敏感词过滤信息
-     * 
+     *
      * @param wordId 直播间敏感词过滤主键
      * @return 结果
      */
     int deleteLiveSensitiveWordsByWordId(Long wordId);
+
+    /**
+     * 查询所有敏感词
+     */
+    List<String> selectAllWords();
 }

+ 13 - 7
fs-service/src/main/java/com/fs/live/service/impl/LiveSensitiveWordsServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fs.live.service.impl;
 
+import java.util.Collections;
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +11,7 @@ import com.fs.live.service.ILiveSensitiveWordsService;
 
 /**
  * 直播间敏感词过滤Service业务层处理
- * 
+ *
  * @author fs
  * @date 2025-07-08
  */
@@ -19,7 +20,7 @@ public class LiveSensitiveWordsServiceImpl extends ServiceImpl<LiveSensitiveWord
 
     /**
      * 查询直播间敏感词过滤
-     * 
+     *
      * @param wordId 直播间敏感词过滤主键
      * @return 直播间敏感词过滤
      */
@@ -31,7 +32,7 @@ public class LiveSensitiveWordsServiceImpl extends ServiceImpl<LiveSensitiveWord
 
     /**
      * 查询直播间敏感词过滤列表
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 直播间敏感词过滤
      */
@@ -43,7 +44,7 @@ public class LiveSensitiveWordsServiceImpl extends ServiceImpl<LiveSensitiveWord
 
     /**
      * 新增直播间敏感词过滤
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 结果
      */
@@ -55,7 +56,7 @@ public class LiveSensitiveWordsServiceImpl extends ServiceImpl<LiveSensitiveWord
 
     /**
      * 修改直播间敏感词过滤
-     * 
+     *
      * @param liveSensitiveWords 直播间敏感词过滤
      * @return 结果
      */
@@ -67,7 +68,7 @@ public class LiveSensitiveWordsServiceImpl extends ServiceImpl<LiveSensitiveWord
 
     /**
      * 批量删除直播间敏感词过滤
-     * 
+     *
      * @param wordIds 需要删除的直播间敏感词过滤主键
      * @return 结果
      */
@@ -79,7 +80,7 @@ public class LiveSensitiveWordsServiceImpl extends ServiceImpl<LiveSensitiveWord
 
     /**
      * 删除直播间敏感词过滤信息
-     * 
+     *
      * @param wordId 直播间敏感词过滤主键
      * @return 结果
      */
@@ -88,4 +89,9 @@ public class LiveSensitiveWordsServiceImpl extends ServiceImpl<LiveSensitiveWord
     {
         return baseMapper.deleteLiveSensitiveWordsByWordId(wordId);
     }
+
+    @Override
+    public List<String> selectAllWords() {
+        return baseMapper.selectAllWords();
+    }
 }

+ 10 - 6
fs-service/src/main/resources/mapper/live/LiveSensitiveWordsMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fs.live.mapper.LiveSensitiveWordsMapper">
-    
+
     <resultMap type="LiveSensitiveWords" id="LiveSensitiveWordsResult">
         <result property="wordId"    column="word_id"    />
         <result property="word"    column="word"    />
@@ -16,17 +16,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectLiveSensitiveWordsList" parameterType="LiveSensitiveWords" resultMap="LiveSensitiveWordsResult">
         <include refid="selectLiveSensitiveWordsVo"/>
-        <where>  
+        <where>
             <if test="word != null  and word != ''"> and word = #{word}</if>
             <if test="createdAt != null "> and created_at = #{createdAt}</if>
         </where>
     </select>
-    
+
     <select id="selectLiveSensitiveWordsByWordId" parameterType="Long" resultMap="LiveSensitiveWordsResult">
         <include refid="selectLiveSensitiveWordsVo"/>
         where word_id = #{wordId}
     </select>
-        
+
     <insert id="insertLiveSensitiveWords" parameterType="LiveSensitiveWords" useGeneratedKeys="true" keyProperty="wordId">
         insert into live_sensitive_words
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -53,9 +53,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteLiveSensitiveWordsByWordIds" parameterType="String">
-        delete from live_sensitive_words where word_id in 
+        delete from live_sensitive_words where word_id in
         <foreach item="wordId" collection="array" open="(" separator="," close=")">
             #{wordId}
         </foreach>
     </delete>
-</mapper>
+
+    <select id="selectAllWords"  resultType="string">
+        select word from live_sensitive_words
+    </select>
+</mapper>