|
@@ -7,8 +7,8 @@ import com.tencentcloudapi.common.profile.HttpProfile;
|
|
|
import com.tencentcloudapi.tms.v20201229.TmsClient;
|
|
|
import com.tencentcloudapi.tms.v20201229.models.TextModerationRequest;
|
|
|
import com.tencentcloudapi.tms.v20201229.models.TextModerationResponse;
|
|
|
-import com.tzld.longarticle.recommend.server.model.remote.ArticleSensitive;
|
|
|
-import com.tzld.longarticle.recommend.server.repository.mapper.crawler.CrawlerBaseMapper;
|
|
|
+import com.tzld.longarticle.recommend.server.repository.crawler.ArticleSensitiveRepository;
|
|
|
+import com.tzld.longarticle.recommend.server.repository.entity.crawler.ArticleSensitive;
|
|
|
import com.tzld.longarticle.recommend.server.util.Md5Util;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -23,7 +23,7 @@ import java.util.Objects;
|
|
|
public class ArticleSensitiveRemoteService {
|
|
|
|
|
|
@Autowired
|
|
|
- CrawlerBaseMapper crawlerBaseMapper;
|
|
|
+ ArticleSensitiveRepository articleSensitiveRepository;
|
|
|
|
|
|
@Value("${tecent.cloud.secret.id:AKIDbLGZox42mZaloeIo16zeJrDRUelkbFfw}")
|
|
|
private String tecentCloudSecretId;
|
|
@@ -77,12 +77,13 @@ public class ArticleSensitiveRemoteService {
|
|
|
}
|
|
|
|
|
|
public ArticleSensitive getArticleSensitive(String md5) {
|
|
|
- return crawlerBaseMapper.getArticleSensitiveByKey(md5);
|
|
|
+ return articleSensitiveRepository.getOne(md5);
|
|
|
}
|
|
|
|
|
|
public void insertArticleSensitive(String md5, String title, String sensitive, String label, String subLabel, String response) {
|
|
|
// 插入
|
|
|
- crawlerBaseMapper.insertArticleSensitive(md5, title, sensitive, label, subLabel, response);
|
|
|
+ ArticleSensitive insert = new ArticleSensitive(md5, title, sensitive, label, subLabel, response);
|
|
|
+ articleSensitiveRepository.save(insert);
|
|
|
}
|
|
|
|
|
|
|