优化查询结果

This commit is contained in:
wangxulei
2025-02-19 15:05:49 +08:00
parent be5e7a015a
commit 4be98ce412
2 changed files with 11 additions and 3 deletions

View File

@@ -68,9 +68,13 @@ public class ChatController {
public ResultBean<List<AuthorChat>> authorList(String authorId) {
List<AuthorChat> authorChats = chatService.selectAuthorChatList(authorId);
authorChats.stream().forEach(authorChat -> {
authorChat.setIndex(String.valueOf(PinyinUtil.getFirstLetter(authorChat.getIndex().charAt(0))));
if(authorChat.getCreateTime()!=null){
authorChat.setLastSendTime(convertToShanghaiTimeZoneTimestamp( authorChat.getCreateTime()));
try {
authorChat.setIndex(String.valueOf(PinyinUtil.getFirstLetter(authorChat.getIndex().charAt(0))));
if(authorChat.getCreateTime()!=null){
authorChat.setLastSendTime(convertToShanghaiTimeZoneTimestamp( authorChat.getCreateTime()));
}
}catch (Exception e){
}
});
return ResultBean.success(authorChats);