|
@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.Base64;
|
|
|
import java.util.Objects;
|
|
@@ -35,8 +36,8 @@ public class ArticleSensitiveRemoteService {
|
|
|
boolean isSensitive = false;
|
|
|
String md5 = Md5Util.encoderByMd5(title);
|
|
|
ArticleSensitive articleSensitive = getArticleSensitive(md5);
|
|
|
- if (Objects.nonNull(articleSensitive)) {
|
|
|
- if ("Pass".equals(articleSensitive.getSensitive())
|
|
|
+ if (Objects.nonNull(articleSensitive) && StringUtils.hasText(articleSensitive.getSensitiveSuggestion())) {
|
|
|
+ if ("Pass".equals(articleSensitive.getSensitiveSuggestion())
|
|
|
|| ("Polity".equals(articleSensitive.getLabel()) && "ForeignLeader".equals(articleSensitive.getSubLabel()))) {
|
|
|
return false;
|
|
|
} else {
|
|
@@ -77,12 +78,12 @@ public class ArticleSensitiveRemoteService {
|
|
|
}
|
|
|
|
|
|
public ArticleSensitive getArticleSensitive(String md5) {
|
|
|
- return articleSensitiveRepository.getOne(md5);
|
|
|
+ return articleSensitiveRepository.findById(md5).orElse(null);
|
|
|
}
|
|
|
|
|
|
- public void insertArticleSensitive(String md5, String title, String sensitive, String label, String subLabel, String response) {
|
|
|
+ public void insertArticleSensitive(String md5, String title, String sensitiveSuggestion, String label, String subLabel, String response) {
|
|
|
// 插入
|
|
|
- ArticleSensitive insert = new ArticleSensitive(md5, title, sensitive, label, subLabel, response);
|
|
|
+ ArticleSensitive insert = new ArticleSensitive(md5, title, sensitiveSuggestion, label, subLabel, response);
|
|
|
articleSensitiveRepository.save(insert);
|
|
|
}
|
|
|
|