Search in sources :

Example 1 with NotifyInfo

use of com.hccake.ballcat.notify.model.domain.NotifyInfo in project ballcat by ballcat-projects.

the class NotifyWebsocketEventListener method onAnnouncementPublishEvent.

/**
 * 站内通知推送事件
 * @param event the StationNotifyPushEvent
 */
@Async
@EventListener(StationNotifyPushEvent.class)
public void onAnnouncementPublishEvent(StationNotifyPushEvent event) {
    NotifyInfo notifyInfo = event.getNotifyInfo();
    List<SysUser> userList = event.getUserList();
    notifyInfoDelegateHandler.handle(userList, notifyInfo);
}
Also used : SysUser(com.hccake.ballcat.system.model.entity.SysUser) NotifyInfo(com.hccake.ballcat.notify.model.domain.NotifyInfo) Async(org.springframework.scheduling.annotation.Async) EventListener(org.springframework.context.event.EventListener)

Example 2 with NotifyInfo

use of com.hccake.ballcat.notify.model.domain.NotifyInfo in project ballcat by ballcat-projects.

the class NotifyPublishEventListener method onNotifyPublishEvent.

/**
 * 通知发布事件
 * @param event the NotifyPublishEvent
 */
@Async
@EventListener(NotifyPublishEvent.class)
public void onNotifyPublishEvent(NotifyPublishEvent event) {
    NotifyInfo notifyInfo = event.getNotifyInfo();
    // 推送通知
    notifyPushExecutor.push(notifyInfo);
}
Also used : NotifyInfo(com.hccake.ballcat.notify.model.domain.NotifyInfo) Async(org.springframework.scheduling.annotation.Async) EventListener(org.springframework.context.event.EventListener)

Example 3 with NotifyInfo

use of com.hccake.ballcat.notify.model.domain.NotifyInfo in project ballcat by ballcat-projects.

the class AnnouncementServiceImpl method onAnnouncementPublish.

/**
 * 公告发布事件
 * @param announcement 公告信息
 */
private void onAnnouncementPublish(Announcement announcement) {
    NotifyInfo notifyInfo = NotifyInfoConverter.INSTANCE.fromAnnouncement(announcement);
    publisher.publishEvent(new NotifyPublishEvent(notifyInfo));
}
Also used : NotifyPublishEvent(com.hccake.ballcat.notify.event.NotifyPublishEvent) NotifyInfo(com.hccake.ballcat.notify.model.domain.NotifyInfo)

Aggregations

NotifyInfo (com.hccake.ballcat.notify.model.domain.NotifyInfo)3 EventListener (org.springframework.context.event.EventListener)2 Async (org.springframework.scheduling.annotation.Async)2 NotifyPublishEvent (com.hccake.ballcat.notify.event.NotifyPublishEvent)1 SysUser (com.hccake.ballcat.system.model.entity.SysUser)1