All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 4m27s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
37 lines
892 B
C#
37 lines
892 B
C#
using Service.Message;
|
|
|
|
namespace Application;
|
|
|
|
/// <summary>
|
|
/// 通知应用服务接口
|
|
/// </summary>
|
|
public interface INotificationApplication
|
|
{
|
|
Task<string> GetVapidPublicKeyAsync();
|
|
Task SubscribeAsync(PushSubscription subscription);
|
|
Task SendNotificationAsync(string message);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通知应用服务实现
|
|
/// </summary>
|
|
public class NotificationApplication(
|
|
INotificationService notificationService
|
|
) : INotificationApplication
|
|
{
|
|
public async Task<string> GetVapidPublicKeyAsync()
|
|
{
|
|
return await notificationService.GetVapidPublicKeyAsync();
|
|
}
|
|
|
|
public async Task SubscribeAsync(PushSubscription subscription)
|
|
{
|
|
await notificationService.SubscribeAsync(subscription);
|
|
}
|
|
|
|
public async Task SendNotificationAsync(string message)
|
|
{
|
|
await notificationService.SendNotificationAsync(message);
|
|
}
|
|
}
|