From 3970ced88b5b456f03fe277c254ca761f05492e0 Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期四, 26 十月 2023 14:00:12 +0800 Subject: [PATCH] 直播是否发布门户 --- src/main/java/com/qxueyou/scc/operation/topic/action/StuTopicController.java | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/operation/topic/action/StuTopicController.java b/src/main/java/com/qxueyou/scc/operation/topic/action/StuTopicController.java index 3c6470d..28f4dfd 100644 --- a/src/main/java/com/qxueyou/scc/operation/topic/action/StuTopicController.java +++ b/src/main/java/com/qxueyou/scc/operation/topic/action/StuTopicController.java @@ -1,6 +1,7 @@ package com.qxueyou.scc.operation.topic.action; +import com.qxueyou.scc.Sensitive.SensitiveWordFilter; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -354,7 +355,9 @@ @GetMapping(value = "addComment") public Result addComment(String content, String commentObjectId, String commentParentId, String commentedId, String commentedName) { - return topicService.addComment(content, commentObjectId, commentParentId, commentedId, commentedName); + SensitiveWordFilter.loadWordFromFile("D:\\宸ヤ綔\\SensitiveWord\\SensitiveWordList.txt"); + String filter = SensitiveWordFilter.Filter(content); + return topicService.addComment(filter, commentObjectId, commentParentId, commentedId, commentedName); } /** -- Gitblit v1.8.0