|
@@ -52,6 +52,8 @@ import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static cn.dev33.satoken.log.SaLogForConsole.info;
|
|
|
+
|
|
|
/**
|
|
|
*聊天群聊消息操作
|
|
|
* @author 大春
|
|
@@ -315,21 +317,21 @@ public class TourMessageController {
|
|
|
if (noticeType==NoticeType.NOTICE_FOCUS){
|
|
|
this.attentionStatus(userIds);
|
|
|
}
|
|
|
- messageVo.forEach(info -> {
|
|
|
- FocusDTO bean = JSON.parseObject(info.getMessageContent(), FocusDTO.class);
|
|
|
+ for (int i = 0; i < messageVo.size(); i++) {
|
|
|
+ TourImMessageVo tour = messageVo.get(i);
|
|
|
+ FocusDTO bean = JSON.parseObject(String.valueOf(tour), FocusDTO.class);
|
|
|
if (userId.toString().equals(bean.getGetUserId())){
|
|
|
- info.setFocusStatus(bean.getAttentionStatus());
|
|
|
+ tour.setFocusStatus(bean.getAttentionStatus());
|
|
|
}
|
|
|
- String messageContent = info.getMessageContent();
|
|
|
- info.setMessagePO(JSON.parseObject(messageContent));
|
|
|
- });
|
|
|
-
|
|
|
+ String messageContent = tour.getMessageContent();
|
|
|
+ tour.setMessagePO(JSON.parseObject(messageContent));
|
|
|
+ }
|
|
|
pageData.setTotalCount(Long.valueOf(messageList.size()));
|
|
|
return ResponseResult.success(pageData);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Map<Long, Long> attentionStatus(List<Long> userIds) {
|
|
|
+ public List<Long> attentionStatus(List<Long> userIds) {
|
|
|
//用户id
|
|
|
Long myId = TokenData.takeFromRequest().getUserId();
|
|
|
// 我的粉丝列表 attentionId = currentUserId
|
|
@@ -350,7 +352,7 @@ public class TourMessageController {
|
|
|
.collect(Collectors.toSet());
|
|
|
// 关注状态填充
|
|
|
|
|
|
- HashMap<Long, Long> map = new HashMap<>();
|
|
|
+ ArrayList<Long> longs = new ArrayList<>();
|
|
|
userIds.forEach(userId->{
|
|
|
Long status = null;
|
|
|
if (userId.toString().equals(myId.toString())){
|
|
@@ -364,10 +366,10 @@ public class TourMessageController {
|
|
|
} else {
|
|
|
status =MyAttentionStatus.UN_FOCUS; // 未关注
|
|
|
}
|
|
|
- map.put(userId,status);
|
|
|
+ longs.add(status);
|
|
|
});
|
|
|
|
|
|
- return map;
|
|
|
+ return longs;
|
|
|
}
|
|
|
|
|
|
|