Commit 195d2a44 authored by 刘基明's avatar 刘基明

查重

parent 72523e22
...@@ -21,9 +21,9 @@ public class ThemeTextCheckService { ...@@ -21,9 +21,9 @@ public class ThemeTextCheckService {
@Resource @Resource
private ThemeCheckDuplicateMapper themeCheckDuplicateMapper; private ThemeCheckDuplicateMapper themeCheckDuplicateMapper;
private final String regex = "[,。!?;;, ]"; private final String regex = "[,。!?;;:, ]";
// 插入
public void insert(String content, String themeId, String userId,Integer themeType) { public void insert(String content, String themeId, String userId,Integer themeType) {
themeCheckDuplicateMapper.deleteByThemeId(themeId); themeCheckDuplicateMapper.deleteByThemeId(themeId);
content = content.replaceAll(regex, "。"); content = content.replaceAll(regex, "。");
...@@ -34,11 +34,12 @@ public class ThemeTextCheckService { ...@@ -34,11 +34,12 @@ public class ThemeTextCheckService {
} }
} }
// 删除
public void deleteByThemeId(String themeId){ public void deleteByThemeId(String themeId){
themeCheckDuplicateMapper.deleteByThemeId(themeId); themeCheckDuplicateMapper.deleteByThemeId(themeId);
} }
public void insert(String themeId, String partition, String partitionHash, Integer num, Integer total,String userId) { private void insert(String themeId, String partition, String partitionHash, Integer num, Integer total,String userId) {
ThemeCheckDuplicateEntity build = ThemeCheckDuplicateEntity.builder() ThemeCheckDuplicateEntity build = ThemeCheckDuplicateEntity.builder()
.themeId(themeId) .themeId(themeId)
...@@ -87,7 +88,7 @@ public class ThemeTextCheckService { ...@@ -87,7 +88,7 @@ public class ThemeTextCheckService {
} }
} }
// 初始化
public void insertInit(String content, String themeId,String userId, LocalDateTime createTime) { public void insertInit(String content, String themeId,String userId, LocalDateTime createTime) {
themeCheckDuplicateMapper.deleteByThemeId(themeId); themeCheckDuplicateMapper.deleteByThemeId(themeId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment