|
@@ -2,6 +2,7 @@ package cn.reghao.tnb.content.app.vod.service;
|
|
|
|
|
|
|
|
import cn.reghao.jutil.jdk.db.PageList;
|
|
import cn.reghao.jutil.jdk.db.PageList;
|
|
|
import cn.reghao.jutil.tool.id.SnowFlake;
|
|
import cn.reghao.jutil.tool.id.SnowFlake;
|
|
|
|
|
+import cn.reghao.tnb.account.api.iface.AccountQuery;
|
|
|
import cn.reghao.tnb.common.auth.UserContext;
|
|
import cn.reghao.tnb.common.auth.UserContext;
|
|
|
import cn.reghao.tnb.content.api.dto.comment.CommentData;
|
|
import cn.reghao.tnb.content.api.dto.comment.CommentData;
|
|
|
import cn.reghao.tnb.content.app.vod.db.mapper.VideoPostMapper;
|
|
import cn.reghao.tnb.content.app.vod.db.mapper.VideoPostMapper;
|
|
@@ -26,8 +27,10 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
public class CommentService {
|
|
public class CommentService {
|
|
|
- @DubboReference(check = false)
|
|
|
|
|
|
|
+ @DubboReference(check = false, retries = 0, timeout = 60_000)
|
|
|
private UserService userService;
|
|
private UserService userService;
|
|
|
|
|
+ @DubboReference(check = false, retries = 0, timeout = 60_000)
|
|
|
|
|
+ private AccountQuery accountQuery;
|
|
|
|
|
|
|
|
private final SnowFlake idGenerator;
|
|
private final SnowFlake idGenerator;
|
|
|
private final UserCommentMongo userCommentMongo;
|
|
private final UserCommentMongo userCommentMongo;
|
|
@@ -42,6 +45,8 @@ public class CommentService {
|
|
|
public void saveComment(CommentSbtDto commentSbtDto) {
|
|
public void saveComment(CommentSbtDto commentSbtDto) {
|
|
|
long commentId = idGenerator.nextId();
|
|
long commentId = idGenerator.nextId();
|
|
|
CommentData commentData = commentSbtDto.getNewComment();
|
|
CommentData commentData = commentSbtDto.getNewComment();
|
|
|
|
|
+ String userIdStr = commentData.getUser().getUserId();
|
|
|
|
|
+ long userId = accountQuery.getUserIdLong(userIdStr);
|
|
|
String postId = commentData.getPostId();
|
|
String postId = commentData.getPostId();
|
|
|
|
|
|
|
|
CommentData parent = commentSbtDto.getParent();
|
|
CommentData parent = commentSbtDto.getParent();
|