数据层 增加评论数据; 修改帖子评论数量; 业务层 处理添加评论的业务; 先增加评论、在更新帖子的评论数量; 表现层 处理添加评论数据的请求; 设置添加评论的表单。 1.1 CommentMapper.java package com.nowcoder.community.dao; import com.nowcoder.community.entity.Comment; import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper public interface CommentMapper { List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset, int limit); int selectCountByEntity(int entityType, int entityId); int insertComment(Comment comment); } 1.2...