update 游客和用户未读数新增
This commit is contained in:
parent
099e973f64
commit
340f81a513
|
@ -22,8 +22,7 @@ import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import static com.m2pool.chat.constant.UserType.CUSTOMER;
|
import static com.m2pool.chat.constant.UserType.*;
|
||||||
import static com.m2pool.chat.constant.UserType.TOURIST;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class StompServiceImpl implements StompService {
|
public class StompServiceImpl implements StompService {
|
||||||
|
@ -64,8 +63,15 @@ public class StompServiceImpl implements StompService {
|
||||||
ChatRoom chatRoom = chatRoomMapper.selectById(userMessageVo.getRoomId());
|
ChatRoom chatRoom = chatRoomMapper.selectById(userMessageVo.getRoomId());
|
||||||
|
|
||||||
if (chatRoom != null ){
|
if (chatRoom != null ){
|
||||||
|
if(LOGIN_USER.equals(principal.getType())){
|
||||||
|
build.setClientReadNum(chatRoom.getServiceReadNum() + 1);
|
||||||
|
}else {
|
||||||
build.setClientReadNum(chatRoom.getClientReadNum() + 1);
|
build.setClientReadNum(chatRoom.getClientReadNum() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//当前用户发送其他人, 发送给指定用户. 否则默认发送给当前发送者
|
//当前用户发送其他人, 发送给指定用户. 否则默认发送给当前发送者
|
||||||
if (bool){
|
if (bool){
|
||||||
messagingTemplate.convertAndSendToUser(userMessageVo.getEmail(), Destination.QUEUE + "/" + userMessageVo.getEmail(),build);
|
messagingTemplate.convertAndSendToUser(userMessageVo.getEmail(), Destination.QUEUE + "/" + userMessageVo.getEmail(),build);
|
||||||
|
|
Loading…
Reference in New Issue