diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json index d27f3c97..f6739957 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json @@ -23,11 +23,11 @@ "DbSelect": "Mysql", "DbConn": { - "WriteUrl": "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.", + "WriteUrl": "server=118.195.191.41;port=3306;database=YIECDB;user id=root;password=Qz52013142020.", "ReadUrl": [ - "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.", - "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.", - "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020." + "server=118.195.191.41;port=3306;database=YIECDB;user id=root;password=Qz52013142020.", + "server=118.195.191.41;port=3306;database=YIECDB;user id=root;password=Qz52013142020.", + "server=118.195.191.41;port=3306;database=YIECDB;user id=root;password=Qz52013142020." ] }, "Apollo": { diff --git a/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs b/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs index bf91c56d..12171726 100644 --- a/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs +++ b/Yi.Framework/Yi.Framework.Interface/T4Iservice.cs @@ -8,6 +8,18 @@ using Yi.Framework.Model.Models; namespace Yi.Framework.Interface { + public partial interface IBrandService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ICategoryService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + public partial interface IMenuService:IBaseService { Task DelListByUpdateAsync(List _ids); @@ -20,12 +32,54 @@ namespace Yi.Framework.Interface Task> GetAllEntitiesTrueAsync(); } + public partial interface IOrderService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + public partial interface IRoleService:IBaseService { Task DelListByUpdateAsync(List _ids); Task> GetAllEntitiesTrueAsync(); } + public partial interface ISkuService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpec_groupService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpec_paramService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpuService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface ISpu_detailService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + + public partial interface IStockService:IBaseService + { + Task DelListByUpdateAsync(List _ids); + Task> GetAllEntitiesTrueAsync(); + } + public partial interface IUserService:IBaseService { Task DelListByUpdateAsync(List _ids); diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.Designer.cs new file mode 100644 index 00000000..98620124 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.Designer.cs @@ -0,0 +1,219 @@ +// +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("20211106080544_ec1")] + partial class ec1 + { + 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("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_show") + .HasColumnType("int"); + + b.Property("is_top") + .HasColumnType("int"); + + b.Property("menu_name") + .HasColumnType("longtext"); + + b.Property("menuid") + .HasColumnType("int"); + + b.Property("mouldid") + .HasColumnType("int"); + + b.Property("roleid") + .HasColumnType("int"); + + b.Property("router") + .HasColumnType("longtext"); + + b.Property("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("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("mould_name") + .HasColumnType("longtext"); + + b.Property("url") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("introduce") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("role_name") + .HasColumnType("longtext"); + + b.Property("userid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("userid"); + + b.ToTable("role"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("address") + .HasColumnType("longtext"); + + b.Property("age") + .HasColumnType("int"); + + b.Property("email") + .HasColumnType("longtext"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("introduction") + .HasColumnType("longtext"); + + b.Property("ip") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("nick") + .HasColumnType("longtext"); + + b.Property("password") + .HasColumnType("longtext"); + + b.Property("phone") + .HasColumnType("int"); + + b.Property("username") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("user"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.visit", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("num") + .HasColumnType("int"); + + b.Property("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 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.cs new file mode 100644 index 00000000..baaf79d9 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec1 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.Designer.cs new file mode 100644 index 00000000..6d9fb503 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.Designer.cs @@ -0,0 +1,732 @@ +// +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("20211106080646_ec2")] + partial class ec2 + { + 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.brand", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("image") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("letter") + .HasColumnType("longtext"); + + b.Property("name") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("brand"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand_category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandId") + .HasColumnType("int"); + + b.Property("categoryId") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("brandId"); + + b.HasIndex("categoryId"); + + b.ToTable("brand_category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_parent") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext"); + + b.Property("sort") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_show") + .HasColumnType("int"); + + b.Property("is_top") + .HasColumnType("int"); + + b.Property("menu_name") + .HasColumnType("longtext"); + + b.Property("menuid") + .HasColumnType("int"); + + b.Property("mouldid") + .HasColumnType("int"); + + b.Property("roleid") + .HasColumnType("int"); + + b.Property("router") + .HasColumnType("longtext"); + + b.Property("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("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("mould_name") + .HasColumnType("longtext"); + + b.Property("url") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("actual_pay") + .HasColumnType("int"); + + b.Property("buyer_message") + .HasColumnType("longtext"); + + b.Property("buyer_nick") + .HasColumnType("longtext"); + + b.Property("buyer_rate") + .HasColumnType("int"); + + b.Property("creat_time") + .HasColumnType("datetime(6)"); + + b.Property("invoice_type") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("payment_type") + .HasColumnType("int"); + + b.Property("post_fee") + .HasColumnType("int"); + + b.Property("promotion_ids") + .HasColumnType("longtext"); + + b.Property("receiver") + .HasColumnType("longtext"); + + b.Property("receiver_address") + .HasColumnType("longtext"); + + b.Property("receiver_city") + .HasColumnType("longtext"); + + b.Property("receiver_district") + .HasColumnType("longtext"); + + b.Property("receiver_mobile") + .HasColumnType("longtext"); + + b.Property("receiver_state") + .HasColumnType("longtext"); + + b.Property("receiver_zip") + .HasColumnType("longtext"); + + b.Property("shipping_code") + .HasColumnType("longtext"); + + b.Property("shipping_name") + .HasColumnType("longtext"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("source_type") + .HasColumnType("int"); + + b.Property("total_pay") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("order"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("introduce") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("role_name") + .HasColumnType("longtext"); + + b.Property("userid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("userid"); + + b.ToTable("role"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)"); + + b.Property("enable") + .HasColumnType("int"); + + b.Property("images") + .HasColumnType("longtext"); + + b.Property("indexes") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)"); + + b.Property("own_spec") + .HasColumnType("longtext"); + + b.Property("price") + .HasColumnType("int"); + + b.Property("spuid") + .HasColumnType("int"); + + b.Property("title") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.HasIndex("spuid"); + + b.ToTable("sku"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("spec_group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("generic") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext"); + + b.Property("numeric") + .HasColumnType("int"); + + b.Property("searching") + .HasColumnType("int"); + + b.Property("segments") + .HasColumnType("longtext"); + + b.Property("spec_Groupid") + .HasColumnType("int"); + + b.Property("unit") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.HasIndex("spec_Groupid"); + + b.ToTable("spec_param"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandid") + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)"); + + b.Property("saleable") + .HasColumnType("int"); + + b.Property("spu_Detailid") + .HasColumnType("int"); + + b.Property("sub_title") + .HasColumnType("longtext"); + + b.Property("title") + .HasColumnType("longtext"); + + b.Property("valid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("brandid"); + + b.HasIndex("spu_Detailid"); + + b.ToTable("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("after_service") + .HasColumnType("longtext"); + + b.Property("description") + .HasColumnType("longtext"); + + b.Property("generic_spec") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("packing_list") + .HasColumnType("longtext"); + + b.Property("special_spec") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("spu_detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("seckill_stock") + .HasColumnType("int"); + + b.Property("seckill_total") + .HasColumnType("int"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("stock_count") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("stock"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("address") + .HasColumnType("longtext"); + + b.Property("age") + .HasColumnType("int"); + + b.Property("email") + .HasColumnType("longtext"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("introduction") + .HasColumnType("longtext"); + + b.Property("ip") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("nick") + .HasColumnType("longtext"); + + b.Property("password") + .HasColumnType("longtext"); + + b.Property("phone") + .HasColumnType("int"); + + b.Property("username") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("user"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.visit", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("num") + .HasColumnType("int"); + + b.Property("time") + .HasColumnType("datetime(6)"); + + b.HasKey("id"); + + b.ToTable("visit"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.Property("categoriesid") + .HasColumnType("int"); + + b.Property("spusid") + .HasColumnType("int"); + + b.HasKey("categoriesid", "spusid"); + + b.HasIndex("spusid"); + + b.ToTable("categoryspu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand_category", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("categories") + .HasForeignKey("brandId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("brands") + .HasForeignKey("categoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("brand"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany("chidrens") + .HasForeignKey("categoryid"); + }); + + 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.order", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", null) + .WithMany("orders") + .HasForeignKey("skuid"); + }); + + 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.sku", b => + { + b.HasOne("Yi.Framework.Model.Models.spu", "spu") + .WithMany("skus") + .HasForeignKey("spuid"); + + b.Navigation("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Groups") + .HasForeignKey("categoryid"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Params") + .HasForeignKey("categoryid"); + + b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group") + .WithMany("spec_Params") + .HasForeignKey("spec_Groupid"); + + b.Navigation("category"); + + b.Navigation("spec_Group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("spus") + .HasForeignKey("brandid"); + + b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail") + .WithMany() + .HasForeignKey("spu_Detailid"); + + b.Navigation("brand"); + + b.Navigation("spu_Detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", "sku") + .WithMany() + .HasForeignKey("skuid"); + + b.Navigation("sku"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.spu", null) + .WithMany() + .HasForeignKey("spusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Navigation("categories"); + + b.Navigation("spus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Navigation("brands"); + + b.Navigation("chidrens"); + + b.Navigation("spec_Groups"); + + b.Navigation("spec_Params"); + }); + + 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.sku", b => + { + b.Navigation("orders"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Navigation("skus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Navigation("roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.cs new file mode 100644 index 00000000..6ffc7373 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.cs @@ -0,0 +1,436 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec2 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "brand", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + image = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + letter = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brand", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "category", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + sort = table.Column(type: "int", nullable: false), + is_parent = table.Column(type: "int", nullable: false), + categoryid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_category", x => x.id); + table.ForeignKey( + name: "FK_category_category_categoryid", + column: x => x.categoryid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spu_detail", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + generic_spec = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + special_spec = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + packing_list = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + after_service = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spu_detail", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "brand_category", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + brandId = table.Column(type: "int", nullable: false), + categoryId = table.Column(type: "int", nullable: false), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brand_category", x => x.id); + table.ForeignKey( + name: "FK_brand_category_brand_brandId", + column: x => x.brandId, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_brand_category_category_categoryId", + column: x => x.categoryId, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spec_group", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + categoryid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spec_group", x => x.id); + table.ForeignKey( + name: "FK_spec_group_category_categoryid", + column: x => x.categoryid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spu", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + sub_title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + saleable = table.Column(type: "int", nullable: false), + valid = table.Column(type: "int", nullable: false), + crate_time = table.Column(type: "datetime(6)", nullable: false), + last_update_time = table.Column(type: "datetime(6)", nullable: false), + brandid = table.Column(type: "int", nullable: true), + spu_Detailid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spu", x => x.id); + table.ForeignKey( + name: "FK_spu_brand_brandid", + column: x => x.brandid, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_spu_spu_detail_spu_Detailid", + column: x => x.spu_Detailid, + principalTable: "spu_detail", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "spec_param", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + numeric = table.Column(type: "int", nullable: false), + unit = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + generic = table.Column(type: "int", nullable: false), + searching = table.Column(type: "int", nullable: false), + segments = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + spec_Groupid = table.Column(type: "int", nullable: true), + categoryid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_spec_param", x => x.id); + table.ForeignKey( + name: "FK_spec_param_category_categoryid", + column: x => x.categoryid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_spec_param_spec_group_spec_Groupid", + column: x => x.spec_Groupid, + principalTable: "spec_group", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "categoryspu", + columns: table => new + { + categoriesid = table.Column(type: "int", nullable: false), + spusid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_categoryspu", x => new { x.categoriesid, x.spusid }); + table.ForeignKey( + name: "FK_categoryspu_category_categoriesid", + column: x => x.categoriesid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_categoryspu_spu_spusid", + column: x => x.spusid, + principalTable: "spu", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "sku", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + images = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + price = table.Column(type: "int", nullable: false), + indexes = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + enable = table.Column(type: "int", nullable: false), + own_spec = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + crate_time = table.Column(type: "datetime(6)", nullable: false), + last_update_time = table.Column(type: "datetime(6)", nullable: false), + spuid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_sku", x => x.id); + table.ForeignKey( + name: "FK_sku_spu_spuid", + column: x => x.spuid, + principalTable: "spu", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "order", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + total_pay = table.Column(type: "int", nullable: false), + actual_pay = table.Column(type: "int", nullable: false), + payment_type = table.Column(type: "int", nullable: false), + post_fee = table.Column(type: "int", nullable: false), + promotion_ids = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + creat_time = table.Column(type: "datetime(6)", nullable: false), + shipping_name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + shipping_code = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + buyer_message = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + buyer_nick = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + buyer_rate = table.Column(type: "int", nullable: false), + receiver_state = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_city = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_district = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_address = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_mobile = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver_zip = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + receiver = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + invoice_type = table.Column(type: "int", nullable: false), + source_type = table.Column(type: "int", nullable: false), + skuid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_order", x => x.id); + table.ForeignKey( + name: "FK_order_sku_skuid", + column: x => x.skuid, + principalTable: "sku", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "stock", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + seckill_stock = table.Column(type: "int", nullable: false), + seckill_total = table.Column(type: "int", nullable: false), + stock_count = table.Column(type: "int", nullable: false), + skuid = table.Column(type: "int", nullable: true), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_stock", x => x.id); + table.ForeignKey( + name: "FK_stock_sku_skuid", + column: x => x.skuid, + principalTable: "sku", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_brandId", + table: "brand_category", + column: "brandId"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_categoryId", + table: "brand_category", + column: "categoryId"); + + migrationBuilder.CreateIndex( + name: "IX_category_categoryid", + table: "category", + column: "categoryid"); + + migrationBuilder.CreateIndex( + name: "IX_categoryspu_spusid", + table: "categoryspu", + column: "spusid"); + + migrationBuilder.CreateIndex( + name: "IX_order_skuid", + table: "order", + column: "skuid"); + + migrationBuilder.CreateIndex( + name: "IX_sku_spuid", + table: "sku", + column: "spuid"); + + migrationBuilder.CreateIndex( + name: "IX_spec_group_categoryid", + table: "spec_group", + column: "categoryid"); + + migrationBuilder.CreateIndex( + name: "IX_spec_param_categoryid", + table: "spec_param", + column: "categoryid"); + + migrationBuilder.CreateIndex( + name: "IX_spec_param_spec_Groupid", + table: "spec_param", + column: "spec_Groupid"); + + migrationBuilder.CreateIndex( + name: "IX_spu_brandid", + table: "spu", + column: "brandid"); + + migrationBuilder.CreateIndex( + name: "IX_spu_spu_Detailid", + table: "spu", + column: "spu_Detailid"); + + migrationBuilder.CreateIndex( + name: "IX_stock_skuid", + table: "stock", + column: "skuid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "brand_category"); + + migrationBuilder.DropTable( + name: "categoryspu"); + + migrationBuilder.DropTable( + name: "order"); + + migrationBuilder.DropTable( + name: "spec_param"); + + migrationBuilder.DropTable( + name: "stock"); + + migrationBuilder.DropTable( + name: "spec_group"); + + migrationBuilder.DropTable( + name: "sku"); + + migrationBuilder.DropTable( + name: "category"); + + migrationBuilder.DropTable( + name: "spu"); + + migrationBuilder.DropTable( + name: "brand"); + + migrationBuilder.DropTable( + name: "spu_detail"); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.Designer.cs new file mode 100644 index 00000000..8c0467c2 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.Designer.cs @@ -0,0 +1,770 @@ +// +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("20211106084427_ec3")] + partial class ec3 + { + 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.brand", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("image") + .HasColumnType("longtext") + .HasComment("品牌图片"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("letter") + .HasColumnType("longtext") + .HasComment("品牌首字母"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("品牌名称"); + + b.HasKey("id"); + + b.ToTable("brand"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_parent") + .HasColumnType("int") + .HasComment("是否父类别"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("类别名称"); + + b.Property("sort") + .HasColumnType("int") + .HasComment("排序"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_show") + .HasColumnType("int"); + + b.Property("is_top") + .HasColumnType("int"); + + b.Property("menu_name") + .HasColumnType("longtext"); + + b.Property("menuid") + .HasColumnType("int"); + + b.Property("mouldid") + .HasColumnType("int"); + + b.Property("roleid") + .HasColumnType("int"); + + b.Property("router") + .HasColumnType("longtext"); + + b.Property("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("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("mould_name") + .HasColumnType("longtext"); + + b.Property("url") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("mould"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("actual_pay") + .HasColumnType("int") + .HasComment("实付金额。单位:分。如:20007,表示:200元7分"); + + b.Property("buyer_message") + .HasColumnType("longtext") + .HasComment("买家留言"); + + b.Property("buyer_nick") + .HasColumnType("longtext") + .HasComment("买家昵称"); + + b.Property("buyer_rate") + .HasColumnType("int") + .HasComment("买家是否已经评价,0未评价,1已评价"); + + b.Property("creat_time") + .HasColumnType("datetime(6)") + .HasComment("订单创建时间"); + + b.Property("invoice_type") + .HasColumnType("int") + .HasComment("发票类型:0无发票1普通发票,2电子发票,3增值税发票"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("payment_type") + .HasColumnType("int") + .HasComment("支付类型,1、在线支付,2、货到付款"); + + b.Property("post_fee") + .HasColumnType("int") + .HasComment("邮费。单位:分。如:20007,表示:200元7分"); + + b.Property("promotion_ids") + .HasColumnType("longtext") + .HasComment("promotion_ids"); + + b.Property("receiver") + .HasColumnType("longtext") + .HasComment("收货人"); + + b.Property("receiver_address") + .HasColumnType("longtext") + .HasComment("收获地址(街道、住址等详细地址)"); + + b.Property("receiver_city") + .HasColumnType("longtext") + .HasComment("收获地址(市)"); + + b.Property("receiver_district") + .HasColumnType("longtext") + .HasComment("收获地址(区/县)"); + + b.Property("receiver_mobile") + .HasColumnType("longtext") + .HasComment("收货人手机"); + + b.Property("receiver_state") + .HasColumnType("longtext") + .HasComment("收获地址(省)"); + + b.Property("receiver_zip") + .HasColumnType("longtext") + .HasComment("收货人邮编"); + + b.Property("shipping_code") + .HasColumnType("longtext") + .HasComment("物流单号"); + + b.Property("shipping_name") + .HasColumnType("longtext") + .HasComment("物流名称"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("source_type") + .HasColumnType("int") + .HasComment("订单来源:1:app端,2:pc端,3:M端,4:微信端,5:手机qq端"); + + b.Property("total_pay") + .HasColumnType("int") + .HasComment("总金额,单位为分"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("order"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("introduce") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("role_name") + .HasColumnType("longtext"); + + b.Property("userid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("userid"); + + b.ToTable("role"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("创建时间"); + + b.Property("enable") + .HasColumnType("int") + .HasComment("是否有效,0无效,1有效"); + + b.Property("images") + .HasColumnType("longtext") + .HasComment("商品的图片,多个图片以‘,’分割"); + + b.Property("indexes") + .HasColumnType("longtext") + .HasComment("特有规格属性在spu属性模板中的对应下标组合"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("最后更新时间"); + + b.Property("own_spec") + .HasColumnType("longtext") + .HasComment("sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序"); + + b.Property("price") + .HasColumnType("int") + .HasComment("销售价格,单位为分"); + + b.Property("spuid") + .HasColumnType("int"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("商品标题"); + + b.HasKey("id"); + + b.HasIndex("spuid"); + + b.ToTable("sku"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("规格组名称"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("spec_group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("generic") + .HasColumnType("int") + .HasComment("是否是sku通用属性,true或false"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("参数名"); + + b.Property("numeric") + .HasColumnType("int") + .HasComment("是否是数字类型参数,true或false"); + + b.Property("searching") + .HasColumnType("int") + .HasComment("是否用于搜索过滤,true或false"); + + b.Property("segments") + .HasColumnType("longtext") + .HasComment("数值类型参数,如果需要搜索,则添加分段间隔值,如CPU频率间隔:0.5-1.0"); + + b.Property("spec_Groupid") + .HasColumnType("int"); + + b.Property("unit") + .HasColumnType("longtext") + .HasComment("数字类型参数的单位,非数字类型可以为空"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.HasIndex("spec_Groupid"); + + b.ToTable("spec_param"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandid") + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("创建时间"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("最后更新时间"); + + b.Property("saleable") + .HasColumnType("int") + .HasComment("是否上架"); + + b.Property("spu_Detailid") + .HasColumnType("int"); + + b.Property("sub_title") + .HasColumnType("longtext") + .HasComment("子标题"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("标题"); + + b.Property("valid") + .HasColumnType("int") + .HasComment("是否有效"); + + b.HasKey("id"); + + b.HasIndex("brandid"); + + b.HasIndex("spu_Detailid"); + + b.ToTable("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("after_service") + .HasColumnType("longtext") + .HasComment("售后服务"); + + b.Property("description") + .HasColumnType("longtext") + .HasComment("描述"); + + b.Property("generic_spec") + .HasColumnType("longtext") + .HasComment("通用规格参数数据"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("packing_list") + .HasColumnType("longtext") + .HasComment("包装清单"); + + b.Property("special_spec") + .HasColumnType("longtext") + .HasComment("特有规格参数及可选值信息,json格式"); + + b.HasKey("id"); + + b.ToTable("spu_detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("seckill_stock") + .HasColumnType("int") + .HasComment("可秒杀库存"); + + b.Property("seckill_total") + .HasColumnType("int") + .HasComment("秒杀总数量"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("stock_count") + .HasColumnType("int") + .HasComment("库存数量"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("stock"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("address") + .HasColumnType("longtext"); + + b.Property("age") + .HasColumnType("int"); + + b.Property("email") + .HasColumnType("longtext"); + + b.Property("icon") + .HasColumnType("longtext"); + + b.Property("introduction") + .HasColumnType("longtext"); + + b.Property("ip") + .HasColumnType("longtext"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("nick") + .HasColumnType("longtext"); + + b.Property("password") + .HasColumnType("longtext"); + + b.Property("phone") + .HasColumnType("int"); + + b.Property("username") + .HasColumnType("longtext"); + + b.HasKey("id"); + + b.ToTable("user"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.visit", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("num") + .HasColumnType("int"); + + b.Property("time") + .HasColumnType("datetime(6)"); + + b.HasKey("id"); + + b.ToTable("visit"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.Property("brandsid") + .HasColumnType("int"); + + b.Property("categoriesid") + .HasColumnType("int"); + + b.HasKey("brandsid", "categoriesid"); + + b.HasIndex("categoriesid"); + + b.ToTable("brandcategory"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.Property("categoriesid") + .HasColumnType("int"); + + b.Property("spusid") + .HasColumnType("int"); + + b.HasKey("categoriesid", "spusid"); + + b.HasIndex("spusid"); + + b.ToTable("categoryspu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany("chidrens") + .HasForeignKey("categoryid"); + }); + + 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.order", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", null) + .WithMany("orders") + .HasForeignKey("skuid"); + }); + + 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.sku", b => + { + b.HasOne("Yi.Framework.Model.Models.spu", "spu") + .WithMany("skus") + .HasForeignKey("spuid"); + + b.Navigation("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Groups") + .HasForeignKey("categoryid"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Params") + .HasForeignKey("categoryid"); + + b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group") + .WithMany("spec_Params") + .HasForeignKey("spec_Groupid"); + + b.Navigation("category"); + + b.Navigation("spec_Group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("spus") + .HasForeignKey("brandid"); + + b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail") + .WithMany() + .HasForeignKey("spu_Detailid"); + + b.Navigation("brand"); + + b.Navigation("spu_Detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", "sku") + .WithMany() + .HasForeignKey("skuid"); + + b.Navigation("sku"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", null) + .WithMany() + .HasForeignKey("brandsid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.spu", null) + .WithMany() + .HasForeignKey("spusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Navigation("spus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Navigation("chidrens"); + + b.Navigation("spec_Groups"); + + b.Navigation("spec_Params"); + }); + + 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.sku", b => + { + b.Navigation("orders"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Navigation("skus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => + { + b.Navigation("roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.cs new file mode 100644 index 00000000..c88a2028 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.cs @@ -0,0 +1,1265 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec3 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "brand_category"); + + migrationBuilder.AlterColumn( + name: "stock_count", + table: "stock", + type: "int", + nullable: false, + comment: "库存数量", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "seckill_total", + table: "stock", + type: "int", + nullable: false, + comment: "秒杀总数量", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "seckill_stock", + table: "stock", + type: "int", + nullable: false, + comment: "可秒杀库存", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "special_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "特有规格参数及可选值信息,json格式", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "packing_list", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "包装清单", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "通用规格参数数据", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "description", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "描述", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "after_service", + table: "spu_detail", + type: "longtext", + nullable: true, + comment: "售后服务", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "valid", + table: "spu", + type: "int", + nullable: false, + comment: "是否有效", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "title", + table: "spu", + type: "longtext", + nullable: true, + comment: "标题", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "sub_title", + table: "spu", + type: "longtext", + nullable: true, + comment: "子标题", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "saleable", + table: "spu", + type: "int", + nullable: false, + comment: "是否上架", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "spu", + type: "datetime(6)", + nullable: false, + comment: "最后更新时间", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "spu", + type: "datetime(6)", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "unit", + table: "spec_param", + type: "longtext", + nullable: true, + comment: "数字类型参数的单位,非数字类型可以为空", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "segments", + table: "spec_param", + type: "longtext", + nullable: true, + comment: "数值类型参数,如果需要搜索,则添加分段间隔值,如CPU频率间隔:0.5-1.0", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "searching", + table: "spec_param", + type: "int", + nullable: false, + comment: "是否用于搜索过滤,true或false", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "numeric", + table: "spec_param", + type: "int", + nullable: false, + comment: "是否是数字类型参数,true或false", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_param", + type: "longtext", + nullable: true, + comment: "参数名", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic", + table: "spec_param", + type: "int", + nullable: false, + comment: "是否是sku通用属性,true或false", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_group", + type: "longtext", + nullable: true, + comment: "规格组名称", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "title", + table: "sku", + type: "longtext", + nullable: true, + comment: "商品标题", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "price", + table: "sku", + type: "int", + nullable: false, + comment: "销售价格,单位为分", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "own_spec", + table: "sku", + type: "longtext", + nullable: true, + comment: "sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "sku", + type: "datetime(6)", + nullable: false, + comment: "最后更新时间", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "indexes", + table: "sku", + type: "longtext", + nullable: true, + comment: "特有规格属性在spu属性模板中的对应下标组合", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "images", + table: "sku", + type: "longtext", + nullable: true, + comment: "商品的图片,多个图片以‘,’分割", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "enable", + table: "sku", + type: "int", + nullable: false, + comment: "是否有效,0无效,1有效", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "sku", + type: "datetime(6)", + nullable: false, + comment: "创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "total_pay", + table: "order", + type: "int", + nullable: false, + comment: "总金额,单位为分", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "source_type", + table: "order", + type: "int", + nullable: false, + comment: "订单来源:1:app端,2:pc端,3:M端,4:微信端,5:手机qq端", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "shipping_name", + table: "order", + type: "longtext", + nullable: true, + comment: "物流名称", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "shipping_code", + table: "order", + type: "longtext", + nullable: true, + comment: "物流单号", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_zip", + table: "order", + type: "longtext", + nullable: true, + comment: "收货人邮编", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_state", + table: "order", + type: "longtext", + nullable: true, + comment: "收获地址(省)", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_mobile", + table: "order", + type: "longtext", + nullable: true, + comment: "收货人手机", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_district", + table: "order", + type: "longtext", + nullable: true, + comment: "收获地址(区/县)", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_city", + table: "order", + type: "longtext", + nullable: true, + comment: "收获地址(市)", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_address", + table: "order", + type: "longtext", + nullable: true, + comment: "收获地址(街道、住址等详细地址)", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver", + table: "order", + type: "longtext", + nullable: true, + comment: "收货人", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "promotion_ids", + table: "order", + type: "longtext", + nullable: true, + comment: "promotion_ids", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "post_fee", + table: "order", + type: "int", + nullable: false, + comment: "邮费。单位:分。如:20007,表示:200元7分", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "payment_type", + table: "order", + type: "int", + nullable: false, + comment: "支付类型,1、在线支付,2、货到付款", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "invoice_type", + table: "order", + type: "int", + nullable: false, + comment: "发票类型:0无发票1普通发票,2电子发票,3增值税发票", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "creat_time", + table: "order", + type: "datetime(6)", + nullable: false, + comment: "订单创建时间", + oldClrType: typeof(DateTime), + oldType: "datetime(6)"); + + migrationBuilder.AlterColumn( + name: "buyer_rate", + table: "order", + type: "int", + nullable: false, + comment: "买家是否已经评价,0未评价,1已评价", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "buyer_nick", + table: "order", + type: "longtext", + nullable: true, + comment: "买家昵称", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "buyer_message", + table: "order", + type: "longtext", + nullable: true, + comment: "买家留言", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "actual_pay", + table: "order", + type: "int", + nullable: false, + comment: "实付金额。单位:分。如:20007,表示:200元7分", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "sort", + table: "category", + type: "int", + nullable: false, + comment: "排序", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "category", + type: "longtext", + nullable: true, + comment: "类别名称", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "is_parent", + table: "category", + type: "int", + nullable: false, + comment: "是否父类别", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "name", + table: "brand", + type: "longtext", + nullable: true, + comment: "品牌名称", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "letter", + table: "brand", + type: "longtext", + nullable: true, + comment: "品牌首字母", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "image", + table: "brand", + type: "longtext", + nullable: true, + comment: "品牌图片", + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "brandcategory", + columns: table => new + { + brandsid = table.Column(type: "int", nullable: false), + categoriesid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brandcategory", x => new { x.brandsid, x.categoriesid }); + table.ForeignKey( + name: "FK_brandcategory_brand_brandsid", + column: x => x.brandsid, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_brandcategory_category_categoriesid", + column: x => x.categoriesid, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_brandcategory_categoriesid", + table: "brandcategory", + column: "categoriesid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "brandcategory"); + + migrationBuilder.AlterColumn( + name: "stock_count", + table: "stock", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "库存数量"); + + migrationBuilder.AlterColumn( + name: "seckill_total", + table: "stock", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "秒杀总数量"); + + migrationBuilder.AlterColumn( + name: "seckill_stock", + table: "stock", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "可秒杀库存"); + + migrationBuilder.AlterColumn( + name: "special_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "特有规格参数及可选值信息,json格式") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "packing_list", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "包装清单") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic_spec", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "通用规格参数数据") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "description", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "描述") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "after_service", + table: "spu_detail", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "售后服务") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "valid", + table: "spu", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "是否有效"); + + migrationBuilder.AlterColumn( + name: "title", + table: "spu", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "标题") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "sub_title", + table: "spu", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "子标题") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "saleable", + table: "spu", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "是否上架"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "spu", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "最后更新时间"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "spu", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "unit", + table: "spec_param", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "数字类型参数的单位,非数字类型可以为空") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "segments", + table: "spec_param", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "数值类型参数,如果需要搜索,则添加分段间隔值,如CPU频率间隔:0.5-1.0") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "searching", + table: "spec_param", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "是否用于搜索过滤,true或false"); + + migrationBuilder.AlterColumn( + name: "numeric", + table: "spec_param", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "是否是数字类型参数,true或false"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_param", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "参数名") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "generic", + table: "spec_param", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "是否是sku通用属性,true或false"); + + migrationBuilder.AlterColumn( + name: "name", + table: "spec_group", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "规格组名称") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "title", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "商品标题") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "price", + table: "sku", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "销售价格,单位为分"); + + migrationBuilder.AlterColumn( + name: "own_spec", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "last_update_time", + table: "sku", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "最后更新时间"); + + migrationBuilder.AlterColumn( + name: "indexes", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "特有规格属性在spu属性模板中的对应下标组合") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "images", + table: "sku", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "商品的图片,多个图片以‘,’分割") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "enable", + table: "sku", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "是否有效,0无效,1有效"); + + migrationBuilder.AlterColumn( + name: "crate_time", + table: "sku", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "创建时间"); + + migrationBuilder.AlterColumn( + name: "total_pay", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "总金额,单位为分"); + + migrationBuilder.AlterColumn( + name: "source_type", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "订单来源:1:app端,2:pc端,3:M端,4:微信端,5:手机qq端"); + + migrationBuilder.AlterColumn( + name: "shipping_name", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "物流名称") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "shipping_code", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "物流单号") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_zip", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "收货人邮编") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_state", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "收获地址(省)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_mobile", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "收货人手机") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_district", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "收获地址(区/县)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_city", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "收获地址(市)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver_address", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "收获地址(街道、住址等详细地址)") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "receiver", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "收货人") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "promotion_ids", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "promotion_ids") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "post_fee", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "邮费。单位:分。如:20007,表示:200元7分"); + + migrationBuilder.AlterColumn( + name: "payment_type", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "支付类型,1、在线支付,2、货到付款"); + + migrationBuilder.AlterColumn( + name: "invoice_type", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "发票类型:0无发票1普通发票,2电子发票,3增值税发票"); + + migrationBuilder.AlterColumn( + name: "creat_time", + table: "order", + type: "datetime(6)", + nullable: false, + oldClrType: typeof(DateTime), + oldType: "datetime(6)", + oldComment: "订单创建时间"); + + migrationBuilder.AlterColumn( + name: "buyer_rate", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "买家是否已经评价,0未评价,1已评价"); + + migrationBuilder.AlterColumn( + name: "buyer_nick", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "买家昵称") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "buyer_message", + table: "order", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "买家留言") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "actual_pay", + table: "order", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "实付金额。单位:分。如:20007,表示:200元7分"); + + migrationBuilder.AlterColumn( + name: "sort", + table: "category", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "排序"); + + migrationBuilder.AlterColumn( + name: "name", + table: "category", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "类别名称") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "is_parent", + table: "category", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "是否父类别"); + + migrationBuilder.AlterColumn( + name: "name", + table: "brand", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "品牌名称") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "letter", + table: "brand", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "品牌首字母") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "image", + table: "brand", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true, + oldComment: "品牌图片") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "brand_category", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + brandId = table.Column(type: "int", nullable: false), + categoryId = table.Column(type: "int", nullable: false), + is_delete = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_brand_category", x => x.id); + table.ForeignKey( + name: "FK_brand_category_brand_brandId", + column: x => x.brandId, + principalTable: "brand", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_brand_category_category_categoryId", + column: x => x.categoryId, + principalTable: "category", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_brandId", + table: "brand_category", + column: "brandId"); + + migrationBuilder.CreateIndex( + name: "IX_brand_category_categoryId", + table: "brand_category", + column: "categoryId"); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs b/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs index 42c7f861..1e7b9bed 100644 --- a/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs +++ b/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs @@ -17,6 +17,63 @@ namespace Yi.Framework.Model.Migrations .HasAnnotation("Relational:MaxIdentifierLength", 64) .HasAnnotation("ProductVersion", "5.0.11"); + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("image") + .HasColumnType("longtext") + .HasComment("品牌图片"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("letter") + .HasColumnType("longtext") + .HasComment("品牌首字母"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("品牌名称"); + + b.HasKey("id"); + + b.ToTable("brand"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("is_parent") + .HasColumnType("int") + .HasComment("是否父类别"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("类别名称"); + + b.Property("sort") + .HasColumnType("int") + .HasComment("排序"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("category"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => { b.Property("id") @@ -84,6 +141,105 @@ namespace Yi.Framework.Model.Migrations b.ToTable("mould"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("actual_pay") + .HasColumnType("int") + .HasComment("实付金额。单位:分。如:20007,表示:200元7分"); + + b.Property("buyer_message") + .HasColumnType("longtext") + .HasComment("买家留言"); + + b.Property("buyer_nick") + .HasColumnType("longtext") + .HasComment("买家昵称"); + + b.Property("buyer_rate") + .HasColumnType("int") + .HasComment("买家是否已经评价,0未评价,1已评价"); + + b.Property("creat_time") + .HasColumnType("datetime(6)") + .HasComment("订单创建时间"); + + b.Property("invoice_type") + .HasColumnType("int") + .HasComment("发票类型:0无发票1普通发票,2电子发票,3增值税发票"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("payment_type") + .HasColumnType("int") + .HasComment("支付类型,1、在线支付,2、货到付款"); + + b.Property("post_fee") + .HasColumnType("int") + .HasComment("邮费。单位:分。如:20007,表示:200元7分"); + + b.Property("promotion_ids") + .HasColumnType("longtext") + .HasComment("promotion_ids"); + + b.Property("receiver") + .HasColumnType("longtext") + .HasComment("收货人"); + + b.Property("receiver_address") + .HasColumnType("longtext") + .HasComment("收获地址(街道、住址等详细地址)"); + + b.Property("receiver_city") + .HasColumnType("longtext") + .HasComment("收获地址(市)"); + + b.Property("receiver_district") + .HasColumnType("longtext") + .HasComment("收获地址(区/县)"); + + b.Property("receiver_mobile") + .HasColumnType("longtext") + .HasComment("收货人手机"); + + b.Property("receiver_state") + .HasColumnType("longtext") + .HasComment("收获地址(省)"); + + b.Property("receiver_zip") + .HasColumnType("longtext") + .HasComment("收货人邮编"); + + b.Property("shipping_code") + .HasColumnType("longtext") + .HasComment("物流单号"); + + b.Property("shipping_name") + .HasColumnType("longtext") + .HasComment("物流名称"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("source_type") + .HasColumnType("int") + .HasComment("订单来源:1:app端,2:pc端,3:M端,4:微信端,5:手机qq端"); + + b.Property("total_pay") + .HasColumnType("int") + .HasComment("总金额,单位为分"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("order"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => { b.Property("id") @@ -109,6 +265,241 @@ namespace Yi.Framework.Model.Migrations b.ToTable("role"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("创建时间"); + + b.Property("enable") + .HasColumnType("int") + .HasComment("是否有效,0无效,1有效"); + + b.Property("images") + .HasColumnType("longtext") + .HasComment("商品的图片,多个图片以‘,’分割"); + + b.Property("indexes") + .HasColumnType("longtext") + .HasComment("特有规格属性在spu属性模板中的对应下标组合"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("最后更新时间"); + + b.Property("own_spec") + .HasColumnType("longtext") + .HasComment("sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序"); + + b.Property("price") + .HasColumnType("int") + .HasComment("销售价格,单位为分"); + + b.Property("spuid") + .HasColumnType("int"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("商品标题"); + + b.HasKey("id"); + + b.HasIndex("spuid"); + + b.ToTable("sku"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("规格组名称"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.ToTable("spec_group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("categoryid") + .HasColumnType("int"); + + b.Property("generic") + .HasColumnType("int") + .HasComment("是否是sku通用属性,true或false"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("name") + .HasColumnType("longtext") + .HasComment("参数名"); + + b.Property("numeric") + .HasColumnType("int") + .HasComment("是否是数字类型参数,true或false"); + + b.Property("searching") + .HasColumnType("int") + .HasComment("是否用于搜索过滤,true或false"); + + b.Property("segments") + .HasColumnType("longtext") + .HasComment("数值类型参数,如果需要搜索,则添加分段间隔值,如CPU频率间隔:0.5-1.0"); + + b.Property("spec_Groupid") + .HasColumnType("int"); + + b.Property("unit") + .HasColumnType("longtext") + .HasComment("数字类型参数的单位,非数字类型可以为空"); + + b.HasKey("id"); + + b.HasIndex("categoryid"); + + b.HasIndex("spec_Groupid"); + + b.ToTable("spec_param"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("brandid") + .HasColumnType("int"); + + b.Property("crate_time") + .HasColumnType("datetime(6)") + .HasComment("创建时间"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("last_update_time") + .HasColumnType("datetime(6)") + .HasComment("最后更新时间"); + + b.Property("saleable") + .HasColumnType("int") + .HasComment("是否上架"); + + b.Property("spu_Detailid") + .HasColumnType("int"); + + b.Property("sub_title") + .HasColumnType("longtext") + .HasComment("子标题"); + + b.Property("title") + .HasColumnType("longtext") + .HasComment("标题"); + + b.Property("valid") + .HasColumnType("int") + .HasComment("是否有效"); + + b.HasKey("id"); + + b.HasIndex("brandid"); + + b.HasIndex("spu_Detailid"); + + b.ToTable("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("after_service") + .HasColumnType("longtext") + .HasComment("售后服务"); + + b.Property("description") + .HasColumnType("longtext") + .HasComment("描述"); + + b.Property("generic_spec") + .HasColumnType("longtext") + .HasComment("通用规格参数数据"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("packing_list") + .HasColumnType("longtext") + .HasComment("包装清单"); + + b.Property("special_spec") + .HasColumnType("longtext") + .HasComment("特有规格参数及可选值信息,json格式"); + + b.HasKey("id"); + + b.ToTable("spu_detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("is_delete") + .HasColumnType("int"); + + b.Property("seckill_stock") + .HasColumnType("int") + .HasComment("可秒杀库存"); + + b.Property("seckill_total") + .HasColumnType("int") + .HasComment("秒杀总数量"); + + b.Property("skuid") + .HasColumnType("int"); + + b.Property("stock_count") + .HasColumnType("int") + .HasComment("库存数量"); + + b.HasKey("id"); + + b.HasIndex("skuid"); + + b.ToTable("stock"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => { b.Property("id") @@ -173,6 +564,43 @@ namespace Yi.Framework.Model.Migrations b.ToTable("visit"); }); + modelBuilder.Entity("brandcategory", b => + { + b.Property("brandsid") + .HasColumnType("int"); + + b.Property("categoriesid") + .HasColumnType("int"); + + b.HasKey("brandsid", "categoriesid"); + + b.HasIndex("categoriesid"); + + b.ToTable("brandcategory"); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.Property("categoriesid") + .HasColumnType("int"); + + b.Property("spusid") + .HasColumnType("int"); + + b.HasKey("categoriesid", "spusid"); + + b.HasIndex("spusid"); + + b.ToTable("categoryspu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany("chidrens") + .HasForeignKey("categoryid"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => { b.HasOne("Yi.Framework.Model.Models.menu", null) @@ -190,6 +618,13 @@ namespace Yi.Framework.Model.Migrations b.Navigation("mould"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.order", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", null) + .WithMany("orders") + .HasForeignKey("skuid"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.role", b => { b.HasOne("Yi.Framework.Model.Models.user", null) @@ -197,6 +632,107 @@ namespace Yi.Framework.Model.Migrations .HasForeignKey("userid"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.HasOne("Yi.Framework.Model.Models.spu", "spu") + .WithMany("skus") + .HasForeignKey("spuid"); + + b.Navigation("spu"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Groups") + .HasForeignKey("categoryid"); + + b.Navigation("category"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b => + { + b.HasOne("Yi.Framework.Model.Models.category", "category") + .WithMany("spec_Params") + .HasForeignKey("categoryid"); + + b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group") + .WithMany("spec_Params") + .HasForeignKey("spec_Groupid"); + + b.Navigation("category"); + + b.Navigation("spec_Group"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", "brand") + .WithMany("spus") + .HasForeignKey("brandid"); + + b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail") + .WithMany() + .HasForeignKey("spu_Detailid"); + + b.Navigation("brand"); + + b.Navigation("spu_Detail"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.stock", b => + { + b.HasOne("Yi.Framework.Model.Models.sku", "sku") + .WithMany() + .HasForeignKey("skuid"); + + b.Navigation("sku"); + }); + + modelBuilder.Entity("brandcategory", b => + { + b.HasOne("Yi.Framework.Model.Models.brand", null) + .WithMany() + .HasForeignKey("brandsid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("categoryspu", b => + { + b.HasOne("Yi.Framework.Model.Models.category", null) + .WithMany() + .HasForeignKey("categoriesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.spu", null) + .WithMany() + .HasForeignKey("spusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => + { + b.Navigation("spus"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => + { + b.Navigation("chidrens"); + + b.Navigation("spec_Groups"); + + b.Navigation("spec_Params"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.menu", b => { b.Navigation("children"); @@ -207,6 +743,21 @@ namespace Yi.Framework.Model.Migrations b.Navigation("menus"); }); + modelBuilder.Entity("Yi.Framework.Model.Models.sku", b => + { + b.Navigation("orders"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b => + { + b.Navigation("spec_Params"); + }); + + modelBuilder.Entity("Yi.Framework.Model.Models.spu", b => + { + b.Navigation("skus"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.user", b => { b.Navigation("roles"); diff --git a/Yi.Framework/Yi.Framework.Model/Models/brand.cs b/Yi.Framework/Yi.Framework.Model/Models/brand.cs new file mode 100644 index 00000000..8b0165a5 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/brand.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class brand:baseModel + { + [Comment("品牌名称")] + public string name { get; set; } + [Comment("品牌图片")] + public string image { get; set; } + [Comment("品牌首字母")] + public string letter { get; set; } + [Comment("类别")] + public List categories { get; set; } + [Comment("spu")] + public List spus { get; set; } + + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/category.cs b/Yi.Framework/Yi.Framework.Model/Models/category.cs new file mode 100644 index 00000000..de7f973f --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/category.cs @@ -0,0 +1,30 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class category:baseModel + { + [Comment("类别名称")] + public string name { get; set; } + [Comment("排序")] + public int sort { get; set; } + [Comment("是否父类别")] + public int is_parent { get; set; } + [Comment("子类别")] + public List chidrens { get; set; } + [Comment("品牌")] + public List brands { get; set; } + [Comment("spu")] + public List spus { get; set; } + [Comment("规格组")] + public List spec_Groups { get; set; } + [Comment("规格")] + public List spec_Params { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/order.cs b/Yi.Framework/Yi.Framework.Model/Models/order.cs new file mode 100644 index 00000000..1c5d6c3f --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/order.cs @@ -0,0 +1,53 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class order : baseModel + { + [Comment("总金额,单位为分")] + public int total_pay { get; set; } + [Comment("实付金额。单位:分。如:20007,表示:200元7分")] + public int actual_pay { get; set; } + [Comment("支付类型,1、在线支付,2、货到付款")] + public int payment_type { get; set; } + [Comment("邮费。单位:分。如:20007,表示:200元7分")] + public int post_fee { get; set; } + [Comment("promotion_ids")] + public string promotion_ids { get; set; } + [Comment("订单创建时间")] + public DateTime creat_time { get; set; } + [Comment("物流名称")] + public string shipping_name { get; set; } + [Comment("物流单号")] + public string shipping_code { get; set; } + [Comment("买家留言")] + public string buyer_message { get; set; } + [Comment("买家昵称")] + public string buyer_nick { get; set; } + [Comment("买家是否已经评价,0未评价,1已评价")] + public int buyer_rate { get; set; } + [Comment("收获地址(省)")] + public string receiver_state { get; set; } + [Comment("收获地址(市)")] + public string receiver_city { get; set; } + [Comment("收获地址(区/县)")] + public string receiver_district { get; set; } + [Comment("收获地址(街道、住址等详细地址)")] + public string receiver_address { get; set; } + [Comment("收货人手机")] + public string receiver_mobile { get; set; } + [Comment("收货人邮编")] + public string receiver_zip { get; set; } + [Comment("收货人")] + public string receiver { get; set; } + [Comment("发票类型:0无发票1普通发票,2电子发票,3增值税发票")] + public int invoice_type { get; set; } + [Comment("订单来源:1:app端,2:pc端,3:M端,4:微信端,5:手机qq端")] + public int source_type { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/sku.cs b/Yi.Framework/Yi.Framework.Model/Models/sku.cs new file mode 100644 index 00000000..30e98722 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/sku.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class sku : baseModel + { + [Comment("商品标题")] + public string title { get; set; } + [Comment("商品的图片,多个图片以‘,’分割")] + public string images { get; set; } + [Comment("销售价格,单位为分")] + public int price { get; set; } + [Comment("特有规格属性在spu属性模板中的对应下标组合")] + public string indexes { get; set; } + [Comment("是否有效,0无效,1有效")] + public int enable { get; set; } + [Comment("sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序")] + public string own_spec { get; set; } + [Comment("创建时间")] + public DateTime crate_time { get; set; } + [Comment("最后更新时间")] + public DateTime last_update_time { get; set; } + [Comment("spu")] + public spu spu { get; set; } + [Comment("订单")] + public List orders { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spec_group.cs b/Yi.Framework/Yi.Framework.Model/Models/spec_group.cs new file mode 100644 index 00000000..fecdc5d0 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spec_group.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spec_group : baseModel + { + [Comment("规格组名称")] + public string name { get; set; } + [Comment("类别")] + public category category { get; set; } + [Comment("规格")] + public List spec_Params { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spec_param.cs b/Yi.Framework/Yi.Framework.Model/Models/spec_param.cs new file mode 100644 index 00000000..8671f7f7 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spec_param.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spec_param:baseModel + { + [Comment("参数名")] + public string name { get; set; } + [Comment("是否是数字类型参数,true或false")] + public int numeric { get; set; } + [Comment("数字类型参数的单位,非数字类型可以为空")] + public string unit { get; set; } + [Comment("是否是sku通用属性,true或false")] + public int generic { get; set; } + [Comment("是否用于搜索过滤,true或false")] + public int searching { get; set; } + [Comment("数值类型参数,如果需要搜索,则添加分段间隔值,如CPU频率间隔:0.5-1.0")] + public string segments { get; set; } + [Comment("规格组")] + public spec_group spec_Group { get; set; } + [Comment("类别")] + public category category { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spu.cs b/Yi.Framework/Yi.Framework.Model/Models/spu.cs new file mode 100644 index 00000000..3fb9db83 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spu.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spu : baseModel + { + [Comment("标题")] + public string title { get; set; } + [Comment("子标题")] + public string sub_title { get; set; } + [Comment("是否上架")] + public int saleable { get; set; } + [Comment("是否有效")] + public int valid { get; set; } + [Comment("创建时间")] + public DateTime crate_time { get; set; } + [Comment("最后更新时间")] + public DateTime last_update_time { get; set; } + [Comment("类别")] + public List categories { get; set; } + [Comment("品牌")] + public brand brand { get; set; } + [Comment("spu详情")] + public spu_detail spu_Detail { get; set; } + [Comment("skus")] + public List skus { get; set; } + + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs b/Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs new file mode 100644 index 00000000..451735b7 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class spu_detail : baseModel + { + [Comment("描述")] + public string description { get; set; } + [Comment("通用规格参数数据")] + public string generic_spec { get; set; } + [Comment("特有规格参数及可选值信息,json格式")] + public string special_spec { get; set; } + [Comment("包装清单")] + public string packing_list { get; set; } + [Comment("售后服务")] + public string after_service { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Models/stock.cs b/Yi.Framework/Yi.Framework.Model/Models/stock.cs new file mode 100644 index 00000000..6078e543 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Models/stock.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Models +{ + public class stock:baseModel + { + [Comment("可秒杀库存")] + public int seckill_stock { get; set; } + [Comment("秒杀总数量")] + public int seckill_total { get; set; } + [Comment("库存数量")] + public int stock_count { get; set; } + [Comment("sku")] + public sku sku { get; set; } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/T4DataContext.cs b/Yi.Framework/Yi.Framework.Model/T4DataContext.cs index 071e4b24..2306e630 100644 --- a/Yi.Framework/Yi.Framework.Model/T4DataContext.cs +++ b/Yi.Framework/Yi.Framework.Model/T4DataContext.cs @@ -8,9 +8,18 @@ namespace Yi.Framework.Model { public partial class DataContext :DbContext { + public DbSet brand { get; set; } + public DbSet category { get; set; } public DbSet menu { get; set; } public DbSet mould { get; set; } + public DbSet order { get; set; } public DbSet role { get; set; } + public DbSet sku { get; set; } + public DbSet spec_group { get; set; } + public DbSet spec_param { get; set; } + public DbSet spu { get; set; } + public DbSet spu_detail { get; set; } + public DbSet stock { get; set; } public DbSet user { get; set; } public DbSet visit { get; set; } } diff --git a/Yi.Framework/Yi.Framework.Service/MenuService.cs b/Yi.Framework/Yi.Framework.Service/MenuService.cs index 3b05cfb5..5555b36d 100644 --- a/Yi.Framework/Yi.Framework.Service/MenuService.cs +++ b/Yi.Framework/Yi.Framework.Service/MenuService.cs @@ -41,6 +41,7 @@ namespace Yi.Framework.Service return TreeMenuBuild.Sort(TreeMenuBuild.Normal(menu_data)); } + public async Task> GetTopMenusByTopMenuIds(List menuIds) { return await _DbRead.Set().AsNoTracking().Where(u => menuIds.Contains(u.id)).OrderBy(u=>u.sort).ToListAsync(); diff --git a/Yi.Framework/Yi.Framework.Service/T4Service.cs b/Yi.Framework/Yi.Framework.Service/T4Service.cs index 1b59d0eb..1059740c 100644 --- a/Yi.Framework/Yi.Framework.Service/T4Service.cs +++ b/Yi.Framework/Yi.Framework.Service/T4Service.cs @@ -11,6 +11,42 @@ using Yi.Framework.Model.ModelFactory; namespace Yi.Framework.Service { + public partial class BrandService:BaseService,IBrandService + { + public BrandService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var brandList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + brandList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(brandList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class CategoryService:BaseService,ICategoryService + { + public CategoryService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var categoryList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + categoryList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(categoryList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + public partial class MenuService:BaseService,IMenuService { public MenuService(IDbContextFactory DbFactory):base(DbFactory){ } @@ -47,6 +83,24 @@ namespace Yi.Framework.Service } + public partial class OrderService:BaseService,IOrderService + { + public OrderService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var orderList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + orderList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(orderList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + public partial class RoleService:BaseService,IRoleService { public RoleService(IDbContextFactory DbFactory):base(DbFactory){ } @@ -65,6 +119,114 @@ namespace Yi.Framework.Service } + public partial class SkuService:BaseService,ISkuService + { + public SkuService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var skuList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + skuList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(skuList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class Spec_groupService:BaseService,ISpec_groupService + { + public Spec_groupService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spec_groupList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spec_groupList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spec_groupList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class Spec_paramService:BaseService,ISpec_paramService + { + public Spec_paramService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spec_paramList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spec_paramList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spec_paramList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class SpuService:BaseService,ISpuService + { + public SpuService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spuList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spuList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spuList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class Spu_detailService:BaseService,ISpu_detailService + { + public Spu_detailService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var spu_detailList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + spu_detailList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(spu_detailList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + + public partial class StockService:BaseService,IStockService + { + public StockService(IDbContextFactory DbFactory):base(DbFactory){ } + + public async Task DelListByUpdateAsync(List _ids) + { + var stockList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); + stockList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted); + return await UpdateListAsync(stockList); + } + + public async Task> GetAllEntitiesTrueAsync() + { + return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal); + } + + } + public partial class UserService:BaseService,IUserService { public UserService(IDbContextFactory DbFactory):base(DbFactory){ }