Add queued email and Firebase push delivery
This commit is contained in:
1 parent
c96eb155ae
commit
599237dd2c
22 files changed
+497
-8
No files matched your search
@@ -86,9 +86,18 @@ public sealed class HelpdeskDbContext(DbContextOptions<HelpdeskDbContext> option
|
||||
modelBuilder.Entity<ProposalScore>().HasNoKey().ToView("v_proposal_score");
|
||||
modelBuilder.ApplyConfiguration(new NotificationConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new NotificationDeliveryConfiguration());
|
||||
modelBuilder.Entity<PushDevice>().ToTable("push_device");
|
||||
var pushDevice = modelBuilder.Entity<PushDevice>();
|
||||
pushDevice.ToTable("push_device");
|
||||
pushDevice.Property(x => x.FcmToken).HasMaxLength(512);
|
||||
pushDevice.HasIndex(x => x.FcmToken).IsUnique();
|
||||
}
|
||||
|
||||
public Task RegisterPushDeviceAsync(int userId, string token, CancellationToken ct) =>
|
||||
Database.ExecuteSqlInterpolatedAsync($"""
|
||||
INSERT INTO push_device (user_id, fcm_token) VALUES ({userId}, {token})
|
||||
ON DUPLICATE KEY UPDATE user_id = VALUES(user_id)
|
||||
""", ct);
|
||||
|
||||
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
|
||||
{
|
||||
// Všechny časy jsou v DB v UTC; při čtení jim nastavíme Kind = Utc, aby se v JSON serializovaly se "Z".
|
||||
|
||||
Reference in new issue
Block a user