feat: 敏感词检测update

This commit is contained in:
landaiqing
2024-07-20 17:45:35 +08:00
parent c85b345eaf
commit 3cef96fd15
4 changed files with 6 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ public class SchisandraShareSensitiveWordsDTO implements Serializable {
/**
*
*/
private String id;
private Long id;
/**
*

View File

@@ -8,7 +8,6 @@ import com.schisandra.share.common.enums.IsDeletedFlagEnum;
import com.schisandra.share.infra.basic.dao.SchisandraShareSensitiveWordsDao;
import com.schisandra.share.infra.basic.entity.SchisandraShareSensitiveWords;
import com.schisandra.share.infra.basic.entity.table.SchisandraShareSensitiveWordsTableDef;
import com.schisandra.share.infra.basic.service.SchisandraShareSensitiveWordsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
@@ -62,7 +61,7 @@ public class WordContext {
}
}
if (CollectionUtil.isNotEmpty(list)) {
this.addLastId = Long.parseLong(list.get(list.size() - 1).getId());
this.addLastId = list.get(list.size() - 1).getId();
}
initKeyWord(black, white);
if (autoLoad) {
@@ -121,10 +120,9 @@ public class WordContext {
QueryWrapper query = new QueryWrapper();
query.where(SchisandraShareSensitiveWordsTableDef.SCHISANDRA_SHARE_SENSITIVE_WORDS.ID.gt(addLastId).and(SchisandraShareSensitiveWordsTableDef.SCHISANDRA_SHARE_SENSITIVE_WORDS.IS_DELETED.eq(IsDeletedFlagEnum.UN_DELETED.getCode())));
List<SchisandraShareSensitiveWords> list = schisandraShareSensitiveWordsDao.selectListByQuery(query);
if (CollectionUtil.isNotEmpty(list)) {
log.info("addNewWords {}", JSON.toJSON(list));
this.addLastId = Long.parseLong(list.get(list.size() - 1).getId());
this.addLastId = list.get(list.size() - 1).getId();
Set<String> black = new HashSet<>();
Set<String> white = new HashSet<>();
for (SchisandraShareSensitiveWords words : list) {

View File

@@ -16,7 +16,7 @@ public class SchisandraShareSensitiveWordsBO implements Serializable {
/**
*
*/
private String id;
private Long id;
/**
*

View File

@@ -23,8 +23,8 @@ public class SchisandraShareSensitiveWords implements Serializable {
/**
*
*/
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
private String id;
@Id(keyType = KeyType.Auto)
private Long id;
/**
*