fix error with user logoff

main
wangqing 8 months ago
parent 0cfe49eb3e
commit 8f953a9b84

@ -194,16 +194,20 @@ public class CommentController extends BaseController {
comment.setHaveThumbup(isExists); //
UserInfo commentUserInfo = userInfoService.findById(comment.getUserId());
CommentResp commentResp = new CommentResp();
BeanUtils.copyProperties(comment,commentResp);
commentResp.setNickName("已注销");
commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if(null != commentUserInfo) {
comment.setNickName(commentUserInfo.getNickName());
comment.setAvatar(getAvatar(commentUserInfo));
commentResp.setNickName(commentUserInfo.getNickName());
commentResp.setAvatar(getAvatar(commentUserInfo));
if(StringUtils.isNotEmpty(comment.getReplyToUserId())){
UserInfo replyToUserInfo = userInfoService.findById(comment.getReplyToUserId());
comment.setReplyToNickname(replyToUserInfo.getNickName());
commentResp.setReplyToNickname(replyToUserInfo.getNickName());
}
}
CommentResp commentResp = new CommentResp();
if (null!= commentUserInfo) {
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
Set<Integer> badgeSet = new HashSet<>();
@ -215,13 +219,17 @@ public class CommentController extends BaseController {
}
}
BeanUtils.copyProperties(comment,commentResp);
if(comment.getCommentCount()>0){
Comment topComment = commentService.findByParentId(comment.get_id(),1,1).getContent().get(0);
UserInfo topCommentUserInfo = userInfoService.findById(topComment.getUserId());
topComment.setNickName(topCommentUserInfo.getNickName());
topComment.setAvatar(getAvatar(topCommentUserInfo));
topComment.setNickName("已注销");
topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if(null != topCommentUserInfo) {
topComment.setNickName(topCommentUserInfo.getNickName());
topComment.setAvatar(getAvatar(topCommentUserInfo));
}
if(StringUtils.isNotEmpty(topComment.getReplyToUserId())){
UserInfo topReplyUserInfo = userInfoService.findById(topComment.getReplyToUserId());
topComment.setReplyToNickname(topReplyUserInfo.getNickName());
@ -259,6 +267,8 @@ public class CommentController extends BaseController {
}
CommentResp commentResp = new CommentResp();
BeanUtils.copyProperties(comment,commentResp);
commentResp.setNickName("已注销");
commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if (null != commentUserInfo) {
commentResp.setNickName(commentUserInfo.getNickName());
commentResp.setAvatar(getAvatar(commentUserInfo));
@ -276,6 +286,8 @@ public class CommentController extends BaseController {
Comment topComment = commentService.findByParentId(comment.get_id(),1,1).getContent().get(0);
UserInfo topCommentUserInfo = userInfoService.findById(topComment.getUserId());
topComment.setNickName("已注销");
topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if(null != topCommentUserInfo) {
topComment.setNickName(topCommentUserInfo.getNickName());
topComment.setAvatar(getAvatar(topCommentUserInfo));

@ -27,6 +27,9 @@ public class CommentMapper {
if (null != userInfoDTO) {
comment.setNickName(userInfoDTO.getNickName());
comment.setAvatar(Constants.RESOURCE_PREFIX + userInfoDTO.getAvatar());
} else {
comment.setNickName("已注销");
comment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
}
return comment;

@ -32,7 +32,7 @@ public class TagS3Service {
public static final String DOT = ".";
public static final String TAG_RESOURCE_PREFIX = "http://cdn1.indie.cn:19000/indie/";
public static final String TAG_RESOURCE_PREFIX = "https://cdn2.indie.cn/indie/";
public static final String TAG_KEY_PREFIX = "tag/";
public static final String BUCKET = "indie";
public static final String TEMP_KEY_PREFIX = "temp/";

Loading…
Cancel
Save