Commit f27e5fe4 by Future

未读消息数量

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