|
@@ -4,7 +4,10 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.CrawlerVideoMapper;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.TitleAuditMapper;
|
|
|
+import com.tzld.piaoquan.longarticle.model.dto.AuditContentRequest;
|
|
|
import com.tzld.piaoquan.longarticle.model.po.longarticle.*;
|
|
|
+import com.tzld.piaoquan.longarticle.service.remote.MatchService;
|
|
|
+import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
|
|
|
import com.tzld.piaoquan.longarticle.utils.other.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -31,6 +34,9 @@ public class CrawlerVideoServiceImpl {
|
|
|
@Autowired
|
|
|
private TitleAuditMapper titleAuditMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MatchService matchService;
|
|
|
+
|
|
|
private static final String default_user_id = "69637498";
|
|
|
|
|
|
private static final Double NLP_SIMILARITY_THRESHOLD = 0.55;
|
|
@@ -104,25 +110,18 @@ public class CrawlerVideoServiceImpl {
|
|
|
|
|
|
|
|
|
public boolean uploadCrawlerVideo(MatchVideo matchVideo) {
|
|
|
- boolean b = existUploadCrawlerVideo(matchVideo.getContentId());
|
|
|
- if (b) {
|
|
|
+ if (existUploadCrawlerVideo(matchVideo.getContentId())) {
|
|
|
return true;
|
|
|
}
|
|
|
boolean pushRes = pushOss(matchVideo.getContentId());
|
|
|
if (pushRes) {
|
|
|
- try {
|
|
|
- Random random = new Random();
|
|
|
- int randomInt = random.nextInt(10) + 97;
|
|
|
- // 将随机整数转换为字符
|
|
|
- char auditAccount = (char) randomInt;
|
|
|
- TitleAudit titleAudit = new TitleAudit();
|
|
|
- titleAudit.setContentId(matchVideo.getContentId());
|
|
|
- titleAudit.setFlowPoolLevel(matchVideo.getFlowPoolLevel());
|
|
|
- titleAudit.setAuditAccount(String.valueOf(auditAccount));
|
|
|
- titleAudit.setCreateTimestamp(System.currentTimeMillis());
|
|
|
- titleAuditMapper.insertSelective(titleAudit);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("addCrawlerVideo add titleAudit error", e);
|
|
|
+ AuditContentRequest auditContentRequest = new AuditContentRequest();
|
|
|
+ auditContentRequest.setContentId(matchVideo.getContentId());
|
|
|
+ auditContentRequest.setFlowPoolLevel(matchVideo.getFlowPoolLevel());
|
|
|
+ boolean addAudit = matchService.addAudit(auditContentRequest);
|
|
|
+ if (!addAudit) {
|
|
|
+ LarkRobotUtil.sendMessage("添加审核文章失败 contentId=" + matchVideo.getContentId() +
|
|
|
+ " flowPoolLevel=" + matchVideo.getFlowPoolLevel());
|
|
|
}
|
|
|
}
|
|
|
return pushRes;
|