cloudroam
2025-06-06 c9bad2cde85df7eb3dad021cf37ec4e592aa2603
fix:返回id
已修改2个文件
12 ■■■■■ 文件已修改
src/main/java/com/mzl/flower/service/film/CommentService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/film/impl/CommentServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/film/CommentService.java
@@ -68,7 +68,7 @@
     * @param commentDTO
     * @return
     */
    Boolean create(CommentDTO commentDTO);
    CommentDTO create(CommentDTO commentDTO);
    /**
     * 删除评论
src/main/java/com/mzl/flower/service/film/impl/CommentServiceImpl.java
@@ -164,7 +164,7 @@
     * @return
     */
    @Override
    public Boolean create(CommentDTO commentDTO) {
    public CommentDTO create(CommentDTO commentDTO) {
        if (StringUtils.isEmpty(commentDTO.getContent())) {
            throw new ValidationException("评论内容不能为空");
        }
@@ -174,9 +174,13 @@
        commentPo.setState(true);
        commentPo.create(SecurityUtils.getUserId());
        if (commentPoMapper.insert(commentPo) <= 0) {
            throw new ValidationException("添加评论失败");
            CommentDTO commentDTO1 = new CommentDTO();
            return commentDTO1;
//            throw new ValidationException("添加评论失败");
        }
        return true;
        BeanUtils.copyProperties(commentPo, commentDTO);
        commentDTO.setId(commentPo.getId().intValue());
        return commentDTO;
    }
    /**