Merge branch 'main' into ec

This commit is contained in:
lzw
2021-11-06 17:17:16 +08:00
27 changed files with 303 additions and 918 deletions

View File

@@ -1,199 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211029124310_yi-2")]
partial class yi2
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.11");
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_show")
.HasColumnType("int");
b.Property<int>("is_top")
.HasColumnType("int");
b.Property<string>("menu_name")
.HasColumnType("longtext");
b.Property<int?>("menuid")
.HasColumnType("int");
b.Property<int?>("mouldid")
.HasColumnType("int");
b.Property<int?>("roleid")
.HasColumnType("int");
b.Property<string>("router")
.HasColumnType("longtext");
b.Property<int>("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("menuid");
b.HasIndex("mouldid");
b.HasIndex("roleid");
b.ToTable("menu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("mould_name")
.HasColumnType("longtext");
b.Property<string>("url")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("introduce")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("role_name")
.HasColumnType("longtext");
b.Property<int?>("userid")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("userid");
b.ToTable("role");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("address")
.HasColumnType("longtext");
b.Property<int?>("age")
.HasColumnType("int");
b.Property<string>("email")
.HasColumnType("longtext");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<string>("introduction")
.HasColumnType("longtext");
b.Property<string>("ip")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("nick")
.HasColumnType("longtext");
b.Property<string>("password")
.HasColumnType("longtext");
b.Property<int?>("phone")
.HasColumnType("int");
b.Property<string>("username")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("user");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.HasOne("Yi.Framework.Model.Models.menu", null)
.WithMany("children")
.HasForeignKey("menuid");
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
.WithMany()
.HasForeignKey("mouldid");
b.HasOne("Yi.Framework.Model.Models.role", null)
.WithMany("menus")
.HasForeignKey("roleid");
b.Navigation("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.HasOne("Yi.Framework.Model.Models.user", null)
.WithMany("roles")
.HasForeignKey("userid");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Navigation("children");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Navigation("menus");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Navigation("roles");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,141 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Yi.Framework.Model.Migrations
{
public partial class yi2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "menurole");
migrationBuilder.DropTable(
name: "roleuser");
migrationBuilder.AddColumn<int>(
name: "userid",
table: "role",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "roleid",
table: "menu",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_role_userid",
table: "role",
column: "userid");
migrationBuilder.CreateIndex(
name: "IX_menu_roleid",
table: "menu",
column: "roleid");
migrationBuilder.AddForeignKey(
name: "FK_menu_role_roleid",
table: "menu",
column: "roleid",
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_role_user_userid",
table: "role",
column: "userid",
principalTable: "user",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_menu_role_roleid",
table: "menu");
migrationBuilder.DropForeignKey(
name: "FK_role_user_userid",
table: "role");
migrationBuilder.DropIndex(
name: "IX_role_userid",
table: "role");
migrationBuilder.DropIndex(
name: "IX_menu_roleid",
table: "menu");
migrationBuilder.DropColumn(
name: "userid",
table: "role");
migrationBuilder.DropColumn(
name: "roleid",
table: "menu");
migrationBuilder.CreateTable(
name: "menurole",
columns: table => new
{
menusid = table.Column<int>(type: "int", nullable: false),
rolesid = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_menurole", x => new { x.menusid, x.rolesid });
table.ForeignKey(
name: "FK_menurole_menu_menusid",
column: x => x.menusid,
principalTable: "menu",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_menurole_role_rolesid",
column: x => x.rolesid,
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "roleuser",
columns: table => new
{
rolesid = table.Column<int>(type: "int", nullable: false),
usersid = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_roleuser", x => new { x.rolesid, x.usersid });
table.ForeignKey(
name: "FK_roleuser_role_rolesid",
column: x => x.rolesid,
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_roleuser_user_usersid",
column: x => x.usersid,
principalTable: "user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_menurole_rolesid",
table: "menurole",
column: "rolesid");
migrationBuilder.CreateIndex(
name: "IX_roleuser_usersid",
table: "roleuser",
column: "usersid");
}
}
}

View File

@@ -1,199 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211030074708_yi-3")]
partial class yi3
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.11");
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_show")
.HasColumnType("int");
b.Property<int>("is_top")
.HasColumnType("int");
b.Property<string>("menu_name")
.HasColumnType("longtext");
b.Property<int?>("menuid")
.HasColumnType("int");
b.Property<int?>("mouldid")
.HasColumnType("int");
b.Property<int?>("roleid")
.HasColumnType("int");
b.Property<string>("router")
.HasColumnType("longtext");
b.Property<int>("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("menuid");
b.HasIndex("mouldid");
b.HasIndex("roleid");
b.ToTable("menu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("mould_name")
.HasColumnType("longtext");
b.Property<string>("url")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("introduce")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("role_name")
.HasColumnType("longtext");
b.Property<int?>("userid")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("userid");
b.ToTable("role");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("address")
.HasColumnType("longtext");
b.Property<int?>("age")
.HasColumnType("int");
b.Property<string>("email")
.HasColumnType("longtext");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<string>("introduction")
.HasColumnType("longtext");
b.Property<string>("ip")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("nick")
.HasColumnType("longtext");
b.Property<string>("password")
.HasColumnType("longtext");
b.Property<int?>("phone")
.HasColumnType("int");
b.Property<string>("username")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("user");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.HasOne("Yi.Framework.Model.Models.menu", null)
.WithMany("children")
.HasForeignKey("menuid");
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
.WithMany()
.HasForeignKey("mouldid");
b.HasOne("Yi.Framework.Model.Models.role", null)
.WithMany("menus")
.HasForeignKey("roleid");
b.Navigation("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.HasOne("Yi.Framework.Model.Models.user", null)
.WithMany("roles")
.HasForeignKey("userid");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Navigation("children");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Navigation("menus");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Navigation("roles");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,17 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Yi.Framework.Model.Migrations
{
public partial class yi3 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View File

@@ -1,219 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211030074922_yi-5")]
partial class yi5
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.11");
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_show")
.HasColumnType("int");
b.Property<int>("is_top")
.HasColumnType("int");
b.Property<string>("menu_name")
.HasColumnType("longtext");
b.Property<int?>("menuid")
.HasColumnType("int");
b.Property<int?>("mouldid")
.HasColumnType("int");
b.Property<int?>("roleid")
.HasColumnType("int");
b.Property<string>("router")
.HasColumnType("longtext");
b.Property<int>("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("menuid");
b.HasIndex("mouldid");
b.HasIndex("roleid");
b.ToTable("menu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("mould_name")
.HasColumnType("longtext");
b.Property<string>("url")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("introduce")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("role_name")
.HasColumnType("longtext");
b.Property<int?>("userid")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("userid");
b.ToTable("role");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("address")
.HasColumnType("longtext");
b.Property<int?>("age")
.HasColumnType("int");
b.Property<string>("email")
.HasColumnType("longtext");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<string>("introduction")
.HasColumnType("longtext");
b.Property<string>("ip")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("nick")
.HasColumnType("longtext");
b.Property<string>("password")
.HasColumnType("longtext");
b.Property<int?>("phone")
.HasColumnType("int");
b.Property<string>("username")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("user");
});
modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("num")
.HasColumnType("int");
b.Property<DateTime>("time")
.HasColumnType("datetime(6)");
b.HasKey("id");
b.ToTable("visit");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.HasOne("Yi.Framework.Model.Models.menu", null)
.WithMany("children")
.HasForeignKey("menuid");
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
.WithMany()
.HasForeignKey("mouldid");
b.HasOne("Yi.Framework.Model.Models.role", null)
.WithMany("menus")
.HasForeignKey("roleid");
b.Navigation("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.HasOne("Yi.Framework.Model.Models.user", null)
.WithMany("roles")
.HasForeignKey("userid");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Navigation("children");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Navigation("menus");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Navigation("roles");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,34 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Yi.Framework.Model.Migrations
{
public partial class yi5 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "visit",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
num = table.Column<int>(type: "int", nullable: false),
is_delete = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_visit", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "visit");
}
}
}

View File

@@ -9,7 +9,7 @@ using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211022181627_yi-1")]
[Migration("20211106082100_yi-1")]
partial class yi1
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -134,8 +134,8 @@ namespace Yi.Framework.Model.Migrations
b.Property<string>("password")
.HasColumnType("longtext");
b.Property<int?>("phone")
.HasColumnType("int");
b.Property<string>("phone")
.HasColumnType("longtext");
b.Property<string>("username")
.HasColumnType("longtext");
@@ -145,6 +145,26 @@ namespace Yi.Framework.Model.Migrations
b.ToTable("user");
});
modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("num")
.HasColumnType("int");
b.Property<DateTime>("time")
.HasColumnType("datetime(6)");
b.HasKey("id");
b.ToTable("visit");
});
modelBuilder.Entity("menurole", b =>
{
b.Property<int>("menusid")

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Metadata;
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Yi.Framework.Model.Migrations
@@ -69,7 +70,8 @@ namespace Yi.Framework.Model.Migrations
.Annotation("MySql:CharSet", "utf8mb4"),
address = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
phone = table.Column<int>(type: "int", nullable: true),
phone = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
is_delete = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
@@ -78,6 +80,22 @@ namespace Yi.Framework.Model.Migrations
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "visit",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
num = table.Column<int>(type: "int", nullable: false),
is_delete = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_visit", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "menu",
columns: table => new
@@ -194,6 +212,9 @@ namespace Yi.Framework.Model.Migrations
migrationBuilder.DropTable(
name: "roleuser");
migrationBuilder.DropTable(
name: "visit");
migrationBuilder.DropTable(
name: "menu");

View File

@@ -15,6 +15,9 @@ namespace Yi.Framework.Model.Models
public List<menu> children { get; set; }
public List<role> roles { get; set; }
public mould mould { get; set; }
}
}

View File

@@ -13,5 +13,6 @@ namespace Yi.Framework.Model.Models
public List<menu> menus { get; set; }
public List<user> users { get; set; }
}
}

View File

@@ -18,7 +18,7 @@ namespace Yi.Framework.Model.Models
public int? age { get; set; }
public string introduction { get; set; }
public string address { get; set; }
public int? phone { get; set; }
public string phone { get; set; }
public List<role> roles { get; set; }