提交.Net6版本

This commit is contained in:
橙子
2021-12-25 14:50:54 +08:00
parent aebf12a7ca
commit 6503ad905b
443 changed files with 17839 additions and 712 deletions

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Model.Models
{
public class baseModel<T>
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public T id { get; set; }
public int is_delete { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Model.Models
{
public class loopModel:baseModel<int>
{
public int is_top { get; set; }
public int sort { get; set; }
public int is_show { get; set; }
}
}

View File

@@ -0,0 +1,55 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Common.Const;
using Yi.Framework.Common.IOCOptions;
using Yi.Framework.Model.Models;
namespace Yi.Framework.Model
{
//Add-Migration yi-1
//Update-Database yi-1
public partial class DataContext : DbContext
{
//private readonly IOptionsMonitor<MySqlConnOptions> _optionsMonitor;
public static string _connStr;
public static string DbSelect = DbConst.Mysql;
//public DataContext(IOptionsMonitor<MySqlConnOptions> optionsMonitor)
//{
// _optionsMonitor = optionsMonitor;
// _connStr = _optionsMonitor.CurrentValue.WriteUrl;
//}
public DbContext ToWriteOrRead(string connstr)
{
_connStr = connstr;
return this;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
switch (DbSelect)
{
case DbConst.Mysql:
var serverVersion = new MySqlServerVersion(new Version(8, 0, 21));
optionsBuilder.UseMySql(_connStr, serverVersion); break;
case DbConst.Sqlite:
optionsBuilder.UseSqlite(_connStr); break;
case DbConst.Sqlserver:
optionsBuilder.UseSqlServer(_connStr);break;
case DbConst.Oracle:
optionsBuilder.UseOracle(_connStr);break;
default:
Console.WriteLine("错误!请确保你选择了正确的数据库!");break;
}
}
}
}
}

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,248 @@
// <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("20211106082100_yi-1")]
partial class yi1
{
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<string>("router")
.HasColumnType("longtext");
b.Property<int>("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<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.HasKey("id");
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<string>("phone")
.HasColumnType("longtext");
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("menurole", b =>
{
b.Property<int>("menusid")
.HasColumnType("int");
b.Property<int>("rolesid")
.HasColumnType("int");
b.HasKey("menusid", "rolesid");
b.HasIndex("rolesid");
b.ToTable("menurole");
});
modelBuilder.Entity("roleuser", b =>
{
b.Property<int>("rolesid")
.HasColumnType("int");
b.Property<int>("usersid")
.HasColumnType("int");
b.HasKey("rolesid", "usersid");
b.HasIndex("usersid");
b.ToTable("roleuser");
});
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("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.menu", b =>
{
b.Navigation("children");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,231 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Yi.Framework.Model.Migrations
{
public partial class yi1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "mould",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
mould_name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
url = 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_mould", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "role",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
role_name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
introduce = 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_role", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "user",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
username = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
password = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
icon = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
nick = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
email = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ip = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
age = table.Column<int>(type: "int", nullable: true),
introduction = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
address = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
phone = 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_user", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "visit",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
num = table.Column<int>(type: "int", nullable: false),
is_delete = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_visit", x => x.id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "menu",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
icon = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
router = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
menu_name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
mouldid = table.Column<int>(type: "int", nullable: true),
menuid = table.Column<int>(type: "int", nullable: true),
is_delete = table.Column<int>(type: "int", nullable: false),
is_top = table.Column<int>(type: "int", nullable: false),
sort = table.Column<int>(type: "int", nullable: false),
is_show = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_menu", x => x.id);
table.ForeignKey(
name: "FK_menu_menu_menuid",
column: x => x.menuid,
principalTable: "menu",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_menu_mould_mouldid",
column: x => x.mouldid,
principalTable: "mould",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "roleuser",
columns: table => new
{
rolesid = table.Column<int>(type: "int", nullable: false),
usersid = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_roleuser", x => new { x.rolesid, x.usersid });
table.ForeignKey(
name: "FK_roleuser_role_rolesid",
column: x => x.rolesid,
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_roleuser_user_usersid",
column: x => x.usersid,
principalTable: "user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "menurole",
columns: table => new
{
menusid = table.Column<int>(type: "int", nullable: false),
rolesid = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_menurole", x => new { x.menusid, x.rolesid });
table.ForeignKey(
name: "FK_menurole_menu_menusid",
column: x => x.menusid,
principalTable: "menu",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_menurole_role_rolesid",
column: x => x.rolesid,
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_menu_menuid",
table: "menu",
column: "menuid");
migrationBuilder.CreateIndex(
name: "IX_menu_mouldid",
table: "menu",
column: "mouldid");
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.DropTable(
name: "visit");
migrationBuilder.DropTable(
name: "menu");
migrationBuilder.DropTable(
name: "role");
migrationBuilder.DropTable(
name: "user");
migrationBuilder.DropTable(
name: "mould");
}
}
}

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

@@ -0,0 +1,799 @@
// <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("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<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<string>("router")
.HasColumnType("longtext");
b.Property<int>("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<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.HasKey("id");
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<string>("phone")
.HasColumnType("longtext");
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("menurole", b =>
{
b.Property<int>("menusid")
.HasColumnType("int");
b.Property<int>("rolesid")
.HasColumnType("int");
b.HasKey("menusid", "rolesid");
b.HasIndex("rolesid");
b.ToTable("menurole");
});
modelBuilder.Entity("roleuser", b =>
{
b.Property<int>("rolesid")
.HasColumnType("int");
b.Property<int>("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
}
}
}

View File

@@ -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<string>(
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<int>(type: "int", nullable: false),
rolesid = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_menurole", x => new { x.menusid, x.rolesid });
table.ForeignKey(
name: "FK_menurole_menu_menusid",
column: x => x.menusid,
principalTable: "menu",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_menurole_role_rolesid",
column: x => x.rolesid,
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "roleuser",
columns: table => new
{
rolesid = table.Column<int>(type: "int", nullable: false),
usersid = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_roleuser", x => new { x.rolesid, x.usersid });
table.ForeignKey(
name: "FK_roleuser_role_rolesid",
column: x => x.rolesid,
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_roleuser_user_usersid",
column: x => x.usersid,
principalTable: "user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_menurole_rolesid",
table: "menurole",
column: "rolesid");
migrationBuilder.CreateIndex(
name: "IX_roleuser_usersid",
table: "roleuser",
column: "usersid");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "menurole");
migrationBuilder.DropTable(
name: "roleuser");
migrationBuilder.AlterColumn<int>(
name: "phone",
table: "user",
type: "int",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "userid",
table: "role",
type: "int",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "roleid",
table: "menu",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_role_userid",
table: "role",
column: "userid");
migrationBuilder.CreateIndex(
name: "IX_menu_roleid",
table: "menu",
column: "roleid");
migrationBuilder.AddForeignKey(
name: "FK_menu_role_roleid",
table: "menu",
column: "roleid",
principalTable: "role",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_role_user_userid",
table: "role",
column: "userid",
principalTable: "user",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -0,0 +1,797 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
partial class DataContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(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<string>("router")
.HasColumnType("longtext");
b.Property<int>("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<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.HasKey("id");
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<string>("phone")
.HasColumnType("longtext");
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("menurole", b =>
{
b.Property<int>("menusid")
.HasColumnType("int");
b.Property<int>("rolesid")
.HasColumnType("int");
b.HasKey("menusid", "rolesid");
b.HasIndex("rolesid");
b.ToTable("menurole");
});
modelBuilder.Entity("roleuser", b =>
{
b.Property<int>("rolesid")
.HasColumnType("int");
b.Property<int>("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
}
}
}

View File

@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
namespace Yi.Framework.Model.ModelFactory
{
public static class DbContextExtend
{
public static DbContext ToWriteOrRead(this DbContext dbContext, string conn)
{
if (dbContext is DataContext)
{
var context= (DataContext)dbContext; // context 是 EFCoreContext 实例;
return context.ToWriteOrRead(conn);
}
else
throw new Exception();
}
}
}

View File

@@ -0,0 +1,100 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Text;
using Yi.Framework.Common.Enum;
using Yi.Framework.Common.IOCOptions;
namespace Yi.Framework.Model.ModelFactory
{
public class DbContextFactory : IDbContextFactory
{
private DbContext _Context = null;
private DbConnOptions _readAndWrite = null;
public static bool MutiDB_Enabled = false;
//private static int _iSeed = 0;//应该long
/// <summary>
///能把链接信息也注入进来
///需要IOptionsMonitor
/// </summary>
/// <param name="context"></param>
public DbContextFactory(DbContext context, IOptionsMonitor<DbConnOptions> options)
{
_readAndWrite = options.CurrentValue;
this._Context = context;
}
public DbContext ConnWriteOrRead(WriteAndReadEnum writeAndRead)
{
//判断枚举不同的枚举可以创建不同的Context 或者更换Context链接
if (MutiDB_Enabled)
{
switch (writeAndRead)
{
case WriteAndReadEnum.Write:
ToWrite();
break; //选择链接//更换_Context链接 //选择链接
case WriteAndReadEnum.Read:
ToRead();
break; //选择链接//更换_Context链接
default:
break;
}
}
else
{
ToWrite();
}
return _Context;
}
/// <summary>
/// 更换成主库连接
/// </summary>
/// <returns></returns>
private void ToWrite()
{
string conn = _readAndWrite.WriteUrl;
//_Context.Database.GetDbConnection().;
_Context.ToWriteOrRead(conn);
}
private static int _iSeed = 0;
/// <summary>
/// 更换成主库连接
///
/// ///策略---数据库查询的负载均衡
/// </summary>
/// <returns></returns>
private void ToRead()
{
string conn = string.Empty;
{
// //随机
//int Count= _readAndWrite.ReadConnectionList.Count;
//int index= new Random().Next(0, Count);
//conn = _readAndWrite.ReadConnectionList[index];
}
{
//来一个轮询
conn = this._readAndWrite.ReadUrl[_iSeed++ % this._readAndWrite.ReadUrl.Count];//轮询;
}
{
///是不是可以直接配置到配置文件里面
}
_Context.ToWriteOrRead(conn);
}
//public DbContext CreateContext()
//{
//}
}
}

View File

@@ -0,0 +1,13 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using Yi.Framework.Common.Enum;
namespace Yi.Framework.Model.ModelFactory
{
public interface IDbContextFactory
{
public DbContext ConnWriteOrRead(WriteAndReadEnum writeAndRead);
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Model.Models
{
public class menu :loopModel
{
public string icon { get; set; }
public string router { get; set; }
public string menu_name { get; set; }
public List<menu> children { get; set; }
public List<role> roles { get; set; }
public mould mould { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Model.Models
{
public class mould:baseModel<int>
{
public string mould_name { get; set; }
public string url { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Model.Models
{
public class role:baseModel<int>
{
public string role_name { get; set; }
public string introduce { get; set; }
public List<menu> menus { get; set; }
public List<user> users { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
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 user:baseModel<int>
{
public string username { get; set; }
public string password { get; set; }
public string icon { get; set; }
public string nick { get; set; }
public string email { get; set; }
public string ip { get; set; }
public int? age { get; set; }
public string introduction { get; set; }
public string address { get; set; }
public string phone { get; set; }
public List<role> roles { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Model.Models
{
public class visit:baseModel<int>
{
public DateTime time { get; set; }
public int num { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Yi.Framework.Model.Search
{
public class PageResult<T>
{
public static readonly long serialVersionUID = 4612105649493688532L;
public long total; // 总记录数
public int totalPages; //总页数
public List<T> rows; // 每页显示的数据集合
public PageResult(long total, List<T> rows)
{
this.total = total;
this.rows = rows;
}
}
}

View File

@@ -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<string, string> filter = new Dictionary<string, string>();
public int getPage()
{
if (page == 0)
{
return DEFAULT_PAGE;
}
// 获取页码时做一些校验不能小于1
return Math.Max(DEFAULT_PAGE, page);
}
public int getSize()
{
return DEFAULT_SIZE;
}
}
}

View File

@@ -0,0 +1,18 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using Yi.Framework.Model.Models;
namespace Yi.Framework.Model
{
public partial class DataContext :DbContext
{
public DbSet<menu> menu { get; set; }
public DbSet<mould> mould { get; set; }
public DbSet<role> role { get; set; }
public DbSet<user> user { get; set; }
public DbSet<visit> visit { get; set; }
}
}

View File

@@ -0,0 +1,40 @@
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
<#
string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径
string dirPath= Path.Combine(solutionsPath,@"Yi.Framework.Model\Models\");
DirectoryInfo dir = new DirectoryInfo(dirPath);
FileInfo[] finfo = dir.GetFiles();
string filenames = string.Empty;
List<string> filenameList = new List<string>();
for (int i = 0; i < finfo.Length; i++)
{
filenames = finfo[i].Name ;
string[] f=filenames.Split('.');
filenameList.Add(f[0]);
}
#>
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using Yi.Framework.Model.Models;
namespace Yi.Framework.Model
{
public partial class DataContext :DbContext
{
<# foreach(string k in filenameList){
#>
public DbSet<<#=k #>> <#=k #> { get; set; }
<# } #>
}
}

View File

@@ -0,0 +1,59 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Include="T4DataContext.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>T4DataContext.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NEST" Version="7.15.2" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="5.21.3" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Framework.Common\Yi.Framework.Common.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="T4DaraContext.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>T4DaraContext.cs</LastGenOutput>
</None>
<None Update="T4DataContext.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>T4DataContext.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Compile Update="T4DaraContext.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>T4DaraContext.tt</DependentUpon>
</Compile>
<Compile Update="T4DataContext.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>T4DataContext.tt</DependentUpon>
</Compile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="Search\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Framework.Common\Yi.Framework.Common.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,59 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Include="T4DataContext.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>T4DataContext.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NEST" Version="7.16.0" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="6.21.4" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Framework.Common\Yi.Framework.Common.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="T4DaraContext.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>T4DaraContext.cs</LastGenOutput>
</None>
<None Update="T4DataContext.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>T4DataContext.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Compile Update="T4DaraContext.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>T4DaraContext.tt</DependentUpon>
</Compile>
<Compile Update="T4DataContext.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>T4DataContext.tt</DependentUpon>
</Compile>
</ItemGroup>
</Project>