上传模型类

This commit is contained in:
lzw
2021-11-06 17:13:38 +08:00
parent 8b3339c81d
commit 366386c40e
21 changed files with 4488 additions and 4 deletions

View File

@@ -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": {

View File

@@ -8,6 +8,18 @@ using Yi.Framework.Model.Models;
namespace Yi.Framework.Interface
{
public partial interface IBrandService:IBaseService<brand>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<brand>> GetAllEntitiesTrueAsync();
}
public partial interface ICategoryService:IBaseService<category>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<category>> GetAllEntitiesTrueAsync();
}
public partial interface IMenuService:IBaseService<menu>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
@@ -20,12 +32,54 @@ namespace Yi.Framework.Interface
Task<IEnumerable<mould>> GetAllEntitiesTrueAsync();
}
public partial interface IOrderService:IBaseService<order>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<order>> GetAllEntitiesTrueAsync();
}
public partial interface IRoleService:IBaseService<role>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<role>> GetAllEntitiesTrueAsync();
}
public partial interface ISkuService:IBaseService<sku>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<sku>> GetAllEntitiesTrueAsync();
}
public partial interface ISpec_groupService:IBaseService<spec_group>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<spec_group>> GetAllEntitiesTrueAsync();
}
public partial interface ISpec_paramService:IBaseService<spec_param>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<spec_param>> GetAllEntitiesTrueAsync();
}
public partial interface ISpuService:IBaseService<spu>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<spu>> GetAllEntitiesTrueAsync();
}
public partial interface ISpu_detailService:IBaseService<spu_detail>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<spu_detail>> GetAllEntitiesTrueAsync();
}
public partial interface IStockService:IBaseService<stock>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);
Task<IEnumerable<stock>> GetAllEntitiesTrueAsync();
}
public partial interface IUserService:IBaseService<user>
{
Task<bool> DelListByUpdateAsync(List<int> _ids);

View File

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

View File

@@ -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)
{
}
}
}

View File

@@ -0,0 +1,732 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("image")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("letter")
.HasColumnType("longtext");
b.Property<string>("name")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("brand");
});
modelBuilder.Entity("Yi.Framework.Model.Models.brand_category", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("brandId")
.HasColumnType("int");
b.Property<int>("categoryId")
.HasColumnType("int");
b.Property<int>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_parent")
.HasColumnType("int");
b.Property<string>("name")
.HasColumnType("longtext");
b.Property<int>("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("categoryid");
b.ToTable("category");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_show")
.HasColumnType("int");
b.Property<int>("is_top")
.HasColumnType("int");
b.Property<string>("menu_name")
.HasColumnType("longtext");
b.Property<int?>("menuid")
.HasColumnType("int");
b.Property<int?>("mouldid")
.HasColumnType("int");
b.Property<int?>("roleid")
.HasColumnType("int");
b.Property<string>("router")
.HasColumnType("longtext");
b.Property<int>("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("menuid");
b.HasIndex("mouldid");
b.HasIndex("roleid");
b.ToTable("menu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("mould_name")
.HasColumnType("longtext");
b.Property<string>("url")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.order", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("actual_pay")
.HasColumnType("int");
b.Property<string>("buyer_message")
.HasColumnType("longtext");
b.Property<string>("buyer_nick")
.HasColumnType("longtext");
b.Property<int>("buyer_rate")
.HasColumnType("int");
b.Property<DateTime>("creat_time")
.HasColumnType("datetime(6)");
b.Property<int>("invoice_type")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("payment_type")
.HasColumnType("int");
b.Property<int>("post_fee")
.HasColumnType("int");
b.Property<string>("promotion_ids")
.HasColumnType("longtext");
b.Property<string>("receiver")
.HasColumnType("longtext");
b.Property<string>("receiver_address")
.HasColumnType("longtext");
b.Property<string>("receiver_city")
.HasColumnType("longtext");
b.Property<string>("receiver_district")
.HasColumnType("longtext");
b.Property<string>("receiver_mobile")
.HasColumnType("longtext");
b.Property<string>("receiver_state")
.HasColumnType("longtext");
b.Property<string>("receiver_zip")
.HasColumnType("longtext");
b.Property<string>("shipping_code")
.HasColumnType("longtext");
b.Property<string>("shipping_name")
.HasColumnType("longtext");
b.Property<int?>("skuid")
.HasColumnType("int");
b.Property<int>("source_type")
.HasColumnType("int");
b.Property<int>("total_pay")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("order");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("introduce")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("role_name")
.HasColumnType("longtext");
b.Property<int?>("userid")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("userid");
b.ToTable("role");
});
modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("crate_time")
.HasColumnType("datetime(6)");
b.Property<int>("enable")
.HasColumnType("int");
b.Property<string>("images")
.HasColumnType("longtext");
b.Property<string>("indexes")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<DateTime>("last_update_time")
.HasColumnType("datetime(6)");
b.Property<string>("own_spec")
.HasColumnType("longtext");
b.Property<int>("price")
.HasColumnType("int");
b.Property<int?>("spuid")
.HasColumnType("int");
b.Property<string>("title")
.HasColumnType("longtext");
b.HasKey("id");
b.HasIndex("spuid");
b.ToTable("sku");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("name")
.HasColumnType("longtext");
b.HasKey("id");
b.HasIndex("categoryid");
b.ToTable("spec_group");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("generic")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("name")
.HasColumnType("longtext");
b.Property<int>("numeric")
.HasColumnType("int");
b.Property<int>("searching")
.HasColumnType("int");
b.Property<string>("segments")
.HasColumnType("longtext");
b.Property<int?>("spec_Groupid")
.HasColumnType("int");
b.Property<string>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("brandid")
.HasColumnType("int");
b.Property<DateTime>("crate_time")
.HasColumnType("datetime(6)");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<DateTime>("last_update_time")
.HasColumnType("datetime(6)");
b.Property<int>("saleable")
.HasColumnType("int");
b.Property<int?>("spu_Detailid")
.HasColumnType("int");
b.Property<string>("sub_title")
.HasColumnType("longtext");
b.Property<string>("title")
.HasColumnType("longtext");
b.Property<int>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("after_service")
.HasColumnType("longtext");
b.Property<string>("description")
.HasColumnType("longtext");
b.Property<string>("generic_spec")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("packing_list")
.HasColumnType("longtext");
b.Property<string>("special_spec")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("spu_detail");
});
modelBuilder.Entity("Yi.Framework.Model.Models.stock", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("seckill_stock")
.HasColumnType("int");
b.Property<int>("seckill_total")
.HasColumnType("int");
b.Property<int?>("skuid")
.HasColumnType("int");
b.Property<int>("stock_count")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("stock");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("address")
.HasColumnType("longtext");
b.Property<int?>("age")
.HasColumnType("int");
b.Property<string>("email")
.HasColumnType("longtext");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<string>("introduction")
.HasColumnType("longtext");
b.Property<string>("ip")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("nick")
.HasColumnType("longtext");
b.Property<string>("password")
.HasColumnType("longtext");
b.Property<int?>("phone")
.HasColumnType("int");
b.Property<string>("username")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("user");
});
modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("num")
.HasColumnType("int");
b.Property<DateTime>("time")
.HasColumnType("datetime(6)");
b.HasKey("id");
b.ToTable("visit");
});
modelBuilder.Entity("categoryspu", b =>
{
b.Property<int>("categoriesid")
.HasColumnType("int");
b.Property<int>("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
}
}
}

View File

@@ -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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
image = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
letter = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
sort = table.Column<int>(type: "int", nullable: false),
is_parent = table.Column<int>(type: "int", nullable: false),
categoryid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
generic_spec = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
special_spec = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
packing_list = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
after_service = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
brandId = table.Column<int>(type: "int", nullable: false),
categoryId = table.Column<int>(type: "int", nullable: false),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
categoryid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
title = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
sub_title = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
saleable = table.Column<int>(type: "int", nullable: false),
valid = table.Column<int>(type: "int", nullable: false),
crate_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
last_update_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
brandid = table.Column<int>(type: "int", nullable: true),
spu_Detailid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
numeric = table.Column<int>(type: "int", nullable: false),
unit = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
generic = table.Column<int>(type: "int", nullable: false),
searching = table.Column<int>(type: "int", nullable: false),
segments = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
spec_Groupid = table.Column<int>(type: "int", nullable: true),
categoryid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false),
spusid = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
title = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
images = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
price = table.Column<int>(type: "int", nullable: false),
indexes = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
enable = table.Column<int>(type: "int", nullable: false),
own_spec = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
crate_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
last_update_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
spuid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
total_pay = table.Column<int>(type: "int", nullable: false),
actual_pay = table.Column<int>(type: "int", nullable: false),
payment_type = table.Column<int>(type: "int", nullable: false),
post_fee = table.Column<int>(type: "int", nullable: false),
promotion_ids = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
creat_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
shipping_name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
shipping_code = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
buyer_message = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
buyer_nick = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
buyer_rate = table.Column<int>(type: "int", nullable: false),
receiver_state = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
receiver_city = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
receiver_district = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
receiver_address = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
receiver_mobile = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
receiver_zip = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
receiver = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
invoice_type = table.Column<int>(type: "int", nullable: false),
source_type = table.Column<int>(type: "int", nullable: false),
skuid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
seckill_stock = table.Column<int>(type: "int", nullable: false),
seckill_total = table.Column<int>(type: "int", nullable: false),
stock_count = table.Column<int>(type: "int", nullable: false),
skuid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(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");
}
}
}

View File

@@ -0,0 +1,770 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("image")
.HasColumnType("longtext")
.HasComment("品牌图片");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("letter")
.HasColumnType("longtext")
.HasComment("品牌首字母");
b.Property<string>("name")
.HasColumnType("longtext")
.HasComment("品牌名称");
b.HasKey("id");
b.ToTable("brand");
});
modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_parent")
.HasColumnType("int")
.HasComment("是否父类别");
b.Property<string>("name")
.HasColumnType("longtext")
.HasComment("类别名称");
b.Property<int>("sort")
.HasColumnType("int")
.HasComment("排序");
b.HasKey("id");
b.HasIndex("categoryid");
b.ToTable("category");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_show")
.HasColumnType("int");
b.Property<int>("is_top")
.HasColumnType("int");
b.Property<string>("menu_name")
.HasColumnType("longtext");
b.Property<int?>("menuid")
.HasColumnType("int");
b.Property<int?>("mouldid")
.HasColumnType("int");
b.Property<int?>("roleid")
.HasColumnType("int");
b.Property<string>("router")
.HasColumnType("longtext");
b.Property<int>("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("menuid");
b.HasIndex("mouldid");
b.HasIndex("roleid");
b.ToTable("menu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("mould_name")
.HasColumnType("longtext");
b.Property<string>("url")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.order", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("actual_pay")
.HasColumnType("int")
.HasComment("实付金额。单位:分。如:20007表示:200元7分");
b.Property<string>("buyer_message")
.HasColumnType("longtext")
.HasComment("买家留言");
b.Property<string>("buyer_nick")
.HasColumnType("longtext")
.HasComment("买家昵称");
b.Property<int>("buyer_rate")
.HasColumnType("int")
.HasComment("买家是否已经评价,0未评价1已评价");
b.Property<DateTime>("creat_time")
.HasColumnType("datetime(6)")
.HasComment("订单创建时间");
b.Property<int>("invoice_type")
.HasColumnType("int")
.HasComment("发票类型:0无发票1普通发票2电子发票3增值税发票");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("payment_type")
.HasColumnType("int")
.HasComment("支付类型1、在线支付2、货到付款");
b.Property<int>("post_fee")
.HasColumnType("int")
.HasComment("邮费。单位:分。如:20007表示:200元7分");
b.Property<string>("promotion_ids")
.HasColumnType("longtext")
.HasComment("promotion_ids");
b.Property<string>("receiver")
.HasColumnType("longtext")
.HasComment("收货人");
b.Property<string>("receiver_address")
.HasColumnType("longtext")
.HasComment("收获地址(街道、住址等详细地址)");
b.Property<string>("receiver_city")
.HasColumnType("longtext")
.HasComment("收获地址(市)");
b.Property<string>("receiver_district")
.HasColumnType("longtext")
.HasComment("收获地址(区/县)");
b.Property<string>("receiver_mobile")
.HasColumnType("longtext")
.HasComment("收货人手机");
b.Property<string>("receiver_state")
.HasColumnType("longtext")
.HasComment("收获地址(省)");
b.Property<string>("receiver_zip")
.HasColumnType("longtext")
.HasComment("收货人邮编");
b.Property<string>("shipping_code")
.HasColumnType("longtext")
.HasComment("物流单号");
b.Property<string>("shipping_name")
.HasColumnType("longtext")
.HasComment("物流名称");
b.Property<int?>("skuid")
.HasColumnType("int");
b.Property<int>("source_type")
.HasColumnType("int")
.HasComment("订单来源1:app端2pc端3M端4微信端5手机qq端");
b.Property<int>("total_pay")
.HasColumnType("int")
.HasComment("总金额,单位为分");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("order");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("introduce")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("role_name")
.HasColumnType("longtext");
b.Property<int?>("userid")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("userid");
b.ToTable("role");
});
modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("crate_time")
.HasColumnType("datetime(6)")
.HasComment("创建时间");
b.Property<int>("enable")
.HasColumnType("int")
.HasComment("是否有效0无效1有效");
b.Property<string>("images")
.HasColumnType("longtext")
.HasComment("商品的图片,多个图片以‘,’分割");
b.Property<string>("indexes")
.HasColumnType("longtext")
.HasComment("特有规格属性在spu属性模板中的对应下标组合");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<DateTime>("last_update_time")
.HasColumnType("datetime(6)")
.HasComment("最后更新时间");
b.Property<string>("own_spec")
.HasColumnType("longtext")
.HasComment("sku的特有规格参数键值对json格式反序列化时请使用linkedHashMap保证有序");
b.Property<int>("price")
.HasColumnType("int")
.HasComment("销售价格,单位为分");
b.Property<int?>("spuid")
.HasColumnType("int");
b.Property<string>("title")
.HasColumnType("longtext")
.HasComment("商品标题");
b.HasKey("id");
b.HasIndex("spuid");
b.ToTable("sku");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("generic")
.HasColumnType("int")
.HasComment("是否是sku通用属性true或false");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("name")
.HasColumnType("longtext")
.HasComment("参数名");
b.Property<int>("numeric")
.HasColumnType("int")
.HasComment("是否是数字类型参数true或false");
b.Property<int>("searching")
.HasColumnType("int")
.HasComment("是否用于搜索过滤true或false");
b.Property<string>("segments")
.HasColumnType("longtext")
.HasComment("数值类型参数如果需要搜索则添加分段间隔值如CPU频率间隔0.5-1.0");
b.Property<int?>("spec_Groupid")
.HasColumnType("int");
b.Property<string>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("brandid")
.HasColumnType("int");
b.Property<DateTime>("crate_time")
.HasColumnType("datetime(6)")
.HasComment("创建时间");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<DateTime>("last_update_time")
.HasColumnType("datetime(6)")
.HasComment("最后更新时间");
b.Property<int>("saleable")
.HasColumnType("int")
.HasComment("是否上架");
b.Property<int?>("spu_Detailid")
.HasColumnType("int");
b.Property<string>("sub_title")
.HasColumnType("longtext")
.HasComment("子标题");
b.Property<string>("title")
.HasColumnType("longtext")
.HasComment("标题");
b.Property<int>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("after_service")
.HasColumnType("longtext")
.HasComment("售后服务");
b.Property<string>("description")
.HasColumnType("longtext")
.HasComment("描述");
b.Property<string>("generic_spec")
.HasColumnType("longtext")
.HasComment("通用规格参数数据");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("packing_list")
.HasColumnType("longtext")
.HasComment("包装清单");
b.Property<string>("special_spec")
.HasColumnType("longtext")
.HasComment("特有规格参数及可选值信息json格式");
b.HasKey("id");
b.ToTable("spu_detail");
});
modelBuilder.Entity("Yi.Framework.Model.Models.stock", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("seckill_stock")
.HasColumnType("int")
.HasComment("可秒杀库存");
b.Property<int>("seckill_total")
.HasColumnType("int")
.HasComment("秒杀总数量");
b.Property<int?>("skuid")
.HasColumnType("int");
b.Property<int>("stock_count")
.HasColumnType("int")
.HasComment("库存数量");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("stock");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("address")
.HasColumnType("longtext");
b.Property<int?>("age")
.HasColumnType("int");
b.Property<string>("email")
.HasColumnType("longtext");
b.Property<string>("icon")
.HasColumnType("longtext");
b.Property<string>("introduction")
.HasColumnType("longtext");
b.Property<string>("ip")
.HasColumnType("longtext");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("nick")
.HasColumnType("longtext");
b.Property<string>("password")
.HasColumnType("longtext");
b.Property<int?>("phone")
.HasColumnType("int");
b.Property<string>("username")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("user");
});
modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("num")
.HasColumnType("int");
b.Property<DateTime>("time")
.HasColumnType("datetime(6)");
b.HasKey("id");
b.ToTable("visit");
});
modelBuilder.Entity("brandcategory", b =>
{
b.Property<int>("brandsid")
.HasColumnType("int");
b.Property<int>("categoriesid")
.HasColumnType("int");
b.HasKey("brandsid", "categoriesid");
b.HasIndex("categoriesid");
b.ToTable("brandcategory");
});
modelBuilder.Entity("categoryspu", b =>
{
b.Property<int>("categoriesid")
.HasColumnType("int");
b.Property<int>("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
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("image")
.HasColumnType("longtext")
.HasComment("品牌图片");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("letter")
.HasColumnType("longtext")
.HasComment("品牌首字母");
b.Property<string>("name")
.HasColumnType("longtext")
.HasComment("品牌名称");
b.HasKey("id");
b.ToTable("brand");
});
modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("is_parent")
.HasColumnType("int")
.HasComment("是否父类别");
b.Property<string>("name")
.HasColumnType("longtext")
.HasComment("类别名称");
b.Property<int>("sort")
.HasColumnType("int")
.HasComment("排序");
b.HasKey("id");
b.HasIndex("categoryid");
b.ToTable("category");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Property<int>("id")
@@ -84,6 +141,105 @@ namespace Yi.Framework.Model.Migrations
b.ToTable("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.order", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("actual_pay")
.HasColumnType("int")
.HasComment("实付金额。单位:分。如:20007表示:200元7分");
b.Property<string>("buyer_message")
.HasColumnType("longtext")
.HasComment("买家留言");
b.Property<string>("buyer_nick")
.HasColumnType("longtext")
.HasComment("买家昵称");
b.Property<int>("buyer_rate")
.HasColumnType("int")
.HasComment("买家是否已经评价,0未评价1已评价");
b.Property<DateTime>("creat_time")
.HasColumnType("datetime(6)")
.HasComment("订单创建时间");
b.Property<int>("invoice_type")
.HasColumnType("int")
.HasComment("发票类型:0无发票1普通发票2电子发票3增值税发票");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("payment_type")
.HasColumnType("int")
.HasComment("支付类型1、在线支付2、货到付款");
b.Property<int>("post_fee")
.HasColumnType("int")
.HasComment("邮费。单位:分。如:20007表示:200元7分");
b.Property<string>("promotion_ids")
.HasColumnType("longtext")
.HasComment("promotion_ids");
b.Property<string>("receiver")
.HasColumnType("longtext")
.HasComment("收货人");
b.Property<string>("receiver_address")
.HasColumnType("longtext")
.HasComment("收获地址(街道、住址等详细地址)");
b.Property<string>("receiver_city")
.HasColumnType("longtext")
.HasComment("收获地址(市)");
b.Property<string>("receiver_district")
.HasColumnType("longtext")
.HasComment("收获地址(区/县)");
b.Property<string>("receiver_mobile")
.HasColumnType("longtext")
.HasComment("收货人手机");
b.Property<string>("receiver_state")
.HasColumnType("longtext")
.HasComment("收获地址(省)");
b.Property<string>("receiver_zip")
.HasColumnType("longtext")
.HasComment("收货人邮编");
b.Property<string>("shipping_code")
.HasColumnType("longtext")
.HasComment("物流单号");
b.Property<string>("shipping_name")
.HasColumnType("longtext")
.HasComment("物流名称");
b.Property<int?>("skuid")
.HasColumnType("int");
b.Property<int>("source_type")
.HasColumnType("int")
.HasComment("订单来源1:app端2pc端3M端4微信端5手机qq端");
b.Property<int>("total_pay")
.HasColumnType("int")
.HasComment("总金额,单位为分");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("order");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Property<int>("id")
@@ -109,6 +265,241 @@ namespace Yi.Framework.Model.Migrations
b.ToTable("role");
});
modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("crate_time")
.HasColumnType("datetime(6)")
.HasComment("创建时间");
b.Property<int>("enable")
.HasColumnType("int")
.HasComment("是否有效0无效1有效");
b.Property<string>("images")
.HasColumnType("longtext")
.HasComment("商品的图片,多个图片以‘,’分割");
b.Property<string>("indexes")
.HasColumnType("longtext")
.HasComment("特有规格属性在spu属性模板中的对应下标组合");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<DateTime>("last_update_time")
.HasColumnType("datetime(6)")
.HasComment("最后更新时间");
b.Property<string>("own_spec")
.HasColumnType("longtext")
.HasComment("sku的特有规格参数键值对json格式反序列化时请使用linkedHashMap保证有序");
b.Property<int>("price")
.HasColumnType("int")
.HasComment("销售价格,单位为分");
b.Property<int?>("spuid")
.HasColumnType("int");
b.Property<string>("title")
.HasColumnType("longtext")
.HasComment("商品标题");
b.HasKey("id");
b.HasIndex("spuid");
b.ToTable("sku");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("categoryid")
.HasColumnType("int");
b.Property<int>("generic")
.HasColumnType("int")
.HasComment("是否是sku通用属性true或false");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("name")
.HasColumnType("longtext")
.HasComment("参数名");
b.Property<int>("numeric")
.HasColumnType("int")
.HasComment("是否是数字类型参数true或false");
b.Property<int>("searching")
.HasColumnType("int")
.HasComment("是否用于搜索过滤true或false");
b.Property<string>("segments")
.HasColumnType("longtext")
.HasComment("数值类型参数如果需要搜索则添加分段间隔值如CPU频率间隔0.5-1.0");
b.Property<int?>("spec_Groupid")
.HasColumnType("int");
b.Property<string>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int?>("brandid")
.HasColumnType("int");
b.Property<DateTime>("crate_time")
.HasColumnType("datetime(6)")
.HasComment("创建时间");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<DateTime>("last_update_time")
.HasColumnType("datetime(6)")
.HasComment("最后更新时间");
b.Property<int>("saleable")
.HasColumnType("int")
.HasComment("是否上架");
b.Property<int?>("spu_Detailid")
.HasColumnType("int");
b.Property<string>("sub_title")
.HasColumnType("longtext")
.HasComment("子标题");
b.Property<string>("title")
.HasColumnType("longtext")
.HasComment("标题");
b.Property<int>("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<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("after_service")
.HasColumnType("longtext")
.HasComment("售后服务");
b.Property<string>("description")
.HasColumnType("longtext")
.HasComment("描述");
b.Property<string>("generic_spec")
.HasColumnType("longtext")
.HasComment("通用规格参数数据");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<string>("packing_list")
.HasColumnType("longtext")
.HasComment("包装清单");
b.Property<string>("special_spec")
.HasColumnType("longtext")
.HasComment("特有规格参数及可选值信息json格式");
b.HasKey("id");
b.ToTable("spu_detail");
});
modelBuilder.Entity("Yi.Framework.Model.Models.stock", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("is_delete")
.HasColumnType("int");
b.Property<int>("seckill_stock")
.HasColumnType("int")
.HasComment("可秒杀库存");
b.Property<int>("seckill_total")
.HasColumnType("int")
.HasComment("秒杀总数量");
b.Property<int?>("skuid")
.HasColumnType("int");
b.Property<int>("stock_count")
.HasColumnType("int")
.HasComment("库存数量");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("stock");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Property<int>("id")
@@ -173,6 +564,43 @@ namespace Yi.Framework.Model.Migrations
b.ToTable("visit");
});
modelBuilder.Entity("brandcategory", b =>
{
b.Property<int>("brandsid")
.HasColumnType("int");
b.Property<int>("categoriesid")
.HasColumnType("int");
b.HasKey("brandsid", "categoriesid");
b.HasIndex("categoriesid");
b.ToTable("brandcategory");
});
modelBuilder.Entity("categoryspu", b =>
{
b.Property<int>("categoriesid")
.HasColumnType("int");
b.Property<int>("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");

View File

@@ -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<int>
{
[Comment("品牌名称")]
public string name { get; set; }
[Comment("品牌图片")]
public string image { get; set; }
[Comment("品牌首字母")]
public string letter { get; set; }
[Comment("类别")]
public List<category > categories { get; set; }
[Comment("spu")]
public List<spu> spus { get; set; }
}
}

View File

@@ -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<int>
{
[Comment("类别名称")]
public string name { get; set; }
[Comment("排序")]
public int sort { get; set; }
[Comment("是否父类别")]
public int is_parent { get; set; }
[Comment("子类别")]
public List<category> chidrens { get; set; }
[Comment("品牌")]
public List<brand> brands { get; set; }
[Comment("spu")]
public List<spu> spus { get; set; }
[Comment("规格组")]
public List<spec_group> spec_Groups { get; set; }
[Comment("规格")]
public List<spec_param> spec_Params { get; set; }
}
}

View File

@@ -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<int>
{
[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端2pc端3M端4微信端5手机qq端")]
public int source_type { get; set; }
}
}

View File

@@ -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<int>
{
[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<order> orders { get; set; }
}
}

View File

@@ -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<int>
{
[Comment("规格组名称")]
public string name { get; set; }
[Comment("类别")]
public category category { get; set; }
[Comment("规格")]
public List<spec_param> spec_Params { get; set; }
}
}

View File

@@ -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<int>
{
[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; }
}
}

View File

@@ -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<int>
{
[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<category> categories { get; set; }
[Comment("品牌")]
public brand brand { get; set; }
[Comment("spu详情")]
public spu_detail spu_Detail { get; set; }
[Comment("skus")]
public List<sku> skus { get; set; }
}
}

View File

@@ -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<int>
{
[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; }
}
}

View File

@@ -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<int>
{
[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; }
}
}

View File

@@ -8,9 +8,18 @@ namespace Yi.Framework.Model
{
public partial class DataContext :DbContext
{
public DbSet<brand> brand { get; set; }
public DbSet<category> category { get; set; }
public DbSet<menu> menu { get; set; }
public DbSet<mould> mould { get; set; }
public DbSet<order> order { get; set; }
public DbSet<role> role { get; set; }
public DbSet<sku> sku { get; set; }
public DbSet<spec_group> spec_group { get; set; }
public DbSet<spec_param> spec_param { get; set; }
public DbSet<spu> spu { get; set; }
public DbSet<spu_detail> spu_detail { get; set; }
public DbSet<stock> stock { get; set; }
public DbSet<user> user { get; set; }
public DbSet<visit> visit { get; set; }
}

View File

@@ -41,6 +41,7 @@ namespace Yi.Framework.Service
return TreeMenuBuild.Sort(TreeMenuBuild.Normal(menu_data));
}
public async Task<List<menu>> GetTopMenusByTopMenuIds(List<int> menuIds)
{
return await _DbRead.Set<menu>().AsNoTracking().Where(u => menuIds.Contains(u.id)).OrderBy(u=>u.sort).ToListAsync();

View File

@@ -11,6 +11,42 @@ using Yi.Framework.Model.ModelFactory;
namespace Yi.Framework.Service
{
public partial class BrandService:BaseService<brand>,IBrandService
{
public BrandService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<brand>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class CategoryService:BaseService<category>,ICategoryService
{
public CategoryService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<category>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class MenuService:BaseService<menu>,IMenuService
{
public MenuService(IDbContextFactory DbFactory):base(DbFactory){ }
@@ -47,6 +83,24 @@ namespace Yi.Framework.Service
}
public partial class OrderService:BaseService<order>,IOrderService
{
public OrderService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<order>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class RoleService:BaseService<role>,IRoleService
{
public RoleService(IDbContextFactory DbFactory):base(DbFactory){ }
@@ -65,6 +119,114 @@ namespace Yi.Framework.Service
}
public partial class SkuService:BaseService<sku>,ISkuService
{
public SkuService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<sku>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class Spec_groupService:BaseService<spec_group>,ISpec_groupService
{
public Spec_groupService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<spec_group>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class Spec_paramService:BaseService<spec_param>,ISpec_paramService
{
public Spec_paramService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<spec_param>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class SpuService:BaseService<spu>,ISpuService
{
public SpuService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<spu>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class Spu_detailService:BaseService<spu_detail>,ISpu_detailService
{
public Spu_detailService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<spu_detail>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class StockService:BaseService<stock>,IStockService
{
public StockService(IDbContextFactory DbFactory):base(DbFactory){ }
public async Task<bool> DelListByUpdateAsync(List<int> _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<IEnumerable<stock>> GetAllEntitiesTrueAsync()
{
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
}
}
public partial class UserService:BaseService<user>,IUserService
{
public UserService(IDbContextFactory DbFactory):base(DbFactory){ }