|
@@ -101,8 +101,11 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
int i = this.save(commonRating) ? 0 : 1;
|
|
int i = this.save(commonRating) ? 0 : 1;
|
|
|
// 一次遍历完成分类,避免多次流式处理
|
|
// 一次遍历完成分类,避免多次流式处理
|
|
|
Map<String, List<String>> urlCategoryMap = StoreRenovationRequirementServiceImpl.classifyUrls(Arrays.asList(commonRating.getImageUrls().split(",")));
|
|
Map<String, List<String>> urlCategoryMap = StoreRenovationRequirementServiceImpl.classifyUrls(Arrays.asList(commonRating.getImageUrls().split(",")));
|
|
|
- AiContentModerationUtil.AuditResult auditResult = aiContentModerationUtil.auditContent(commonRating.getContent(), urlCategoryMap.get("image"));
|
|
|
|
|
- if (!auditResult.isPassed() &&( StringUtils.isNotEmpty(commonRating.getContent()) || urlCategoryMap.get("video").size() > 0)) {
|
|
|
|
|
|
|
+ AiContentModerationUtil.AuditResult auditResult = new AiContentModerationUtil.AuditResult(true, "");
|
|
|
|
|
+ if( StringUtils.isNotEmpty(commonRating.getContent()) || urlCategoryMap.get("image").size() > 0){
|
|
|
|
|
+ auditResult = aiContentModerationUtil.auditContent(commonRating.getContent(), urlCategoryMap.get("image"));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!auditResult.isPassed()) {
|
|
|
// 审核不通过
|
|
// 审核不通过
|
|
|
CommonRating rating = this.getById(commonRating.getId());
|
|
CommonRating rating = this.getById(commonRating.getId());
|
|
|
rating.setAuditStatus(2);
|
|
rating.setAuditStatus(2);
|
|
@@ -382,7 +385,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
AtomicReference<Integer> count = new AtomicReference<>(0);
|
|
AtomicReference<Integer> count = new AtomicReference<>(0);
|
|
|
count.updateAndGet(v -> v + collect.size());
|
|
count.updateAndGet(v -> v + collect.size());
|
|
|
// 1.查询评价的评论的记录
|
|
// 1.查询评价的评论的记录
|
|
|
- LambdaQueryWrapper<CommonComment> commentWrapper = new LambdaQueryWrapper<CommonComment>()
|
|
|
|
|
|
|
+/* LambdaQueryWrapper<CommonComment> commentWrapper = new LambdaQueryWrapper<CommonComment>()
|
|
|
.eq(CommonComment::getSourceType, CommentSourceTypeEnum.STORE_COMMENT.getType())
|
|
.eq(CommonComment::getSourceType, CommentSourceTypeEnum.STORE_COMMENT.getType())
|
|
|
.in(CommonComment::getSourceId, collect);
|
|
.in(CommonComment::getSourceId, collect);
|
|
|
List<Long> collect1 = commonCommentMapper.selectList(commentWrapper).stream().map(x -> x.getId()).collect(Collectors.toList());
|
|
List<Long> collect1 = commonCommentMapper.selectList(commentWrapper).stream().map(x -> x.getId()).collect(Collectors.toList());
|
|
@@ -391,7 +394,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
// 2.在再评论的表中查询评论的回复(根评论)
|
|
// 2.在再评论的表中查询评论的回复(根评论)
|
|
|
Integer allCommentsOnCommentsNum = getAllCommentsOnCommentsNum(collect1);
|
|
Integer allCommentsOnCommentsNum = getAllCommentsOnCommentsNum(collect1);
|
|
|
count.updateAndGet(v -> v + allCommentsOnCommentsNum);
|
|
count.updateAndGet(v -> v + allCommentsOnCommentsNum);
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
ratingCount.put("totalCount", count.get());
|
|
ratingCount.put("totalCount", count.get());
|
|
|
|
|
|
|
|
// 3用户图片
|
|
// 3用户图片
|