Add settings endpoints and registration status check: implement new API endpoints for settings management, including registration status retrieval, and update the registration command handler to enforce registration rules based on site settings.
This commit is contained in:
@@ -6,6 +6,7 @@ using TeleWave.Domain.Auth;
|
||||
using TeleWave.Domain.Broadcast;
|
||||
using TeleWave.Domain.Library;
|
||||
using TeleWave.Domain.Media;
|
||||
using TeleWave.Domain.Settings;
|
||||
using TeleWave.Infrastructure.Identity;
|
||||
|
||||
namespace TeleWave.Infrastructure.Persistence;
|
||||
@@ -24,6 +25,7 @@ public class AppDbContext(DbContextOptions<AppDbContext> options)
|
||||
public DbSet<Channel> Channels => Set<Channel>();
|
||||
public DbSet<ScheduleEntry> ScheduleEntries => Set<ScheduleEntry>();
|
||||
public DbSet<BumperAsset> BumperAssets => Set<BumperAsset>();
|
||||
public DbSet<AppSetting> AppSettings => Set<AppSetting>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using TeleWave.Domain.Settings;
|
||||
|
||||
namespace TeleWave.Infrastructure.Persistence.Configurations;
|
||||
|
||||
public class AppSettingConfiguration : IEntityTypeConfiguration<AppSetting>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<AppSetting> builder)
|
||||
{
|
||||
builder.HasKey(x => x.Key);
|
||||
builder.Property(x => x.Key).HasMaxLength(128);
|
||||
builder.Property(x => x.Value).IsRequired().HasMaxLength(1024);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user