zouxuan 2 년 전
부모
커밋
6c05c867bb
1개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ImUserFriendServiceImpl.java

+ 4 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ImUserFriendServiceImpl.java

@@ -9,11 +9,9 @@ import com.yonge.cooleshow.biz.dal.dto.BasicUserInfo;
 import com.yonge.cooleshow.biz.dal.entity.ImUserFriend;
 import com.yonge.cooleshow.biz.dal.service.ImUserFriendService;
 import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Service;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
@@ -61,7 +59,7 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
                 teacherFriend.setFriendAvatar(info.getAvatar());
                 teacherFriend.setFriendNickname(info.getUsername());
                 studentFriend.setFriendAvatar(info.getAvatar());
-                studentFriend.setFriendNickname(info.getRealName());
+                studentFriend.setFriendNickname(info.getUsername());
             }
             teacherFriend.setFriendId(studentId);
             teacherFriend.setUserId(teacherId);
@@ -88,7 +86,7 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
             if(Objects.nonNull(imUserFriend)){
                 //更新当前用户关联的该用户的详情信息
                 imUserFriend.setFriendAvatar(basicUserInfo.getAvatar());
-                imUserFriend.setFriendNickname(StringUtils.isEmpty(basicUserInfo.getRealName())?basicUserInfo.getUsername():basicUserInfo.getRealName());
+                imUserFriend.setFriendNickname(basicUserInfo.getUsername());
                 imUserFriend.setUpdateTime(new Date());
                 baseMapper.updateById(imUserFriend);
                 return imUserFriend;
@@ -96,7 +94,7 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
         }
         ImUserFriend imUserFriend = new ImUserFriend();
         imUserFriend.setFriendAvatar(basicUserInfo.getAvatar());
-        imUserFriend.setFriendNickname(StringUtils.isEmpty(basicUserInfo.getRealName())?basicUserInfo.getUsername():basicUserInfo.getRealName());
+        imUserFriend.setFriendNickname(basicUserInfo.getUsername());
         imUserFriend.setFriendId(userId);
         return imUserFriend;
     }