| | |
| | | import cn.lili.common.security.AuthUser; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.sensitive.SensitiveWordsFilter; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import cn.lili.modules.lmk.enums.general.VideoCommentStatusEnum; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.VideoComment; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result comment(VideoCommentForm form) { |
| | | // 监测内容是否包含敏感词 |
| | | if (SensitiveWordsFilter.includeSentenceWord(form.getCommentContent())) { |
| | |
| | | entity.setUserAvatar(currentUser.getFace()); |
| | | |
| | | baseMapper.insert(entity); |
| | | if (StringUtils.isBlank(entity.getReplyId())) { |
| | | // 不是回复评论,那么就是主评论,主评论的masterId设置为自己的id |
| | | entity.setMasterCommentId(entity.getId()); |
| | | } |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("添加成功"); |
| | | return Result.ok("添加成功").data(this.detail(entity.getId()).get("data")); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (StringUtils.isNotBlank(query.getMasterCommentId())) { |
| | | // 加载子评论的情况 |
| | | baseMapper.replyCommentPage(page, query); |
| | | return Result.ok().data(page.getRecords()); |
| | | } else { |
| | | // 加载主评论的情况。主评论id = masterCommentId |
| | | baseMapper.masterCommentPage(page, query); |
| | | } |
| | | return Result.ok().data(page.getRecords()); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<CollectTypeNumVO> countNumGroupByVideo() { |
| | | return baseMapper.countNumGroupByVideo(); |
| | | } |
| | | } |