mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-19 09:53:45 +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.common.event.MessageMarkEvent;
|
||||||
import com.abin.mallchat.common.user.domain.enums.ItemEnum;
|
import com.abin.mallchat.common.user.domain.enums.ItemEnum;
|
||||||
import com.abin.mallchat.common.user.service.IUserBackpackService;
|
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.adapter.WSAdapter;
|
||||||
|
import com.abin.mallchat.common.user.service.impl.PushService;
|
||||||
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.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
@@ -35,7 +35,7 @@ public class MessageMarkListener {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IUserBackpackService iUserBackpackService;
|
private IUserBackpackService iUserBackpackService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WebSocketService webSocketService;
|
private PushService pushService;
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
@TransactionalEventListener(classes = MessageMarkEvent.class, fallbackExecution = true)
|
@TransactionalEventListener(classes = MessageMarkEvent.class, fallbackExecution = true)
|
||||||
@@ -61,7 +61,7 @@ public class MessageMarkListener {
|
|||||||
public void notifyAll(MessageMarkEvent event) {//后续可做合并查询,目前异步影响不大
|
public void notifyAll(MessageMarkEvent event) {//后续可做合并查询,目前异步影响不大
|
||||||
ChatMessageMarkDTO dto = event.getDto();
|
ChatMessageMarkDTO dto = event.getDto();
|
||||||
Integer markCount = messageMarkDao.getMarkCount(dto.getMsgId(), dto.getMarkType());
|
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