| | |
| | | //查询单聊人的信息 |
| | | List<User> user = Arrays.asList(iUserClient.userInfoById(chatRecords.getSenderId()).getData(), iUserClient.userInfoById(chatRecords.getRecipientId()).getData()); |
| | | //查询单聊记录信息 |
| | | IPage<ChatRecords> chatRecordsIPage = chatRecordsService.selectChatRecordsPage(Condition.getPage(query), chatRecords); |
| | | if (null==query.getCurrent()){ |
| | | map.put("chatRecordsIPage",chatRecordsService.selectChatlist(chatRecords)); |
| | | }else { |
| | | map.put("chatRecordsIPage",chatRecordsService.selectChatRecordsPage(Condition.getPage(query), chatRecords)); |
| | | } |
| | | //封装数据 |
| | | map.put("user",user); |
| | | map.put("chatRecordsIPage",chatRecordsIPage); |
| | | //返回数据 |
| | | return R.data(map); |
| | | } |
| | |
| | | public R getChatListPage(@Valid ChatRecords chatRecords, HttpServletResponse response, Query query){ |
| | | //跨域设置 |
| | | crossDomain(response); |
| | | if(null==query.getCurrent()){ |
| | | //不分页 |
| | | return R.data(chatRecordsService.getChatList( chatRecords)); |
| | | } |
| | | //查询当前人员的聊天列表,并返回数据 |
| | | return R.data(chatRecordsService.getChatListPage(Condition.getPage(query), chatRecords)); |
| | | } |