修复id异常

This commit is contained in:
禾几海
2020-08-04 22:25:20 +08:00
parent c6a97e4c5b
commit 8e8a7c809d

View File

@@ -59,7 +59,7 @@ public class CommentServiceImpl implements CommentService {
Comment comment = new Comment(); Comment comment = new Comment();
comment.setFromUser(user); comment.setFromUser(user);
User userTo = new User(); User userTo = new User();
userTo.setId(-1L); userTo.setId(null);
if (reqBody.getToUserId() != -1) { if (reqBody.getToUserId() != -1) {
userTo = userMapper.findById(reqBody.getToUserId()); userTo = userMapper.findById(reqBody.getToUserId());
comment.setToUser(userTo); comment.setToUser(userTo);