|
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
+import com.ruoyi.common.core.text.Convert;
|
|
|
import com.ruoyi.common.exception.user.ProjectException;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.ServletUtils;
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
import com.ruoyi.generator.domain.Community.CommunityReturnRecord;
|
|
|
import com.ruoyi.generator.domain.Community.CommunityUserBlock;
|
|
@@ -63,6 +65,11 @@ public class CommunityChatMsgController extends BaseController {
|
|
|
public AjaxResult chatRecord(Long otherUserId, String type) {
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
List<CommunityChatMsgVo> chatMsgVos = new ArrayList<>();
|
|
|
+ int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
|
|
+ int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
|
|
+ int offset = (pageNum - 1) * pageSize;
|
|
|
+
|
|
|
+
|
|
|
try {
|
|
|
List<CommunityUserBlock> communityUserBlocks = communityUserBlockMapper.selectList(new QueryWrapper<CommunityUserBlock>()
|
|
|
.eq("user_id", userId)
|
|
@@ -85,7 +92,7 @@ public class CommunityChatMsgController extends BaseController {
|
|
|
})
|
|
|
.orderByDesc("create_time")
|
|
|
);*/
|
|
|
- List<CommunityChatMsg> chatMsgList = communitychatMsgMapper.getChatMsgRecord(userId, otherUserId, type);
|
|
|
+ List<CommunityChatMsg> chatMsgList = communitychatMsgMapper.getChatMsgRecord(userId, otherUserId, type,offset,pageSize);
|
|
|
|
|
|
//更新该消息标记为已读
|
|
|
List<Long> msgId = chatMsgList.stream()
|
|
@@ -219,7 +226,7 @@ public class CommunityChatMsgController extends BaseController {
|
|
|
String type = updateAnonName.getType();
|
|
|
try {
|
|
|
if ("anonymous".equals(type)) {
|
|
|
- List<CommunityChatMsg> chatMsgList = communitychatMsgMapper.getChatMsgRecord(userId, otherUserId, type);
|
|
|
+ List<CommunityChatMsg> chatMsgList = communitychatMsgMapper.getChatMsgRecord(userId, otherUserId, type,1,100000);
|
|
|
for (CommunityChatMsg chatMsg : chatMsgList) {
|
|
|
if (chatMsg.getSenderId().equals(otherUserId)) {
|
|
|
chatMsg.setSenderAnonName(newAnonName);
|