mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
fix:优化
This commit is contained in:
@@ -10,8 +10,8 @@ import com.abin.mallchat.common.common.domain.enums.IdempotentEnum;
|
||||
import com.abin.mallchat.common.common.event.MessageMarkEvent;
|
||||
import com.abin.mallchat.common.user.domain.enums.ItemEnum;
|
||||
import com.abin.mallchat.common.user.service.IUserBackpackService;
|
||||
import com.abin.mallchat.common.user.service.WebSocketService;
|
||||
import com.abin.mallchat.common.user.service.adapter.WSAdapter;
|
||||
import com.abin.mallchat.common.user.service.impl.PushService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@@ -35,7 +35,7 @@ public class MessageMarkListener {
|
||||
@Autowired
|
||||
private IUserBackpackService iUserBackpackService;
|
||||
@Autowired
|
||||
private WebSocketService webSocketService;
|
||||
private PushService pushService;
|
||||
|
||||
@Async
|
||||
@TransactionalEventListener(classes = MessageMarkEvent.class, fallbackExecution = true)
|
||||
@@ -61,7 +61,7 @@ public class MessageMarkListener {
|
||||
public void notifyAll(MessageMarkEvent event) {//后续可做合并查询,目前异步影响不大
|
||||
ChatMessageMarkDTO dto = event.getDto();
|
||||
Integer markCount = messageMarkDao.getMarkCount(dto.getMsgId(), dto.getMarkType());
|
||||
webSocketService.sendToAllOnline(WSAdapter.buildMsgMarkSend(dto, markCount), dto.getUid());
|
||||
pushService.sendPushMsg(WSAdapter.buildMsgMarkSend(dto, markCount));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user