From 366386c40ebda603ca8511c5d26c9413db074ec6 Mon Sep 17 00:00:00 2001 From: lzw <605106923@qq.com> Date: Sat, 6 Nov 2021 17:13:38 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsettings.json | 8 +- .../Yi.Framework.Interface/T4Iservice.cs | 54 + .../Migrations/20211106080544_ec1.Designer.cs | 219 +++ .../Migrations/20211106080544_ec1.cs | 17 + .../Migrations/20211106080646_ec2.Designer.cs | 732 ++++++++++ .../Migrations/20211106080646_ec2.cs | 436 ++++++ .../Migrations/20211106084427_ec3.Designer.cs | 770 ++++++++++ .../Migrations/20211106084427_ec3.cs | 1265 +++++++++++++++++ .../Migrations/DataContextModelSnapshot.cs | 551 +++++++ .../Yi.Framework.Model/Models/brand.cs | 25 + .../Yi.Framework.Model/Models/category.cs | 30 + .../Yi.Framework.Model/Models/order.cs | 53 + Yi.Framework/Yi.Framework.Model/Models/sku.cs | 33 + .../Yi.Framework.Model/Models/spec_group.cs | 19 + .../Yi.Framework.Model/Models/spec_param.cs | 29 + Yi.Framework/Yi.Framework.Model/Models/spu.cs | 35 + .../Yi.Framework.Model/Models/spu_detail.cs | 23 + .../Yi.Framework.Model/Models/stock.cs | 21 + .../Yi.Framework.Model/T4DataContext.cs | 9 + .../Yi.Framework.Service/MenuService.cs | 1 + .../Yi.Framework.Service/T4Service.cs | 162 +++ 21 files changed, 4488 insertions(+), 4 deletions(-) create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.Designer.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106080544_ec1.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.Designer.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106080646_ec2.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.Designer.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106084427_ec3.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/brand.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/category.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/order.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/sku.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/spec_group.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/spec_param.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/spu.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/spu_detail.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Models/stock.cs 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){ } From 6e7ab2325adaf5bcbb66cd43cb4334cd8141d1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Sat, 6 Nov 2021 19:11:43 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Migrations/20211106110713_ec4.Designer.cs | 799 ++++++++++++++++++ .../Migrations/20211106110713_ec4.cs | 161 ++++ .../Migrations/DataContextModelSnapshot.cs | 95 ++- 3 files changed, 1022 insertions(+), 33 deletions(-) create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.Designer.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.cs diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.Designer.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.Designer.cs new file mode 100644 index 00000000..9c033a51 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.Designer.cs @@ -0,0 +1,799 @@ +// +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("20211106110713_ec4")] + partial class ec4 + { + 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("router") + .HasColumnType("longtext"); + + b.Property("sort") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("menuid"); + + b.HasIndex("mouldid"); + + 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.HasKey("id"); + + 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("longtext"); + + 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("menurole", b => + { + b.Property("menusid") + .HasColumnType("int"); + + b.Property("rolesid") + .HasColumnType("int"); + + b.HasKey("menusid", "rolesid"); + + b.HasIndex("rolesid"); + + b.ToTable("menurole"); + }); + + modelBuilder.Entity("roleuser", b => + { + b.Property("rolesid") + .HasColumnType("int"); + + b.Property("usersid") + .HasColumnType("int"); + + b.HasKey("rolesid", "usersid"); + + b.HasIndex("usersid"); + + b.ToTable("roleuser"); + }); + + 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.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.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("menurole", b => + { + b.HasOne("Yi.Framework.Model.Models.menu", null) + .WithMany() + .HasForeignKey("menusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany() + .HasForeignKey("rolesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("roleuser", b => + { + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany() + .HasForeignKey("rolesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.user", null) + .WithMany() + .HasForeignKey("usersid") + .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.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"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.cs b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.cs new file mode 100644 index 00000000..dc279917 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Migrations/20211106110713_ec4.cs @@ -0,0 +1,161 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Yi.Framework.Model.Migrations +{ + public partial class ec4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_menu_role_roleid", + table: "menu"); + + migrationBuilder.DropForeignKey( + name: "FK_role_user_userid", + table: "role"); + + migrationBuilder.DropIndex( + name: "IX_role_userid", + table: "role"); + + migrationBuilder.DropIndex( + name: "IX_menu_roleid", + table: "menu"); + + migrationBuilder.DropColumn( + name: "userid", + table: "role"); + + migrationBuilder.DropColumn( + name: "roleid", + table: "menu"); + + migrationBuilder.AlterColumn( + name: "phone", + table: "user", + type: "longtext", + nullable: true, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "menurole", + columns: table => new + { + menusid = table.Column(type: "int", nullable: false), + rolesid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_menurole", x => new { x.menusid, x.rolesid }); + table.ForeignKey( + name: "FK_menurole_menu_menusid", + column: x => x.menusid, + principalTable: "menu", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_menurole_role_rolesid", + column: x => x.rolesid, + principalTable: "role", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "roleuser", + columns: table => new + { + rolesid = table.Column(type: "int", nullable: false), + usersid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_roleuser", x => new { x.rolesid, x.usersid }); + table.ForeignKey( + name: "FK_roleuser_role_rolesid", + column: x => x.rolesid, + principalTable: "role", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_roleuser_user_usersid", + column: x => x.usersid, + principalTable: "user", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_menurole_rolesid", + table: "menurole", + column: "rolesid"); + + migrationBuilder.CreateIndex( + name: "IX_roleuser_usersid", + table: "roleuser", + column: "usersid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "menurole"); + + migrationBuilder.DropTable( + name: "roleuser"); + + migrationBuilder.AlterColumn( + name: "phone", + table: "user", + type: "int", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "userid", + table: "role", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "roleid", + table: "menu", + type: "int", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_role_userid", + table: "role", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "IX_menu_roleid", + table: "menu", + column: "roleid"); + + migrationBuilder.AddForeignKey( + name: "FK_menu_role_roleid", + table: "menu", + column: "roleid", + principalTable: "role", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_role_user_userid", + table: "role", + column: "userid", + principalTable: "user", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs b/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs index 1e7b9bed..7fcf5023 100644 --- a/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs +++ b/Yi.Framework/Yi.Framework.Model/Migrations/DataContextModelSnapshot.cs @@ -101,9 +101,6 @@ namespace Yi.Framework.Model.Migrations b.Property("mouldid") .HasColumnType("int"); - b.Property("roleid") - .HasColumnType("int"); - b.Property("router") .HasColumnType("longtext"); @@ -116,8 +113,6 @@ namespace Yi.Framework.Model.Migrations b.HasIndex("mouldid"); - b.HasIndex("roleid"); - b.ToTable("menu"); }); @@ -255,13 +250,8 @@ namespace Yi.Framework.Model.Migrations b.Property("role_name") .HasColumnType("longtext"); - b.Property("userid") - .HasColumnType("int"); - b.HasKey("id"); - b.HasIndex("userid"); - b.ToTable("role"); }); @@ -533,8 +523,8 @@ namespace Yi.Framework.Model.Migrations b.Property("password") .HasColumnType("longtext"); - b.Property("phone") - .HasColumnType("int"); + b.Property("phone") + .HasColumnType("longtext"); b.Property("username") .HasColumnType("longtext"); @@ -594,6 +584,36 @@ namespace Yi.Framework.Model.Migrations b.ToTable("categoryspu"); }); + modelBuilder.Entity("menurole", b => + { + b.Property("menusid") + .HasColumnType("int"); + + b.Property("rolesid") + .HasColumnType("int"); + + b.HasKey("menusid", "rolesid"); + + b.HasIndex("rolesid"); + + b.ToTable("menurole"); + }); + + modelBuilder.Entity("roleuser", b => + { + b.Property("rolesid") + .HasColumnType("int"); + + b.Property("usersid") + .HasColumnType("int"); + + b.HasKey("rolesid", "usersid"); + + b.HasIndex("usersid"); + + b.ToTable("roleuser"); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.category", b => { b.HasOne("Yi.Framework.Model.Models.category", null) @@ -611,10 +631,6 @@ namespace Yi.Framework.Model.Migrations .WithMany() .HasForeignKey("mouldid"); - b.HasOne("Yi.Framework.Model.Models.role", null) - .WithMany("menus") - .HasForeignKey("roleid"); - b.Navigation("mould"); }); @@ -625,13 +641,6 @@ namespace Yi.Framework.Model.Migrations .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") @@ -719,6 +728,36 @@ namespace Yi.Framework.Model.Migrations .IsRequired(); }); + modelBuilder.Entity("menurole", b => + { + b.HasOne("Yi.Framework.Model.Models.menu", null) + .WithMany() + .HasForeignKey("menusid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany() + .HasForeignKey("rolesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("roleuser", b => + { + b.HasOne("Yi.Framework.Model.Models.role", null) + .WithMany() + .HasForeignKey("rolesid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yi.Framework.Model.Models.user", null) + .WithMany() + .HasForeignKey("usersid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Yi.Framework.Model.Models.brand", b => { b.Navigation("spus"); @@ -738,11 +777,6 @@ namespace Yi.Framework.Model.Migrations 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"); @@ -757,11 +791,6 @@ namespace Yi.Framework.Model.Migrations { b.Navigation("skus"); }); - - modelBuilder.Entity("Yi.Framework.Model.Models.user", b => - { - b.Navigation("roles"); - }); #pragma warning restore 612, 618 } } From f6ab793450a37db7867a861bbce14ca4ec21fdc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Sun, 7 Nov 2021 12:46:41 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Goods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Yi.Framework.Interface/IGoodsService.cs | 15 +++++ .../Yi.Framework.Interface/ISearchService.cs | 13 ++++ .../Yi.Framework.Model/Search/Goods.cs | 31 ++++++++++ .../Yi.Framework.Model/Search/PageResult.cs | 20 ++++++ .../Search/SearchRequest.cs | 39 ++++++++++++ .../Yi.Framework.Model/Search/SearchResult.cs | 31 ++++++++++ .../Yi.Framework.Service/GoodsService.cs | 19 ++++++ .../Yi.Framework.Service/SearchService.cs | 62 +++++++++++++++++++ 8 files changed, 230 insertions(+) create mode 100644 Yi.Framework/Yi.Framework.Interface/IGoodsService.cs create mode 100644 Yi.Framework/Yi.Framework.Interface/ISearchService.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Search/Goods.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Search/PageResult.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Search/SearchRequest.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs create mode 100644 Yi.Framework/Yi.Framework.Service/GoodsService.cs create mode 100644 Yi.Framework/Yi.Framework.Service/SearchService.cs diff --git a/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs b/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs new file mode 100644 index 00000000..b3bcbe76 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Interface/IGoodsService.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Model.Models; +using Yi.Framework.Model.Search; + +namespace Yi.Framework.Interface +{ + public interface IGoodsService + { + PageResult QuerySpuByPage(int page, int rows, string key, bool? saleable); + } +} diff --git a/Yi.Framework/Yi.Framework.Interface/ISearchService.cs b/Yi.Framework/Yi.Framework.Interface/ISearchService.cs new file mode 100644 index 00000000..4d503167 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Interface/ISearchService.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Interface +{ + public interface ISearchService + { + void ImpDataBySpu(); + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Search/Goods.cs b/Yi.Framework/Yi.Framework.Model/Search/Goods.cs new file mode 100644 index 00000000..35a905c7 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Search/Goods.cs @@ -0,0 +1,31 @@ +using Nest; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Model.Models; + +namespace Yi.Framework.Model.Search +{ + [ElasticsearchType(IdProperty = "id")]//主键声明,且主键必须是属性 + public class Goods + { + public long id { get; set; } + + + public spu spu { get; set; } + public string all; //所有需要被搜索的信息,包括品牌,分类,标题 + public string subtitle; //子标题 + public brand brand; + public category cid1; + public category cid2; + public category cid3; + public DateTime? createTime; + + + public HashSet price = new HashSet(); //是所有sku的价格集合。方便根据价格进行筛选过滤 + public List skus; //sku信息的json结构数据 + public Dictionary specs = new Dictionary(); //可搜索的规格参数,key是参数名,值是参数值 + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Search/PageResult.cs b/Yi.Framework/Yi.Framework.Model/Search/PageResult.cs new file mode 100644 index 00000000..52fde5cb --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Search/PageResult.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Yi.Framework.Model.Search +{ + public class PageResult + { + public static readonly long serialVersionUID = 4612105649493688532L; + public long total; // 总记录数 + public int totalPages; //总页数 + public List rows; // 每页显示的数据集合 + + public PageResult(long total, List rows) + { + this.total = total; + this.rows = rows; + } + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Search/SearchRequest.cs b/Yi.Framework/Yi.Framework.Model/Search/SearchRequest.cs new file mode 100644 index 00000000..a3853d37 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Search/SearchRequest.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Model.Search +{ + public class SearchRequest + { + public static readonly int DEFAULT_PAGE = 1; + public static readonly int DEFAULT_SIZE = 20; + public string key { get; set; } + public int page { get; set; } + //排序字段 + public string sortBy { get; set; } + //是否降序 + public bool descending { get; set; } + //过滤字段 + public Dictionary filter = new Dictionary(); + + public int getPage() + { + if (page == 0) + { + return DEFAULT_PAGE; + } + // 获取页码时做一些校验,不能小于1 + return Math.Max(DEFAULT_PAGE, page); + } + + public int getSize() + { + return DEFAULT_SIZE; + } + + + } +} diff --git a/Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs b/Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs new file mode 100644 index 00000000..18043165 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Search/SearchResult.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Model.Models; + +namespace Yi.Framework.Model.Search +{ + public class SearchResult : PageResult + { + public List brands = new List(); + public List categories = new List(); + //规格参数过滤条件 + public List> specs = new List>(); + public SearchResult(long total, + int totalPage, + List items, + List categories, + List brands, + List> specs) : base + (total, items) + { + + this.categories = categories; + this.brands = brands; + this.specs = specs; + } + + } +} diff --git a/Yi.Framework/Yi.Framework.Service/GoodsService.cs b/Yi.Framework/Yi.Framework.Service/GoodsService.cs new file mode 100644 index 00000000..381972d6 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Service/GoodsService.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Interface; +using Yi.Framework.Model.Models; +using Yi.Framework.Model.Search; + +namespace Yi.Framework.Service +{ + public class GoodsService : IGoodsService + { + public PageResult QuerySpuByPage(int page, int rows, string key, bool? saleable) + { + throw new NotImplementedException(); + } + } +} diff --git a/Yi.Framework/Yi.Framework.Service/SearchService.cs b/Yi.Framework/Yi.Framework.Service/SearchService.cs new file mode 100644 index 00000000..d1a3a389 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Service/SearchService.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Interface; +using Yi.Framework.Model.Models; +using Yi.Framework.Model.Search; + +namespace Yi.Framework.Service +{ + public class SearchService : ISearchService + { + private IGoodsService _goodsService; + public SearchService(IGoodsService goodsService) + { + _goodsService = goodsService; + } + public void ImpDataBySpu() + { + ImportToEs(); + } + private void ImportToEs() + { + int page = 1; + int size; + int rows = 100; + do + { + List goodsList = new List(); + // 上架商品 + PageResult result = _goodsService.QuerySpuByPage(page, rows, null, true); + List spus = result.rows; + size = spus.Count; + foreach (var spu in spus) + { + try + { + Goods g = BuildGoods(spu); + // 处理好的数据添加到集合中 + goodsList.Add(g); + + } + catch (Exception e) + { + Console.WriteLine(e.Message); + continue;//部分数据不严格 + } + } + // 存入es,先留着,不写 + //_elasticSearchService.Send(goodsList); + page++; + } while (size == 100); + } + + private Goods BuildGoods(spu spu) + { + Goods goods = new Goods(); + return goods; + } + } +} From ed0da8d99097196d70f05cdc03db02dbe4820e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 17:06:45 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WeatherForecast.cs | 15 ----- .../Yi - Backup (1).Framework.Model.csproj | 59 +++++++++++++++++++ 2 files changed, 59 insertions(+), 15 deletions(-) delete mode 100644 Yi.Framework/Yi.Framework.AuthenticationCenter/WeatherForecast.cs create mode 100644 Yi.Framework/Yi.Framework.Model/Yi - Backup (1).Framework.Model.csproj diff --git a/Yi.Framework/Yi.Framework.AuthenticationCenter/WeatherForecast.cs b/Yi.Framework/Yi.Framework.AuthenticationCenter/WeatherForecast.cs deleted file mode 100644 index 520fb1b1..00000000 --- a/Yi.Framework/Yi.Framework.AuthenticationCenter/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Yi.Framework.AuthenticationCenter -{ - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string Summary { get; set; } - } -} diff --git a/Yi.Framework/Yi.Framework.Model/Yi - Backup (1).Framework.Model.csproj b/Yi.Framework/Yi.Framework.Model/Yi - Backup (1).Framework.Model.csproj new file mode 100644 index 00000000..a18e350c --- /dev/null +++ b/Yi.Framework/Yi.Framework.Model/Yi - Backup (1).Framework.Model.csproj @@ -0,0 +1,59 @@ + + + + net5.0 + + + + + True + True + T4DataContext.tt + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + TextTemplatingFileGenerator + T4DaraContext.cs + + + TextTemplatingFileGenerator + T4DataContext.cs + + + + + + + + + + True + True + T4DaraContext.tt + + + True + True + T4DataContext.tt + + + + From e9d35eabbdd457c22046fb5a8d59948545d87431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 17:09:13 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/WeatherForecastController.cs | 13 ------------- .../Yi.Framework.Model/Yi.Framework.Model.csproj | 1 + 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs b/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs index 182d709b..3eeeea74 100644 --- a/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs +++ b/Yi.Framework/Yi.Framework.AuthenticationCenter/Controllers/WeatherForecastController.cs @@ -22,18 +22,5 @@ namespace Yi.Framework.AuthenticationCenter.Controllers { _logger = logger; } - - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } } } diff --git a/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj b/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj index 20c72c23..a18e350c 100644 --- a/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj +++ b/Yi.Framework/Yi.Framework.Model/Yi.Framework.Model.csproj @@ -19,6 +19,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + From bf9c86f7b778449ce7fe868177e6a8a91fde4bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 18:55:11 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=B7=BB=E5=8A=A0es=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InitESIndexWorker.cs | 20 +++++++++---------- .../WarmupESIndexWorker.cs | 10 +++++++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs index 161e40c5..f18a0372 100644 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs +++ b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/InitESIndexWorker.cs @@ -49,16 +49,16 @@ namespace Yi.Framework.ElasticSearchProcessor //жɾģesӦIJ //switch (spuCQRSQueueModel.CQRSType) //{ - //case (int)SPUCQRSQueueModelType.Insert: - //case (int)SPUCQRSQueueModelType.Update: - // { - // Goods goods = this._ISearchService.GetGoodsBySpuId(spuCQRSQueueModel.SpuId); - // this._IElasticSearchService.InsertOrUpdata(goods); - // break; - // } - //case (int)SPUCQRSQueueModelType.Delete: - // this._IElasticSearchService.Delete(spuCQRSQueueModel.SpuId.ToString()); - // break; + // case (int)SPUCQRSQueueModelType.Insert: + // case (int)SPUCQRSQueueModelType.Update: + // { + // Goods goods = this._ISearchService.GetGoodsBySpuId(spuCQRSQueueModel.SpuId); + // this._IElasticSearchService.InsertOrUpdata(goods); + // break; + // } + // case (int)SPUCQRSQueueModelType.Delete: + // this._IElasticSearchService.Delete(spuCQRSQueueModel.SpuId.ToString()); + // break; // default: // throw new Exception("wrong spuCQRSQueueModel.CQRSType"); //} diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs index a4d5550a..895134dd 100644 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs +++ b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/WarmupESIndexWorker.cs @@ -13,7 +13,9 @@ using System.Threading; using System.Threading.Tasks; using Yi.Framework.Common.IOCOptions; using Yi.Framework.Common.Models; +using Yi.Framework.Common.QueueModel; using Yi.Framework.Core; +using Yi.Framework.Interface; namespace Yi.Framework.ElasticSearchProcessor { @@ -25,13 +27,15 @@ namespace Yi.Framework.ElasticSearchProcessor private readonly ElasticSearchInvoker _elasticSearchInvoker; private readonly IOptionsMonitor _ElasticSearchOptions = null; - public WarmupESIndexWorker(ILogger logger, RabbitMQInvoker rabbitMQInvoker, IConfiguration configuration, ElasticSearchInvoker elasticSearchInvoker, IOptionsMonitor optionsMonitor) + private readonly ISearchService _searchService; + public WarmupESIndexWorker(ILogger logger, RabbitMQInvoker rabbitMQInvoker, IConfiguration configuration, ElasticSearchInvoker elasticSearchInvoker, IOptionsMonitor optionsMonitor, ISearchService searchService) { this._logger = logger; this._RabbitMQInvoker = rabbitMQInvoker; this._configuration = configuration; this._elasticSearchInvoker = elasticSearchInvoker; this._ElasticSearchOptions = optionsMonitor; + this._searchService=searchService; } protected override async Task ExecuteAsync(CancellationToken stoppingToken) @@ -44,14 +48,14 @@ namespace Yi.Framework.ElasticSearchProcessor HttpClient _HttpClient = new HttpClient(); this._RabbitMQInvoker.RegistReciveAction(rabbitMQConsumerModel, message => { - //SKUWarmupQueueModel skuWarmupQueueModel = JsonConvert.DeserializeObject(message); + SKUWarmupQueueModel skuWarmupQueueModel = JsonConvert.DeserializeObject(message); //õϢģ͡ #region ɾIndex---½Index---ٽȫ { try { this._elasticSearchInvoker.DropIndex(this._ElasticSearchOptions.CurrentValue.IndexName); - //this._ISearchService.ImpDataBySpu(); + this._searchService.ImpDataBySpu(); //esݵ this._logger.LogInformation($"{nameof(WarmupESIndexWorker)}.InitAll succeed"); return true; From 75e6df19bd297b1f6f861bb59a7b6f19612eab15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 18:56:50 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4414ad74..d0544e76 100644 --- a/.gitignore +++ b/.gitignore @@ -339,3 +339,4 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-shm +Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json index 126afc73..589edaa4 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json @@ -84,4 +84,5 @@ "Template": "SMS_221640732" }, "IPLibraryServiceUrl": "http://gRPCIPLibraryService" + } \ No newline at end of file From 781fb77a946e5b34a71c004f9cf533479436e52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 18:59:19 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d0544e76..9f6d1ff9 100644 --- a/.gitignore +++ b/.gitignore @@ -338,5 +338,5 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb -Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-shm -Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json + +appsettings.json From 24a42ff686b297abc06ad2cca5066336de2e1552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 19:00:23 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9f6d1ff9..e2eb2d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -340,3 +340,4 @@ ASALocalRun/ healthchecksdb appsettings.json +*.json From 02c2c216df57b2823dc0f560c3c071d83162142a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 19:01:41 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsettings.Development.json | 9 -- .../appsettings.json | 88 ------------------- 2 files changed, 97 deletions(-) delete mode 100644 Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.Development.json delete mode 100644 Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.Development.json b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.Development.json deleted file mode 100644 index 8983e0fc..00000000 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json b/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json deleted file mode 100644 index 589edaa4..00000000 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/appsettings.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*", - - "Consul_Enabled": false, - "DbSeed_Enabled": true, - "Apollo_Enabled": false, - "HealthCheck_Enabled": false, - "Cors_Enabled": true, - "RabbitMQ_Enabled": true, - "Redis_Enabled": true, - "RedisSeed_Enabled": true, - "Kafka_Enabled": false, - "ElasticSeach_Enabled": false, - "MutiDB_Enabled": false, - "SMS_Enabled": true, - "DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ], - "DbSelect": "Mysql", - - "DbConn": { - "WriteUrl": "server=118.195.191.41;port=3306;database=YIECDB;user id=root;password=Qz52013142020.", - "ReadUrl": [ - "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": { - "AppId": "Yi.Framework.ApiMicroservice", - "Env": "DEV", - "MetaServer": "http://192.168.2.168:8080", - "ConfigServer": [ "http://192.168.2.168:8080" ] - }, - "JWTTokenOptions": { - "Audience": "http://localhost:7000", - "Issuer": "http://localhost:7000", - "SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB" - }, - "RedisConnOptions": { - "Host": "118.195.191.41", - "Prot": 6379, - "DB": 1, - "Password": "Qz52013142020." - }, - "RabbitConn": { - "HostName": "118.195.191.41", - "UserName": "cc", - "Password": "cc", - "Port": 5672 - }, - "ElasticSeachConn": { - "Url": "", - "IndexName": "" - }, - "KafkaOptions": { - "BrokerList": "192.168.3.230:9092", - "TopicName": "kafkalog" - }, - "ConsulClientOption": { - "IP": "118.195.191.41", - "Port": "8500", - "Datacenter": "dc1" - }, - "ConsulRegisterOption": { - "IP": "183.216.18.15", - "Port": "44329", - "GroupName": "ApiMicroservice", - "HealthCheckUrl": "/Health", - "Interval": 10, - "Timeout": 5, - "DeregisterCriticalServiceAfter": 60, - "Tag": "13" - }, - "SMS": { - "ID": "LTAI5tJvjPaXCyyPMfXLNbVA", - "Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn", - "Sign": "JiftCC", - "Template": "SMS_221640732" - }, - "IPLibraryServiceUrl": "http://gRPCIPLibraryService" - -} \ No newline at end of file From 4a37c7454dc7cd348768e05b69929a882a5a8387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 19:04:56 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsettings.Development.json | 9 --- .../appsettings.json | 81 ------------------- 2 files changed, 90 deletions(-) delete mode 100644 Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.Development.json delete mode 100644 Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.json diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.Development.json b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.Development.json deleted file mode 100644 index 8983e0fc..00000000 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.json b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.json deleted file mode 100644 index 53d2c643..00000000 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/appsettings.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*", - - "Consul_Enabled": false, - "DbSeed_Enabled": true, - "Apollo_Enabled": false, - "HealthCheck_Enabled": false, - "Cors_Enabled": true, - "RabbitMQ_Enabled": true, - "Redis_Enabled": true, - "RedisSeed_Enabled": true, - "Kafka_Enabled": false, - "ElasticSeach_Enabled": false, - "MutiDB_Enabled": false, - "SMS_Enabled": true, - "DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ], - "DbSelect": "Mysql", - - "DbConn": { - "WriteUrl": "server=118.195.191.41;port=3306;database=YIDB;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." - ] - }, - "JWTTokenOptions": { - "Audience": "http://localhost:7000", - "Issuer": "http://localhost:7000", - "SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB" - }, - "RedisConnOptions": { - "Host": "118.195.191.41", - "Prot": 6379, - "DB": 1, - "Password": "Qz52013142020." - }, - "RabbitConn": { - "HostName": "118.195.191.41", - "UserName": "cc", - "Password": "cc", - "Port": 5672 - }, - "ElasticSeachConn": { - "Url": "", - "IndexName": "" - }, - "KafkaOptions": { - "BrokerList": "192.168.3.230:9092", - "TopicName": "kafkalog" - }, - "ConsulClientOption": { - "IP": "118.195.191.41", - "Port": "8500", - "Datacenter": "dc1" - }, - "ConsulRegisterOption": { - "IP": "183.216.18.15", - "Port": "44329", - "GroupName": "ApiMicroservice", - "HealthCheckUrl": "/Health", - "Interval": 10, - "Timeout": 5, - "DeregisterCriticalServiceAfter": 60, - "Tag": "13" - }, - "SMS": { - "ID": "LTAI5tJvjPaXCyyPMfXLNbVA", - "Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn", - "Sign": "JiftCC", - "Template": "SMS_221640732" - }, - "IPLibraryServiceUrl": "http://gRPCIPLibraryService" -} \ No newline at end of file From 0a6759b3611651febd36c5919b87457850f664e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 9 Nov 2021 19:13:21 +0800 Subject: [PATCH 12/12] =?UTF-8?q?es=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Yi.Framework.ElasticSearchProcessor.csproj | 29 +++++++++++++++++++ .../Yi.Framework.PageDetail.csproj | 10 ------- .../Yi.Framework.Service/SearchService.cs | 7 +++-- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj index f208d303..93993039 100644 --- a/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj +++ b/Yi.Framework/Yi.Framework.ElasticSearchProcessor/Yi.Framework.ElasticSearchProcessor.csproj @@ -4,4 +4,33 @@ net5.0 + + + + + + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + + + + + + + + + + + + diff --git a/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj b/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj index 8137388a..464f7f90 100644 --- a/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj +++ b/Yi.Framework/Yi.Framework.PageDetail/Yi.Framework.PageDetail.csproj @@ -10,16 +10,6 @@ 1701;1702;CS1591 - - - - - - - - - - diff --git a/Yi.Framework/Yi.Framework.Service/SearchService.cs b/Yi.Framework/Yi.Framework.Service/SearchService.cs index d1a3a389..bdb5a686 100644 --- a/Yi.Framework/Yi.Framework.Service/SearchService.cs +++ b/Yi.Framework/Yi.Framework.Service/SearchService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Yi.Framework.Core; using Yi.Framework.Interface; using Yi.Framework.Model.Models; using Yi.Framework.Model.Search; @@ -12,9 +13,11 @@ namespace Yi.Framework.Service public class SearchService : ISearchService { private IGoodsService _goodsService; - public SearchService(IGoodsService goodsService) + private ElasticSearchInvoker _elasticSearchInvoker ; + public SearchService(IGoodsService goodsService, ElasticSearchInvoker elasticSearchInvoker) { _goodsService = goodsService; + _elasticSearchInvoker = elasticSearchInvoker; } public void ImpDataBySpu() { @@ -48,7 +51,7 @@ namespace Yi.Framework.Service } } // 存入es,先留着,不写 - //_elasticSearchService.Send(goodsList); + _elasticSearchInvoker.Send(goodsList); page++; } while (size == 100); }