Commit f27e5fe4 by Future

未读消息数量

parent 27001ba9
package com.wecloud.im.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wecloud.im.entity.ImApplication;
import com.wecloud.im.entity.ImClient;
import com.wecloud.im.entity.ImInbox;
import com.wecloud.im.mapper.ImInboxMapper;
......@@ -10,12 +11,14 @@ import com.wecloud.im.param.UpdateMsgReadStatusByConversationParam;
import com.wecloud.im.service.ImClientService;
import com.wecloud.im.service.ImInboxService;
import com.wecloud.im.vo.ConversationCountVo;
import com.wecloud.im.ws.enums.MsgTypeEnum;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
/**
......@@ -37,11 +40,15 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updateImMsgReceived(ImMsgReceivedStatusUpdate imMsgReceivedUpdate) {
ImClient curentClient = imClientService.getCurrentClient();
ImClient currentClient = imClientService.getCurrentClient();
// 修改已接收状态
// imInboxMapper.updateImMsgReceivedByIds(curentClient.getId(), imMsgReceivedUpdate.getMsgIds());
// 修改已读状态
imInboxMapper.updateImMsgReadByIds(curentClient.getId(), imMsgReceivedUpdate.getMsgIds());
imInboxMapper.updateImMsgReceivedByIds(currentClient.getId(), imMsgReceivedUpdate.getMsgIds());
// 是否同时修改为已读状态
if (imMsgReceivedUpdate.getReadStatus()) {
MsgReadStatusUpdateParam msgReadStatusUpdateParam = new MsgReadStatusUpdateParam();
msgReadStatusUpdateParam.setMsgIds(imMsgReceivedUpdate.getMsgIds());
this.updateImMsgRead(msgReadStatusUpdateParam);
}
return true;
}
......@@ -64,10 +71,9 @@ public class ImInboxServiceImpl extends BaseServiceImpl<ImInboxMapper, ImInbox>
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updateImMsgRead(MsgReadStatusUpdateParam msgReadStatusUpdateParam) {
// 小虎豆不做单条消息修改已读
ImClient curentClient = imClientService.getCurrentClient();
ImClient currentClient = imClientService.getCurrentClient();
// 修改已读状态
imInboxMapper.updateImMsgReadByIds(curentClient.getId(), msgReadStatusUpdateParam.getMsgIds());
imInboxMapper.updateImMsgReadByIds(currentClient.getId(), msgReadStatusUpdateParam.getMsgIds());
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment