From bc396e5029b9b64254980e0c4e1819f6a7065e0f Mon Sep 17 00:00:00 2001 From: luolangaga <2667210109@qq.com> Date: Sat, 10 Aug 2024 19:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet.yml | 2 +- asg_form/Controllers/admin.cs | 10 + .../20240810113800_stort.Designer.cs | 818 ++++++++++++++++++ asg_form/Migrations/20240810113800_stort.cs | 88 ++ .../Migrations/IDBcontextModelSnapshot.cs | 112 ++- asg_form/Program.cs | 2 + 6 files changed, 1014 insertions(+), 18 deletions(-) create mode 100644 asg_form/Migrations/20240810113800_stort.Designer.cs create mode 100644 asg_form/Migrations/20240810113800_stort.cs diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 25f43e7..0bfc8aa 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/asg_form/Controllers/admin.cs b/asg_form/Controllers/admin.cs index 28f7e0d..ccb90e9 100644 --- a/asg_form/Controllers/admin.cs +++ b/asg_form/Controllers/admin.cs @@ -90,7 +90,17 @@ namespace asg_form.Controllers return Ok("Image file uploaded successfully."); } + [Route("api/v1/admin/dbgu")] + [HttpPost] + public async Task> dbgu() + { + using(TestDbContext db=new TestDbContext()) + { + await db.Database.MigrateAsync(); + } + return Ok("successfully."); + } [Route("api/v1/admin/Privacy_Policy")] [HttpPost] diff --git a/asg_form/Migrations/20240810113800_stort.Designer.cs b/asg_form/Migrations/20240810113800_stort.Designer.cs new file mode 100644 index 0000000..b2be802 --- /dev/null +++ b/asg_form/Migrations/20240810113800_stort.Designer.cs @@ -0,0 +1,818 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using asg_form.Controllers; + +#nullable disable + +namespace asg_form.Migrations +{ + [DbContext(typeof(IDBcontext))] + [Migration("20240810113800_stort")] + partial class stort + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.Champion+T_Champion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("eventsId") + .HasColumnType("int"); + + b.Property("formId") + .HasColumnType("bigint"); + + b.Property("msg") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("eventsId"); + + b.HasIndex("formId"); + + b.ToTable("F_Champion", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.Store.StoreDB", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("bigint"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("StoreDB"); + }); + + modelBuilder.Entity("asg_form.Controllers.Store.StoreinfoDB", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Storeid") + .HasColumnType("bigint"); + + b.Property("buyerid") + .HasColumnType("bigint"); + + b.Property("isVerification") + .HasColumnType("bit"); + + b.HasKey("id"); + + b.HasIndex("Storeid"); + + b.ToTable("F_Store", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.T_Friend", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("account") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("comMsg") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("comTime") + .HasColumnType("datetime2"); + + b.Property("comType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("degree") + .HasColumnType("int"); + + b.Property("headName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("headTel") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("orgName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("F_Friend", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.T_news", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("FormName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("msg") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("time") + .IsRequired() + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("F_news", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.comform+com_form", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Com_Cocial_media") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Com_Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Com_qq") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("idv_id") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("introduction") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("F_ComForm", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.form", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("eventsId") + .HasColumnType("int"); + + b.Property("logo_uri") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("piaoshu") + .HasColumnType("int"); + + b.Property("team_name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("team_password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("team_tel") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("time") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("eventsId"); + + b.ToTable("F_form", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Common_Roles") + .HasColumnType("nvarchar(max)"); + + b.Property("Game_Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Historical_Ranks") + .HasColumnType("int"); + + b.Property("Id_Card") + .HasColumnType("nvarchar(max)"); + + b.Property("Id_Card_Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Phone_Number") + .HasColumnType("nvarchar(max)"); + + b.Property("formId") + .HasColumnType("bigint"); + + b.Property("role_id") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("role_lin") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("role_name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("formId"); + + b.ToTable("F_role", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.schedule+schedule_log", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("chickteam") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("teamid") + .HasColumnType("bigint"); + + b.Property("userid") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("win") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("teamid"); + + b.ToTable("F_achlog", (string)null); + }); + + modelBuilder.Entity("asg_form.Controllers.schedule+team_game", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("belong") + .HasColumnType("nvarchar(max)"); + + b.Property("bilibiliuri") + .HasColumnType("nvarchar(max)"); + + b.Property("commentary") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("opentime") + .HasColumnType("datetime2"); + + b.Property("referee") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("tag") + .HasColumnType("nvarchar(max)"); + + b.Property("team1_name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("team1_piaoshu") + .HasColumnType("int"); + + b.Property("team2_name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("team2_piaoshu") + .HasColumnType("int"); + + b.Property("winteam") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("F_game", (string)null); + }); + + modelBuilder.Entity("asg_form.Model.T_events", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("events_rule_uri") + .HasColumnType("nvarchar(max)"); + + b.Property("is_over") + .HasColumnType("bit"); + + b.Property("name") + .HasColumnType("nvarchar(max)"); + + b.Property("opentime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("F_events", (string)null); + }); + + modelBuilder.Entity("asg_form.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("msg") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("asg_form.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("Integral") + .HasColumnType("bigint"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserBase64") + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("chinaname") + .HasColumnType("nvarchar(max)"); + + b.Property("haveformId") + .HasColumnType("bigint"); + + b.Property("isbooking") + .HasColumnType("bit"); + + b.Property("officium") + .HasColumnType("nvarchar(max)"); + + b.Property("point") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.HasIndex("haveformId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("asg_form.blog+blog_db", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("formuser") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("msg") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("pushtime") + .HasColumnType("datetime2"); + + b.Property("title") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("ID"); + + b.ToTable("F_blog", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("asg_form.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("asg_form.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("asg_form.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("asg_form.Role", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("asg_form.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("asg_form.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("asg_form.Controllers.Champion+T_Champion", b => + { + b.HasOne("asg_form.Model.T_events", "events") + .WithMany() + .HasForeignKey("eventsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("asg_form.Controllers.form", "form") + .WithMany() + .HasForeignKey("formId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("events"); + + b.Navigation("form"); + }); + + modelBuilder.Entity("asg_form.Controllers.Store.StoreinfoDB", b => + { + b.HasOne("asg_form.Controllers.Store.StoreDB", "Store") + .WithMany("buyer") + .HasForeignKey("Storeid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Store"); + }); + + modelBuilder.Entity("asg_form.Controllers.form", b => + { + b.HasOne("asg_form.Model.T_events", "events") + .WithMany("forms") + .HasForeignKey("eventsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("events"); + }); + + modelBuilder.Entity("asg_form.Controllers.role", b => + { + b.HasOne("asg_form.Controllers.form", "form") + .WithMany("role") + .HasForeignKey("formId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("form"); + }); + + modelBuilder.Entity("asg_form.Controllers.schedule+schedule_log", b => + { + b.HasOne("asg_form.Controllers.schedule+team_game", "team") + .WithMany("logs") + .HasForeignKey("teamid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("team"); + }); + + modelBuilder.Entity("asg_form.User", b => + { + b.HasOne("asg_form.Controllers.form", "haveform") + .WithMany() + .HasForeignKey("haveformId"); + + b.Navigation("haveform"); + }); + + modelBuilder.Entity("asg_form.Controllers.Store.StoreDB", b => + { + b.Navigation("buyer"); + }); + + modelBuilder.Entity("asg_form.Controllers.form", b => + { + b.Navigation("role"); + }); + + modelBuilder.Entity("asg_form.Controllers.schedule+team_game", b => + { + b.Navigation("logs"); + }); + + modelBuilder.Entity("asg_form.Model.T_events", b => + { + b.Navigation("forms"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/asg_form/Migrations/20240810113800_stort.cs b/asg_form/Migrations/20240810113800_stort.cs new file mode 100644 index 0000000..49096d4 --- /dev/null +++ b/asg_form/Migrations/20240810113800_stort.cs @@ -0,0 +1,88 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace asg_form.Migrations +{ + /// + public partial class stort : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Integral", + table: "AspNetUsers", + type: "bigint", + nullable: true); + + migrationBuilder.AddColumn( + name: "point", + table: "AspNetUsers", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "StoreDB", + columns: table => new + { + id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(max)", nullable: false), + Price = table.Column(type: "bigint", nullable: false), + description = table.Column(type: "nvarchar(max)", nullable: false), + information = table.Column(type: "nvarchar(max)", nullable: false), + Type = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_StoreDB", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "F_Store", + columns: table => new + { + id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + buyerid = table.Column(type: "bigint", nullable: false), + Storeid = table.Column(type: "bigint", nullable: false), + isVerification = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_F_Store", x => x.id); + table.ForeignKey( + name: "FK_F_Store_StoreDB_Storeid", + column: x => x.Storeid, + principalTable: "StoreDB", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_F_Store_Storeid", + table: "F_Store", + column: "Storeid"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "F_Store"); + + migrationBuilder.DropTable( + name: "StoreDB"); + + migrationBuilder.DropColumn( + name: "Integral", + table: "AspNetUsers"); + + migrationBuilder.DropColumn( + name: "point", + table: "AspNetUsers"); + } + } +} diff --git a/asg_form/Migrations/IDBcontextModelSnapshot.cs b/asg_form/Migrations/IDBcontextModelSnapshot.cs index 6483773..d1c6115 100644 --- a/asg_form/Migrations/IDBcontextModelSnapshot.cs +++ b/asg_form/Migrations/IDBcontextModelSnapshot.cs @@ -152,29 +152,60 @@ namespace asg_form.Migrations b.ToTable("F_Champion", (string)null); }); - modelBuilder.Entity("asg_form.Controllers.Events+T_events", b => + modelBuilder.Entity("asg_form.Controllers.Store.StoreDB", b => { - b.Property("Id") + b.Property("id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("bigint"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); - b.Property("events_rule_uri") + b.Property("Name") + .IsRequired() .HasColumnType("nvarchar(max)"); - b.Property("is_over") + b.Property("Price") + .HasColumnType("bigint"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("StoreDB"); + }); + + modelBuilder.Entity("asg_form.Controllers.Store.StoreinfoDB", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Storeid") + .HasColumnType("bigint"); + + b.Property("buyerid") + .HasColumnType("bigint"); + + b.Property("isVerification") .HasColumnType("bit"); - b.Property("name") - .HasColumnType("nvarchar(max)"); + b.HasKey("id"); - b.Property("opentime") - .HasColumnType("datetime2"); + b.HasIndex("Storeid"); - b.HasKey("Id"); - - b.ToTable("F_events", (string)null); + b.ToTable("F_Store", (string)null); }); modelBuilder.Entity("asg_form.Controllers.T_Friend", b => @@ -455,6 +486,31 @@ namespace asg_form.Migrations b.ToTable("F_game", (string)null); }); + modelBuilder.Entity("asg_form.Model.T_events", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("events_rule_uri") + .HasColumnType("nvarchar(max)"); + + b.Property("is_over") + .HasColumnType("bit"); + + b.Property("name") + .HasColumnType("nvarchar(max)"); + + b.Property("opentime") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("F_events", (string)null); + }); + modelBuilder.Entity("asg_form.Role", b => { b.Property("Id") @@ -514,6 +570,9 @@ namespace asg_form.Migrations b.Property("EmailConfirmed") .HasColumnType("bit"); + b.Property("Integral") + .HasColumnType("bigint"); + b.Property("LockoutEnabled") .HasColumnType("bit"); @@ -562,6 +621,9 @@ namespace asg_form.Migrations b.Property("officium") .HasColumnType("nvarchar(max)"); + b.Property("point") + .HasColumnType("int"); + b.HasKey("Id"); b.HasIndex("NormalizedEmail") @@ -658,7 +720,7 @@ namespace asg_form.Migrations modelBuilder.Entity("asg_form.Controllers.Champion+T_Champion", b => { - b.HasOne("asg_form.Controllers.Events+T_events", "events") + b.HasOne("asg_form.Model.T_events", "events") .WithMany() .HasForeignKey("eventsId") .OnDelete(DeleteBehavior.Cascade) @@ -675,9 +737,20 @@ namespace asg_form.Migrations b.Navigation("form"); }); + modelBuilder.Entity("asg_form.Controllers.Store.StoreinfoDB", b => + { + b.HasOne("asg_form.Controllers.Store.StoreDB", "Store") + .WithMany("buyer") + .HasForeignKey("Storeid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Store"); + }); + modelBuilder.Entity("asg_form.Controllers.form", b => { - b.HasOne("asg_form.Controllers.Events+T_events", "events") + b.HasOne("asg_form.Model.T_events", "events") .WithMany("forms") .HasForeignKey("eventsId") .OnDelete(DeleteBehavior.Cascade) @@ -717,9 +790,9 @@ namespace asg_form.Migrations b.Navigation("haveform"); }); - modelBuilder.Entity("asg_form.Controllers.Events+T_events", b => + modelBuilder.Entity("asg_form.Controllers.Store.StoreDB", b => { - b.Navigation("forms"); + b.Navigation("buyer"); }); modelBuilder.Entity("asg_form.Controllers.form", b => @@ -731,6 +804,11 @@ namespace asg_form.Migrations { b.Navigation("logs"); }); + + modelBuilder.Entity("asg_form.Model.T_events", b => + { + b.Navigation("forms"); + }); #pragma warning restore 612, 618 } } diff --git a/asg_form/Program.cs b/asg_form/Program.cs index 72af29e..ce76294 100644 --- a/asg_form/Program.cs +++ b/asg_form/Program.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using Mirai.Net.Sessions; @@ -21,6 +22,7 @@ using System.Text; Console.WriteLine("\n _____ _________ ________ \n / _ \\ / _____// _____/ \n / /_\\ \\ \\_____ \\/ \\ ___ \n/ | \\/ \\ \\_\\ \\\n\\____|__ /_______ /\\______ /\n \\/ \\/ \\/ \n__________ __ ___________ .___\n\\______ \\_____ ____ | | __\\_ _____/ ____ __| _/\n | | _/\\__ \\ _/ ___\\| |/ / | __)_ / \\ / __ | \n | | \\ / __ \\\\ \\___| < | \\ | \\/ /_/ | \n |______ /(____ /\\___ >__|_ \\/_______ /___| /\\____ | \n \\/ \\/ \\/ \\/ \\/ \\/ \\/ "); var builder = WebApplication.CreateBuilder(args); + //builder.AddServiceDefaults(); // Add services to the container.