fix commentList nickName with emoji

main
wangqing 8 months ago
parent 25ed14277d
commit 18193e93f7

@ -200,7 +200,7 @@ public class CommentController extends BaseController {
commentResp.setNickName("已注销"); commentResp.setNickName("已注销");
commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL); commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if(null != commentUserInfo) { if(null != commentUserInfo) {
commentResp.setNickName(EmojiConverterUtil.encode(commentUserInfo.getNickName())); commentResp.setNickName(commentUserInfo.getNickName());
commentResp.setAvatar(getAvatar(commentUserInfo)); commentResp.setAvatar(getAvatar(commentUserInfo));
if(StringUtils.isNotEmpty(comment.getReplyToUserId())){ if(StringUtils.isNotEmpty(comment.getReplyToUserId())){
UserInfo replyToUserInfo = userInfoService.findById(comment.getReplyToUserId()); UserInfo replyToUserInfo = userInfoService.findById(comment.getReplyToUserId());
@ -228,7 +228,7 @@ public class CommentController extends BaseController {
topComment.setNickName("已注销"); topComment.setNickName("已注销");
topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL); topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if(null != topCommentUserInfo) { if(null != topCommentUserInfo) {
topComment.setNickName(EmojiConverterUtil.encode(topCommentUserInfo.getNickName())); topComment.setNickName(topCommentUserInfo.getNickName());
topComment.setAvatar(getAvatar(topCommentUserInfo)); topComment.setAvatar(getAvatar(topCommentUserInfo));
} }
if(StringUtils.isNotEmpty(topComment.getReplyToUserId())){ if(StringUtils.isNotEmpty(topComment.getReplyToUserId())){
@ -271,7 +271,7 @@ public class CommentController extends BaseController {
commentResp.setNickName("已注销"); commentResp.setNickName("已注销");
commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL); commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if (null != commentUserInfo) { if (null != commentUserInfo) {
commentResp.setNickName(EmojiConverterUtil.encode(commentUserInfo.getNickName())); commentResp.setNickName(commentUserInfo.getNickName());
commentResp.setAvatar(getAvatar(commentUserInfo)); commentResp.setAvatar(getAvatar(commentUserInfo));
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){ if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
Set<Integer> badgeSet = new HashSet<>(); Set<Integer> badgeSet = new HashSet<>();
@ -290,7 +290,7 @@ public class CommentController extends BaseController {
topComment.setNickName("已注销"); topComment.setNickName("已注销");
topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL); topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
if(null != topCommentUserInfo) { if(null != topCommentUserInfo) {
topComment.setNickName(EmojiConverterUtil.encode(topCommentUserInfo.getNickName())); topComment.setNickName(topCommentUserInfo.getNickName());
topComment.setAvatar(getAvatar(topCommentUserInfo)); topComment.setAvatar(getAvatar(topCommentUserInfo));
} }

@ -1,6 +1,7 @@
package com.luoo.comment.pojo; package com.luoo.comment.pojo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.luoo.comment.util.EmojiConverterUtil;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -35,6 +36,10 @@ public class UserInfo implements Serializable {
*/ */
private String nickName; private String nickName;
public String getNickName() {
return EmojiConverterUtil.decode(nickName);
}
/** /**
* *
*/ */
@ -145,4 +150,13 @@ public class UserInfo implements Serializable {
* *
*/ */
private Integer enablePush; private Integer enablePush;
/**
*
*/
private String wxNickname;
public String getWxNickname() {
return EmojiConverterUtil.decode(wxNickname);
}
} }

Loading…
Cancel
Save