62,243
社区成员




public class NotificationAppService: BusinessAssistantAppServiceBase,INotificationAppService, ITransientDependency
{
private readonly INotificationPublisher _notiticationPublisher;
public NotificationAppService(INotificationPublisher notificationPublisher)
{
_notiticationPublisher = notificationPublisher;
}
//发送常规通知给用户
public async Task Publish_SentFrendshipRequest(string senderUserName, string friendshipMessage)
{
await _notiticationPublisher.PublishAsync("SentFrendshipRequest",
new SentFrendshipRequestNotificationData(senderUserName, friendshipMessage),
userIds: new[] { new Abp.UserIdentifier(null, 3), new Abp.UserIdentifier(1, 2), new Abp.UserIdentifier(1, 1) }, severity: NotificationSeverity.Success);
}
}
init () {
util.abp.event.on('abp.notifications.received', function (userNotification) {
console.log(userNotification);
});
}