Pusher service basis

This commit is contained in:
2025-07-12 22:15:18 +08:00
parent 33f56c4ef5
commit e1b47bc7d1
22 changed files with 1117 additions and 104 deletions

View File

@ -0,0 +1,25 @@
using System.ComponentModel.DataAnnotations;
using DysonNetwork.Shared.Data;
using Microsoft.EntityFrameworkCore;
using NodaTime;
namespace DysonNetwork.Pusher.Notification;
public enum PushProvider
{
Apple,
Google
}
[Index(nameof(AccountId), nameof(DeviceId), nameof(DeletedAt), IsUnique = true)]
public class PushSubscription : ModelBase
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid AccountId { get; set; }
[MaxLength(8192)] public string DeviceId { get; set; } = null!;
[MaxLength(8192)] public string DeviceToken { get; set; } = null!;
public PushProvider Provider { get; set; }
public int CountDelivered { get; set; }
public Instant? LastUsedAt { get; set; }
}