mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 15:37:23 +01:00
add group moderation and banning functionality to api (#13)
* add group moderation and banning functionality to api * set moderator to false on group migration * send IsModerator in addition on group join Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
parent
6ffad7f723
commit
a45a923260
12 changed files with 1297 additions and 42 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using MareSynchronosShared.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace MareSynchronosShared.Data;
|
||||
|
|
@ -41,6 +42,7 @@ public class MareDbContext : DbContext
|
|||
public DbSet<BannedRegistrations> BannedRegistrations { get; set; }
|
||||
public DbSet<Group> Groups { get; set; }
|
||||
public DbSet<GroupPair> GroupPairs { get; set; }
|
||||
public DbSet<GroupBan> GroupBans { get; set; }
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
|
|
@ -63,5 +65,9 @@ public class MareDbContext : DbContext
|
|||
modelBuilder.Entity<GroupPair>().HasKey(u => new { u.GroupGID, u.GroupUserUID });
|
||||
modelBuilder.Entity<GroupPair>().HasIndex(c => c.GroupUserUID);
|
||||
modelBuilder.Entity<GroupPair>().HasIndex(c => c.GroupGID);
|
||||
modelBuilder.Entity<GroupBan>().ToTable("group_bans");
|
||||
modelBuilder.Entity<GroupBan>().HasKey(u => new { u.GroupGID, u.BannedUserUID });
|
||||
modelBuilder.Entity<GroupBan>().HasIndex(c => c.BannedUserUID);
|
||||
modelBuilder.Entity<GroupBan>().HasIndex(c => c.GroupGID);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue