重构报名(数据结构)
This commit is contained in:
parent
3f58c35d60
commit
b854fd36b3
@ -110,7 +110,7 @@ namespace asg_form.Controllers
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public form form { get; set; }
|
||||
public Events.T_events events { get; set; }
|
||||
public T_events events { get; set; }
|
||||
public string msg { get; set; }
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
using asg_form.Controllers.Store;
|
||||
using asg_form.Controllers.Team;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.DataEncryption;
|
||||
@ -27,6 +28,9 @@ namespace asg_form.Controllers
|
||||
builder.Property(a => a.Status).IsRequired();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Configure(EntityTypeBuilder<form> builder)
|
||||
{
|
||||
builder.ToTable("F_form");
|
||||
@ -35,11 +39,38 @@ namespace asg_form.Controllers
|
||||
builder.Property(e => e.team_password).IsRequired();
|
||||
builder.Property(e => e.time).IsRequired();
|
||||
builder.Property(e => e.piaoshu).IsRequired();
|
||||
builder.HasOne<Events.T_events>(c => c.events).WithMany(a => a.forms).IsRequired();
|
||||
builder.HasOne<T_events>(c => c.events).WithMany(a => a.forms).IsRequired();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TeamConfig : IEntityTypeConfiguration<T_Team>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<T_Team> builder)
|
||||
{
|
||||
builder.ToTable("F_Team");
|
||||
builder.Property(e => e.team_name).IsRequired();
|
||||
builder.Property(e => e.team_tel).IsRequired();
|
||||
builder.Property(e => e.team_password).IsRequired();
|
||||
builder.Property(e => e.time).IsRequired();
|
||||
builder.Property(e => e.piaoshu).IsRequired();
|
||||
builder.HasMany<T_events>(a => a.Events).WithMany(a => a.Teams).UsingEntity(j => j.ToTable("T_Teams_Player"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class PlayerConfig : IEntityTypeConfiguration<T_Player>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<T_Player> builder)
|
||||
{
|
||||
builder.ToTable("F_Player");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class RoleConfig : IEntityTypeConfiguration<role>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<role> builder)
|
||||
@ -129,9 +160,9 @@ namespace asg_form.Controllers
|
||||
builder.HasOne<schedule.team_game>(e => e.team).WithMany(o=>o.logs).IsRequired();
|
||||
}
|
||||
}
|
||||
class EventsConfig : IEntityTypeConfiguration<Events.T_events>
|
||||
class EventsConfig : IEntityTypeConfiguration<T_events>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Events.T_events> builder)
|
||||
public void Configure(EntityTypeBuilder<T_events> builder)
|
||||
{
|
||||
builder.ToTable("F_events");
|
||||
builder.Property(e => e.Id).IsRequired();
|
||||
@ -189,15 +220,16 @@ namespace asg_form.Controllers
|
||||
|
||||
class TestDbContext : DbContext
|
||||
{
|
||||
public DbSet<T_Team> Teams { get; set; }
|
||||
public DbSet<T_Player> Players { get; set; }
|
||||
|
||||
|
||||
public DbSet<form> Forms { get; set; }
|
||||
public DbSet<role> Roles { get; set; }
|
||||
public DbSet<T_news> news { get; set; }
|
||||
public DbSet<blog.blog_db> blogs { get; set; }
|
||||
public DbSet<schedule.schedule_log> schlogs { get; set; }
|
||||
public DbSet<schedule.team_game> team_Games { get; set; }
|
||||
public DbSet<Events.T_events> events { get; set; }
|
||||
public DbSet<T_events> events { get; set; }
|
||||
public DbSet<Champion.T_Champion> Champions { get; set; }
|
||||
public DbSet<comform.com_form> com_Forms { get; set; }
|
||||
public DbSet<T_Friend> T_Friends { get; set; }
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using asg_form.Controllers.Team;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Security.Claims;
|
||||
@ -162,17 +163,7 @@ namespace asg_form.Controllers
|
||||
}
|
||||
|
||||
|
||||
public class T_events
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? name { get; set; }
|
||||
public bool? is_over { get; set; }
|
||||
public DateTime? opentime { get; set; }
|
||||
public List<form>? forms { get; set; }
|
||||
public Uri? events_rule_uri { get; set; }
|
||||
public string? promChart { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class events_get
|
||||
{
|
||||
public int Id { get; set; }
|
||||
@ -183,4 +174,16 @@ namespace asg_form.Controllers
|
||||
|
||||
}
|
||||
}
|
||||
public class T_events
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? name { get; set; }
|
||||
public bool? is_over { get; set; }
|
||||
public DateTime? opentime { get; set; }
|
||||
public List<T_Team> Teams { get; set; }=new List<T_Team>();
|
||||
public List<form>? forms { get; set; }
|
||||
public Uri? events_rule_uri { get; set; }
|
||||
public string? promChart { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
35
asg_form/Controllers/Team/TeamDB.cs
Normal file
35
asg_form/Controllers/Team/TeamDB.cs
Normal file
@ -0,0 +1,35 @@
|
||||
namespace asg_form.Controllers.Team
|
||||
{
|
||||
public class T_Team
|
||||
{
|
||||
|
||||
public List<T_events> Events { get; set; }=new List<T_events>();
|
||||
public long Id { get; set; }
|
||||
public int piaoshu { get; set; }
|
||||
public DateTime time { get; set; } = DateTime.Now;
|
||||
public string team_name { get; set; }
|
||||
public string team_password { get; set; }
|
||||
public string team_tel { get; set; }
|
||||
public string logo_uri { get; set; }
|
||||
public T_events events { get; set; }
|
||||
|
||||
// public string? belong { get; set; }
|
||||
public List<T_Player> role { get; set; } = new List<T_Player>();
|
||||
}
|
||||
public class T_Player
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public T_Team Team { get; set; }//属于哪个队伍
|
||||
|
||||
public string role_id { get; set; } = "无";
|
||||
public string role_name { get; set; } = "无";//阵容
|
||||
public string? Game_Name { get; set; } = "未知";
|
||||
public string role_lin { get; set; }
|
||||
public string? Id_Card { get; set; } = "未知";
|
||||
public string? Common_Roles { get; set; } = "未知";
|
||||
public string? Phone_Number { get; set; } = "未知";
|
||||
public string? Id_Card_Name { get; set; } = "未知";
|
||||
public int? Historical_Ranks { get; set; } = 0;
|
||||
}
|
||||
}
|
@ -518,7 +518,7 @@ namespace asg_form.Controllers
|
||||
public string team_password { get; set; }
|
||||
public string team_tel { get; set; }
|
||||
public string logo_uri { get; set; }
|
||||
public Events.T_events events { get; set; }
|
||||
public T_events events { get; set; }
|
||||
|
||||
// public string? belong { get; set; }
|
||||
public List<role> role { get; set; } = new List<role>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user