Browse Source

添加日志

master
jianjun 5 years ago
parent
commit
bc05301fc8
  1. 20
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  2. 12
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

20
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -225,14 +225,18 @@ public class ArticleController {
@Async
public void scanContent(TokenDto tokenDto,String draftId){
SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId);
if (syncScanResult == null) {
log.error("scanContent draftId:{} return result null", draftId);
}
if (syncScanResult.isAllPass()) {
articleService.scanAllPassPublishArticle(tokenDto, draftId);
} else {
articleService.updateAuditStatusFailById(draftId, syncScanResult);
try {
SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId);
if (syncScanResult == null) {
log.error("scanContent draftId:{} return result null", draftId);
}
if (syncScanResult.isAllPass()) {
articleService.scanAllPassPublishArticle(tokenDto, draftId);
} else {
articleService.updateAuditStatusFailById(draftId, syncScanResult);
}
} catch (Exception e) {
log.error("scanContent exception draftId:{} return result null", e);
}
}

12
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -951,10 +951,17 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
SyncScanResult imgSyncScanResult = null;
SyncScanResult textSyncScanResult = null;
if(!CollectionUtils.isEmpty(imgScanParamDTO.getTasks())){
log.info("scanContent imgScanParamDTO:{}", JSON.toJSONString(imgScanParamDTO));
imgSyncScanResult = ScanContentUtils.imgSyncScan(scanApiHost.concat(imgSyncScanMethod), imgScanParamDTO);
log.info("scanContent imgSyncScanResult:{}", JSON.toJSONString(imgSyncScanResult));
}
if(!CollectionUtils.isEmpty(textScanParamDTO.getTasks())){
log.info("scanContent textScanParamDTO:{}", JSON.toJSONString(textScanParamDTO));
imgSyncScanResult = ScanContentUtils.imgSyncScan(scanApiHost.concat(imgSyncScanMethod), imgScanParamDTO);
textSyncScanResult = ScanContentUtils.textSyncScan(scanApiHost.concat(textSyncScanMethod), textScanParamDTO);
textSyncScanResult = ScanContentUtils.textSyncScan(scanApiHost.concat(textSyncScanMethod), textScanParamDTO);
log.info("scanContent textSyncScanResult:{}", JSON.toJSONString(textSyncScanResult));
}
result = new SyncScanResult();
if (imgSyncScanResult.isAllPass()) {
@ -972,6 +979,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
this.sendMsg(draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL);
}
log.error("scanContent result", JSON.toJSONString(result));
return result;
}
@Override

Loading…
Cancel
Save