From cc1098fc00a50cb1591d182f04bc37066ff0a9e2 Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期四, 05 八月 2021 15:12:39 +0800 Subject: [PATCH] Merge branch 'test' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java index 62702e6..886420a 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java @@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; import javax.annotation.Resource; import java.util.ArrayList; @@ -452,6 +453,10 @@ comActDiscussCommentVO.setHaveSign(0); } + //判断当前评论是否是社区管理员评论 + if(!comActDiscussCommentVO.getUserType().equals(1)){ + comActDiscussCommentVO.setUserNickName("社区管理员"); + } }); } return R.ok(iPage); @@ -498,8 +503,13 @@ LoginUserInfoVO loginUserInfoVO=comActDiscussDAO.selectUserByUserId(userId); if(loginUserInfoVO != null){ comActDiscussVO.setUserName(loginUserInfoVO.getName()); - comActDiscussVO.setUserNickName(loginUserInfoVO.getNickName()); + if(StringUtils.isEmpty(loginUserInfoVO.getNickName())){ + comActDiscussVO.setUserNickName(loginUserInfoVO.getName()); + }else{ + comActDiscussVO.setUserNickName(loginUserInfoVO.getNickName()); + } comActDiscussVO.setImageUrl(loginUserInfoVO.getImageUrl()); + comActDiscussVO.setUserType(loginUserInfoVO.getType()); } Long communityId = comActDiscussDO.getCommunityId(); Integer type1 = loginUserInfoVO.getType(); -- Gitblit v1.7.1