完善社区模块

This commit is contained in:
苏元皓
2024-09-01 16:55:58 +08:00
parent dda2cdfdc1
commit bde024527f
15 changed files with 352 additions and 106 deletions

View File

@@ -38,46 +38,27 @@ public class CommentController {
/**
* 创建评论接口。
*
* @param content 评论内容
* @param postId 帖子的ID
* @param mentionedUserId 提及的用户ID可选
* @param imageFiles 图片文件(可选)
* @param videoFile 视频文件(可选)
* @return 返回操作结果
*/
@PostMapping("/create")
@Operation(summary = "创建评论")
public Result createComment(@RequestParam("content") String content,
@RequestParam("postId") Long postId,
@RequestParam(value = "postId", required = false) Long postId,
@RequestParam(value = "tutorialId", required = false) Long tutorialId,
@RequestParam(value = "mentionedUserId", required = false) String mentionedUserId,
@RequestParam(value = "imageFiles", required = false) MultipartFile[] imageFiles,
@RequestParam(value = "videoFile", required = false) MultipartFile videoFile) {
@RequestParam(value = "videoFile", required = false) MultipartFile videoFile,
@RequestParam("type") String type) {
logger.info("创建评论请求开始用户ID{}", StpUtil.getLoginIdAsString());
Comment comment = new Comment();
comment.setUserOpenid(StpUtil.getLoginIdAsString());
comment.setPostId(postId);
comment.setContent(content);
comment.setParentCommentId(0l);
comment.setMentionedUserId(mentionedUserId);
if (!isValidCommentType(type)) {
return Result.error("无效的评论类型");
}
Comment comment = createCommentObject(content, postId, tutorialId, mentionedUserId, type);
try {
// 上传视频
if (videoFile != null && !videoFile.isEmpty()) {
String uploadResult = fileService.uploadMinio(videoFile);
comment.setVideoUrl(uploadResult);
}
// 上传图片
if (imageFiles != null && imageFiles.length > 0) {
StringBuilder imageUrls = new StringBuilder();
for (MultipartFile file : imageFiles) {
String uploadResult = fileService.uploadMinio(file);
imageUrls.append(uploadResult + ";");
}
comment.setImageUrls(imageUrls.toString());
}
processFileUploads(comment, imageFiles, videoFile);
} catch (Exception e) {
logger.error("文件上传失败", e);
return Result.error("文件上传失败");
@@ -90,55 +71,34 @@ public class CommentController {
/**
* 回复评论接口。
*
* @param parentCommentId 父评论的ID
* @param postId 帖子的ID
* @param content 回复内容
* @param mentionedUserId 提及的用户ID可选
* @param imageFiles 图片文件(可选)
* @param videoFile 视频文件(可选)
* @return 返回操作结果
*/
@PostMapping("/reply")
@Operation(summary = "回复评论")
public Result replyComment(@RequestParam Long parentCommentId,
@RequestParam Long postId,
@RequestParam String content,
@RequestParam(required = false) String mentionedUserId,
@RequestParam("content") String content,
@RequestParam(value = "postId", required = false) Long postId,
@RequestParam(value = "tutorialId", required = false) Long tutorialId,
@RequestParam(value = "mentionedUserId", required = false) String mentionedUserId,
@RequestParam(value = "imageFiles", required = false) MultipartFile[] imageFiles,
@RequestParam(value = "videoFile", required = false) MultipartFile videoFile) {
@RequestParam(value = "videoFile", required = false) MultipartFile videoFile,
@RequestParam("type") String type) {
logger.info("回复评论请求开始用户ID{}", StpUtil.getLoginIdAsString());
// 检查父评论是否存在
Comment parentComment = commentService.getCommentById(parentCommentId);
if (parentComment == null) {
logger.warn("父评论ID{}不存在", parentCommentId);
return Result.error("父评论不存在");
}
Comment reply = new Comment();
reply.setUserOpenid(StpUtil.getLoginIdAsString());
if (!isValidCommentType(type)) {
return Result.error("无效的评论类型");
}
Comment reply = createCommentObject(content, postId, tutorialId, mentionedUserId, type);
reply.setParentCommentId(parentCommentId);
reply.setPostId(postId);
reply.setContent(content);
reply.setMentionedUserId(mentionedUserId);
try {
// 上传视频
if (videoFile != null && !videoFile.isEmpty()) {
String uploadResult = fileService.uploadMinio(videoFile);
reply.setVideoUrl(uploadResult);
}
// 上传图片
if (imageFiles != null && imageFiles.length > 0) {
StringBuilder imageUrls = new StringBuilder();
for (MultipartFile file : imageFiles) {
String uploadResult = fileService.uploadMinio(file);
imageUrls.append(uploadResult + ";");
}
reply.setImageUrls(imageUrls.toString());
}
processFileUploads(reply, imageFiles, videoFile);
} catch (Exception e) {
logger.error("文件上传失败", e);
return Result.error("文件上传失败");
@@ -149,6 +109,41 @@ public class CommentController {
return Result.ok(reply);
}
// 工具方法:创建评论对象
private Comment createCommentObject(String content, Long postId, Long tutorialId, String mentionedUserId, String type) {
Comment comment = new Comment();
comment.setUserOpenid(StpUtil.getLoginIdAsString());
comment.setContent(content);
comment.setMentionedUserId(mentionedUserId);
if ("post".equals(type)) {
comment.setPostId(postId);
} else if ("tutorial".equals(type)) {
comment.setTutorialId(tutorialId);
}
return comment;
}
// 工具方法:处理文件上传
private void processFileUploads(Comment comment, MultipartFile[] imageFiles, MultipartFile videoFile) throws Exception {
if (videoFile != null && !videoFile.isEmpty()) {
comment.setVideoUrl(fileService.uploadMinio(videoFile));
}
if (imageFiles != null && imageFiles.length > 0) {
StringBuilder imageUrls = new StringBuilder();
for (MultipartFile file : imageFiles) {
imageUrls.append(fileService.uploadMinio(file)).append(";");
}
comment.setImageUrls(imageUrls.toString());
}
}
// 工具方法:校验评论类型
private boolean isValidCommentType(String type) {
return "post".equals(type) || "tutorial".equals(type);
}
/**
* 获取评论详情接口。
*
@@ -216,6 +211,21 @@ public class CommentController {
return Result.ok(comments);
}
/**
* 获取教程下的所有评论。
*
* @param tutorialId 帖子的唯一标识ID
* @return 返回操作结果和评论列表
*/
@PostMapping("/tutorial/{tutorialId}")
@Operation(summary = "获取教程下的所有评论")
public Result getTutorialComments(@PathVariable("tutorialId") Long tutorialId, @RequestBody Pages pages) {
logger.info("获取教程ID{}的评论列表", tutorialId);
logger.info("获取pageSize{}", pages.getPageSize());
IPage<Comment> comments = commentService.getTutorialComments(tutorialId, pages.getPageNum(), pages.getPageSize());
return Result.ok(comments);
}
/**
* 获取评论下的所有回复。
*
@@ -230,35 +240,35 @@ public class CommentController {
return Result.ok(replies);
}
/**
* @评论接口。
*
* @param comment 包含@信息的评论数据
* @return 返回操作结果
*/
@PostMapping("/mention")
@Operation(summary = "@评论")
public Result mentionUser(@RequestBody Comment comment) {
logger.info("用户ID{}提交@评论请求", StpUtil.getLoginIdAsString());
// 检查父评论是否存在如果有父评论ID
if (comment.getParentCommentId() != null) {
Comment parentComment = commentService.getCommentById(comment.getParentCommentId());
if (parentComment == null) {
logger.warn("父评论ID{}不存在", comment.getParentCommentId());
return Result.error("父评论不存在");
}
}
// 检查帖子ID是否存在
if (comment.getPostId() == null) {
logger.warn("帖子ID不能为空");
return Result.error("帖子ID不能为空");
}
comment.setUserOpenid(StpUtil.getLoginIdAsString());
commentService.createComment(comment);
logger.info("@评论创建成功评论ID{}", comment.getCommentId());
return Result.ok();
}
// /**
// * @评论接口。
// *
// * @param comment 包含@信息的评论数据
// * @return 返回操作结果
// */
// @PostMapping("/mention")
// @Operation(summary = "@评论")
// public Result mentionUser(@RequestBody Comment comment) {
// logger.info("用户ID{}提交@评论请求", StpUtil.getLoginIdAsString());
//
// // 检查父评论是否存在如果有父评论ID
// if (comment.getParentCommentId() != null) {
// Comment parentComment = commentService.getCommentById(comment.getParentCommentId());
// if (parentComment == null) {
// logger.warn("父评论ID{}不存在", comment.getParentCommentId());
// return Result.error("父评论不存在");
// }
// }
//
// // 检查帖子ID是否存在
// if (comment.getPostId() == null) {
// logger.warn("帖子ID不能为空");
// return Result.error("帖子ID不能为空");
// }
//
// comment.setUserOpenid(StpUtil.getLoginIdAsString());
// commentService.createComment(comment);
// logger.info("@评论创建成功评论ID{}", comment.getCommentId());
// return Result.ok();
// }
}

View File

@@ -4,7 +4,10 @@ import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.lang.hash.Hash;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ivmiku.tutorial.entity.Pages;
import com.ivmiku.tutorial.entity.Post;
import com.ivmiku.tutorial.entity.Tutorials;
import com.ivmiku.tutorial.response.Result;
import com.ivmiku.tutorial.service.InteractionService;
import io.swagger.v3.oas.annotations.Operation;
@@ -124,10 +127,10 @@ public class InteractionController {
*/
@GetMapping("/getFavoritePosts")
@Operation(summary = "获取用户收藏的帖子")
public Result getFavoritePosts() {
public Result getFavoritePosts(@RequestBody Pages pages) {
String userOpenid = StpUtil.getLoginIdAsString();
log.info("用户 {} 正在获取收藏的帖子", userOpenid);
IPage<Post> favoritePost = interactionService.getFavoritePosts(userOpenid);
IPage<Post> favoritePost = interactionService.getFavoritePosts(userOpenid, pages.getPageNum(), pages.getPageSize());
HashMap<String, Object> data = new HashMap<>();
if (favoritePost != null) {
log.info("用户 {} 收藏的帖子获取成功", userOpenid);
@@ -149,4 +152,75 @@ public class InteractionController {
HashMap<String, Object> res = interactionService.getLikeCount(userOpenid);
return Result.ok();
}
/**
* 对官方教程点赞
* @param tutorialId 教程ID
* @return 操作结果
*/
@PostMapping("/likeOfficialTutorial")
@Operation(summary = "对官方教程点赞")
public Result likeOfficialTutorial(@RequestParam Long tutorialId) {
String userOpenid = StpUtil.getLoginIdAsString();
log.info("用户 {} 正在对官方教程 {} 点赞", userOpenid, tutorialId);
interactionService.likeOfficialTutorial(userOpenid, tutorialId);
return Result.ok();
}
/**
* 收藏官方教程
* @param tutorialId 教程ID
* @return 操作结果
*/
@PostMapping("/favoriteOfficialTutorial")
@Operation(summary = "收藏官方教程")
public Result favoriteOfficialTutorial(@RequestParam Long tutorialId) {
String userOpenid = StpUtil.getLoginIdAsString();
log.info("用户 {} 正在收藏官方教程 {}", userOpenid, tutorialId);
interactionService.favoriteOfficialTutorial(userOpenid, tutorialId);
return Result.ok();
}
/**
* 取消对官方教程的点赞
* @param tutorialId 教程ID
* @return 操作结果
*/
@DeleteMapping("/unlikeOfficialTutorial")
@Operation(summary = "取消对官方教程的点赞")
public Result unlikeOfficialTutorial(@RequestParam Long tutorialId) {
String userOpenid = StpUtil.getLoginIdAsString();
log.info("用户 {} 正在取消对官方教程 {} 的点赞", userOpenid, tutorialId);
interactionService.unlikeOfficialTutorial(userOpenid, tutorialId);
return Result.ok();
}
/**
* 取消收藏官方教程
* @param tutorialId 教程ID
* @return 操作结果
*/
@DeleteMapping("/unfavoriteOfficialTutorial")
@Operation(summary = "取消收藏官方教程")
public Result unfavoriteOfficialTutorial(@RequestParam Long tutorialId) {
String userOpenid = StpUtil.getLoginIdAsString();
log.info("用户 {} 正在取消收藏官方教程 {}", userOpenid, tutorialId);
interactionService.unfavoriteOfficialTutorial(userOpenid, tutorialId);
return Result.ok();
}
/**
* 获取用户收藏的官方教程
* @return 用户收藏的官方教程列表
*/
@GetMapping("/getFavoriteOfficialTutorials")
@Operation(summary = "获取用户收藏的官方教程")
public Result getFavoriteOfficialTutorials(@RequestBody Pages pages) {
String userOpenid = StpUtil.getLoginIdAsString();
log.info("用户 {} 正在获取收藏的官方教程", userOpenid);
IPage<Tutorials> favoriteTutorials = interactionService.getFavoriteOfficialTutorials(userOpenid, pages.getPageNum(), pages.getPageSize());
HashMap<String, Object> data = new HashMap<>();
data.put("list", favoriteTutorials);
return Result.ok(data);
}
}

View File

@@ -221,6 +221,23 @@ public class PostController {
return Result.ok(history);
}
/**
* 删除用户的搜索历史
*/
@DeleteMapping("/deleteSearchHistory")
@Operation(summary = "删除用户的搜索历史")
public Result deleteSearchHistory() {
String userId = StpUtil.getLoginIdAsString(); // 获取当前登录用户的ID
String key = "search_history:" + userId;
// 删除Redis中的搜索历史
redisTemplate.delete(key);
logger.info("用户ID{}的搜索历史已删除", userId);
return Result.ok("搜索历史已删除");
}
/**
* 根据关键字搜索帖子,包括标题和内容
*/

View File

@@ -21,6 +21,8 @@ public class Comment implements Serializable {
private Long postId;
private Long tutorialId; // 新增字段
private String content;
private Long parentCommentId;

View File

@@ -22,5 +22,7 @@ public class Favorite implements Serializable {
private Integer isDeleted;
private Long tutorialId; // 新增字段
private static final long serialVersionUID = 1L;
}

View File

@@ -20,6 +20,8 @@ public class Likee implements Serializable {
private Long commentId;
private Long tutorialId; // 新增字段
private Integer isDeleted;
private static final long serialVersionUID = 1L;

View File

@@ -68,5 +68,5 @@ public interface CommentService extends IService<Comment> {
void createReply(Long parentCommentId, Long postId, String content, String mentionedUserId);
IPage<Comment> getTutorialComments(Long tutorialId, Integer pageNum, Integer pageSize);
}

View File

@@ -2,6 +2,7 @@ package com.ivmiku.tutorial.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ivmiku.tutorial.entity.Post;
import com.ivmiku.tutorial.entity.Tutorials;
import java.util.HashMap;
import java.util.List;
@@ -17,7 +18,17 @@ public interface InteractionService {
void likeComment(String userOpenid, Long commentId);
void unlikeComment(String userOpenid, Long commentId);
IPage<Post> getFavoritePosts(String userOpenid);
IPage<Post> getFavoritePosts(String userOpenid, int pageNum, int pageSize);
HashMap<String, Object> getLikeCount(String userOpenid);
void likeOfficialTutorial(String userOpenid, Long tutorialId);
void favoriteOfficialTutorial(String userOpenid, Long tutorialId);
void unlikeOfficialTutorial(String userOpenid, Long tutorialId);
void unfavoriteOfficialTutorial(String userOpenid, Long tutorialId);
IPage<Tutorials> getFavoriteOfficialTutorials(String userOpenid, int pageNum, int pageSize);
}

View File

@@ -15,4 +15,6 @@ public interface TutorialsService extends IService<Tutorials> {
void createTutorial(Tutorials tutorial);
List<Tutorials> getTutorialsByTagId(Long tagId);
List<Tutorials> getTutorialsByIds(List<Long> tutorialIds);
}

View File

@@ -190,4 +190,27 @@ public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> impl
logger.info("评论回复成功评论ID{}", reply.getCommentId());
}
@Override
public IPage<Comment> getTutorialComments(Long tutorialId, Integer pageNum, Integer pageSize) {
logger.info("开始获取帖子ID{}的评论列表,第{}页,每页{}条", tutorialId, pageNum, pageSize);
// 设置分页参数
// PageHelper.startPage(pageNum, pageSize);
IPage<Comment> page = new Page<>(pageNum, pageSize);
// 查询评论
LambdaQueryWrapper<Comment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Comment::getTutorialId, tutorialId).eq(Comment::getIsDeleted, 0);
IPage<Comment> comments = commentMapper.selectPage(page, wrapper);
if (comments != null) {
logger.info("获取教程ID{}的评论列表成功", tutorialId);
} else {
logger.warn("教程ID{}的评论列表为空", tutorialId);
}
// 使用 PageInfo 包装结果
return comments;
}
}

View File

@@ -3,18 +3,22 @@ package com.ivmiku.tutorial.service.impl;
import cn.hutool.core.lang.hash.Hash;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ivmiku.tutorial.entity.Favorite;
import com.ivmiku.tutorial.entity.Likee;
import com.ivmiku.tutorial.entity.Post;
import com.ivmiku.tutorial.entity.Tutorials;
import com.ivmiku.tutorial.mapper.FavoriteMapper;
import com.ivmiku.tutorial.mapper.LikeMapper;
import com.ivmiku.tutorial.service.InteractionService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ivmiku.tutorial.service.PostService;
import com.ivmiku.tutorial.service.TutorialsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -34,6 +38,9 @@ public class InteractionServiceImpl implements InteractionService {
@Resource
private PostService postService;
@Resource
private TutorialsService tutorialService;
@Override
public void favoritePost(String userOpenid, Long postId) {
log.info("User {} is favoriting post {}", userOpenid, postId);
@@ -107,13 +114,13 @@ public class InteractionServiceImpl implements InteractionService {
}
@Override
public IPage<Post> getFavoritePosts(String userOpenid) {
public IPage<Post> getFavoritePosts(String userOpenid, int pageNum, int pageSize) {
LambdaQueryWrapper<Favorite> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Favorite::getUserOpenid, userOpenid);
List<Favorite> favorites = favoriteMapper.selectList(wrapper);
if (favorites != null && !favorites.isEmpty()) {
List<Long> postIds = favorites.stream().map(Favorite::getPostId).toList();
return postService.getPostList(userOpenid, 1, 10);
return postService.getPostList(userOpenid, pageNum, pageSize);
}
return null;
}
@@ -157,8 +164,91 @@ public class InteractionServiceImpl implements InteractionService {
} else {
res.put("favoriteCount", 0L); // 如果为空设置为0
}
Long myTotalPost = getFavoritePosts(userOpenid).getTotal();
res.put("myTotalPost", myTotalPost);
return res;
}
@Override
public void likeOfficialTutorial(String userOpenid, Long tutorialId) {
log.info("User {} is liking tutorial {}", userOpenid, tutorialId);
Likee likee = new Likee();
likee.setUserOpenid(userOpenid);
likee.setTutorialId(tutorialId);
likee.setIsDeleted(0);
likeMapper.insert(likee);
}
@Override
public void favoriteOfficialTutorial(String userOpenid, Long tutorialId) {
log.info("User {} is favoriting tutorial {}", userOpenid, tutorialId);
Favorite favorite = new Favorite();
favorite.setUserOpenid(userOpenid);
favorite.setTutorialId(tutorialId);
favorite.setIsDeleted(0);
favoriteMapper.insert(favorite);
}
@Override
public void unlikeOfficialTutorial(String userOpenid, Long tutorialId) {
log.info("User {} is unliking tutorial {}", userOpenid, tutorialId);
QueryWrapper<Likee> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_openid", userOpenid)
.eq("tutorial_id", tutorialId)
.eq("is_deleted", 0);
Likee likee = likeMapper.selectOne(queryWrapper);
if (likee != null) {
likee.setIsDeleted(1);
likeMapper.updateById(likee);
}
}
@Override
public void unfavoriteOfficialTutorial(String userOpenid, Long tutorialId) {
log.info("User {} is unfavoriting tutorial {}", userOpenid, tutorialId);
QueryWrapper<Favorite> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_openid", userOpenid)
.eq("tutorial_id", tutorialId)
.eq("is_deleted", 0);
Favorite favorite = favoriteMapper.selectOne(queryWrapper);
if (favorite != null) {
favorite.setIsDeleted(1);
favoriteMapper.updateById(favorite);
}
}
@Override
public IPage<Tutorials> getFavoriteOfficialTutorials(String userOpenid, int pageNum, int pageSize) {
// 创建分页对象
IPage<Favorite> page = new Page<>(pageNum, pageSize);
// 创建查询条件,筛选出用户收藏的且未被删除的教程
LambdaQueryWrapper<Favorite> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Favorite::getUserOpenid, userOpenid)
.isNotNull(Favorite::getTutorialId) // 确保教程ID不为空
.eq(Favorite::getIsDeleted, 0); // 只获取未删除的收藏记录
// 分页查询收藏的教程ID
IPage<Favorite> favoritePage = favoriteMapper.selectPage(page, wrapper);
// 提取出所有收藏的教程ID
List<Long> tutorialIds = favoritePage.getRecords().stream()
.map(Favorite::getTutorialId)
.toList();
if (tutorialIds.isEmpty()) {
return new Page<>(); // 如果没有收藏记录,返回空的分页对象
}
// 通过教程ID列表查询对应的教程实体并将分页结果映射到教程分页
List<Tutorials> tutorials = tutorialService.getTutorialsByIds(tutorialIds);
// 创建一个新的分页对象,用于返回教程数据
IPage<Tutorials> tutorialPage = new Page<>(pageNum, pageSize);
tutorialPage.setRecords(tutorials);
tutorialPage.setTotal(favoritePage.getTotal()); // 设置总记录数
return tutorialPage;
}
}

View File

@@ -31,6 +31,16 @@ public class TutorialsServiceImpl extends ServiceImpl<TutorialsMapper, Tutorials
return tutorialsMapper.selectList(queryWrapper);
}
@Override
public List<Tutorials> getTutorialsByIds(List<Long> tutorialIds) {
if (tutorialIds != null && !tutorialIds.isEmpty()) {
QueryWrapper<Tutorials> queryWrapper = new QueryWrapper<>();
queryWrapper.in("tutorial_id", tutorialIds);
return tutorialsMapper.selectList(queryWrapper);
}
return null;
}
@Override
public void createTutorial(Tutorials tutorial) {
this.save(tutorial);

View File

@@ -8,6 +8,7 @@
<id property="commentId" column="comment_id" jdbcType="BIGINT"/>
<result property="userOpenid" column="user_openid" jdbcType="VARCHAR"/>
<result property="postId" column="post_id" jdbcType="BIGINT"/>
<result property="tutorialId" column="tutorialId" jdbcType="BIGINT"/>
<result property="content" column="content" jdbcType="VARCHAR"/>
<result property="parentCommentId" column="parent_comment_id" jdbcType="BIGINT"/>
<result property="isDeleted" column="is_deleted" jdbcType="TINYINT"/>
@@ -19,7 +20,7 @@
</resultMap>
<sql id="Base_Column_List">
comment_id, user_openid, post_id, content,
comment_id, user_openid, post_id, tutorialId, content,
parent_comment_id, is_deleted, created_at, updated_at,
mentioned_user_id, image_urls, video_url
</sql>

View File

@@ -8,11 +8,12 @@
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="userOpenid" column="user_openid" jdbcType="VARCHAR"/>
<result property="postId" column="post_id" jdbcType="BIGINT"/>
<result property="tutorialId" column="tutorialId" jdbcType="BIGINT"/>
<result property="isDeleted" column="is_deleted" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id,user_openid,post_id,
id,user_openid, post_id, tutorialId,
is_deleted
</sql>
</mapper>

View File

@@ -8,12 +8,13 @@
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="userOpenid" column="user_openid" jdbcType="VARCHAR"/>
<result property="postId" column="post_id" jdbcType="BIGINT"/>
<result property="tutorialId" column="tutorialId" jdbcType="BIGINT"/>
<result property="commentId" column="comment_id" jdbcType="BIGINT"/>
<result property="isDeleted" column="is_deleted" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id,user_openid,post_id,
id,user_openid,post_id,tutorialId,
comment_id,is_deleted
</sql>
</mapper>