提交 5e8d1b75 作者: yanxin

手动新增数据可选择是否需要判重处理

上级 74b47ee7
...@@ -330,6 +330,9 @@ public class InformationController { ...@@ -330,6 +330,9 @@ public class InformationController {
displayInfo.setContent(Jsoup.parse(contentWithTag).text()); displayInfo.setContent(Jsoup.parse(contentWithTag).text());
} }
Integer category = (Integer) jsonObject.get("category"); Integer category = (Integer) jsonObject.get("category");
//判断是否需要判重
Integer isDuplicate = jsonObject.getInteger("isDuplicate");
if (isDuplicate == null || isDuplicate == 1) {
boolean modelFlag = pythonUtil.judgeDuplicate(displayInfo.getId(), displayInfo.getTitle(), displayInfo.getContent(), displayInfo.getSourceAddress(), displayInfo.getSubjectId()); boolean modelFlag = pythonUtil.judgeDuplicate(displayInfo.getId(), displayInfo.getTitle(), displayInfo.getContent(), displayInfo.getSourceAddress(), displayInfo.getSubjectId());
if (modelFlag) { if (modelFlag) {
return Result.FAIL(210, "判重存在重复资讯!"); return Result.FAIL(210, "判重存在重复资讯!");
...@@ -339,6 +342,7 @@ public class InformationController { ...@@ -339,6 +342,7 @@ public class InformationController {
return Result.FAIL(211, "专题库存在重复资讯!"); return Result.FAIL(211, "专题库存在重复资讯!");
} }
} }
}
informationService.add(displayInfo, category, userVo); informationService.add(displayInfo, category, userVo);
return Result.OK(); return Result.OK();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论