Administrator
2021-06-21 098d606ddd6e9eccf22fe8c5bb703234dbda9614
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/chatrecords/controller/ChatRecordsController.java
@@ -44,10 +44,13 @@
      //查询单聊人的信息
      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);
   }
@@ -64,6 +67,10 @@
   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));
   }