重构优化框架
这是一个大版本的更新 现在,框架更加稳定
@@ -44,7 +44,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{JobConst.method,"get" },
|
||||
{JobConst.url,"https://www.baidu.com" }
|
||||
};
|
||||
await _quartzInvoker.start("*/1 * * * * ? ", new Quartz.JobKey("test", "my"), "HttpJob",data: data);
|
||||
await _quartzInvoker.start("*/5 * * * * ?", new Quartz.JobKey("test", "my"), "Yi.Framework.Job", "HttpJob",data: data);
|
||||
return Result.Success();
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
return Result.Error();
|
||||
}
|
||||
var menuList= await _userService.GetAxiosByRouter(router, _user.id, menuIds);
|
||||
var menuList= await _userService.GetAxiosByRouter(router, menuIds);
|
||||
AxiosUrlsModel urlsModel = new();
|
||||
menuList.ForEach(u =>
|
||||
{
|
||||
|
||||
@@ -43,7 +43,6 @@ builder.Host.ConfigureLogging(loggingBuilder =>
|
||||
//Ioc<6F><63><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
builder.Services.AddIocService(builder.Configuration);
|
||||
|
||||
#region
|
||||
//Quartz<74><7A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
@@ -111,6 +110,7 @@ var app = builder.Build();
|
||||
//<2F><><EFBFBD><EFBFBD>ץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
||||
#endregion
|
||||
app.UseErrorHandlingService();
|
||||
|
||||
#region
|
||||
//<2F><>̬<EFBFBD>ļ<EFBFBD>ע<EFBFBD><D7A2>
|
||||
#endregion
|
||||
|
||||
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 86 KiB |
58
Yi.Framework.Net6/Yi.Framework.Common/Helper/TreeHelper.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
|
||||
namespace Yi.Framework.Common.Helper
|
||||
{
|
||||
public static class TreeHelper
|
||||
{
|
||||
public static IList<T> SetTree<T>(IList<T> list, Action<T> action = null)
|
||||
{
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
IList<T> result = new List<T>();
|
||||
long pid = list.Min(m => (m as ITreeModel<T>).parentId);
|
||||
IList<T> t = list.Where(m => (m as ITreeModel<T>).parentId == pid).ToList();
|
||||
foreach (T model in t)
|
||||
{
|
||||
if (action != null)
|
||||
{
|
||||
action(model);
|
||||
}
|
||||
result.Add(model);
|
||||
var item = (model as ITreeModel<T>);
|
||||
IList<T> children = list.Where(m => (m as ITreeModel<T>).parentId == item.id).ToList();
|
||||
if (children.Count > 0)
|
||||
{
|
||||
SetTreeChildren(list, children, model, action);
|
||||
}
|
||||
}
|
||||
return result.OrderBy(m => (m as ITreeModel<T>).sort).ToList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private static void SetTreeChildren<T>(IList<T> list, IList<T> children, T model, Action<T> action = null)
|
||||
{
|
||||
var mm = (model as ITreeModel<T>);
|
||||
mm.children = new List<T>();
|
||||
foreach (T item in children)
|
||||
{
|
||||
if (action != null)
|
||||
{
|
||||
action(item);
|
||||
}
|
||||
mm.children.Add(item);
|
||||
var _item = (item as ITreeModel<T>);
|
||||
IList<T> _children = list.Where(m => (m as ITreeModel<T>).parentId == _item.id).ToList();
|
||||
if (_children.Count > 0)
|
||||
{
|
||||
SetTreeChildren(list, _children, item, action);
|
||||
}
|
||||
}
|
||||
mm.children = mm.children.OrderBy(m => (m as ITreeModel<T>).sort).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Yi.Framework.Net6/Yi.Framework.Common/Models/ITreeModel.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
public interface ITreeModel<T>
|
||||
{
|
||||
public int id { get; set; }
|
||||
public int parentId { get; set; }
|
||||
public int sort { get; set; }
|
||||
|
||||
public IList<T> children { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -34,14 +34,14 @@ namespace Yi.Framework.Core
|
||||
/// <param name="second"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public async Task start(string cron, JobKey jobKey, string jobClass, long second = 0, IDictionary<string, object> data = null)
|
||||
public async Task start(string cron, JobKey jobKey, string dllName,string jobClass, long second = 0, IDictionary<string, object> data = null)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
data = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
var myClass = AssemblyHelper.GetClass("Yi.Framework.Job", jobClass).FirstOrDefault();
|
||||
var myClass = AssemblyHelper.GetClass(dllName, jobClass).FirstOrDefault();
|
||||
|
||||
_scheduler = await _schedulerFactory.GetScheduler();
|
||||
_scheduler.JobFactory = _jobFactory;
|
||||
|
||||
@@ -9,100 +9,101 @@ namespace Yi.Framework.Core
|
||||
{
|
||||
public static class TreeMenuBuild
|
||||
{
|
||||
/// <summary>
|
||||
/// 过滤所有已经删除的菜单
|
||||
/// </summary>
|
||||
/// <param name="menu_data"></param>
|
||||
/// <returns></returns>
|
||||
public static menu Normal(menu menu_data)
|
||||
{
|
||||
for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
{
|
||||
if (menu_data.children[i].is_delete == (short)Common.Enum.DelFlagEnum.Deleted)
|
||||
{
|
||||
menu_data.children.Remove(menu_data.children[i]);
|
||||
}
|
||||
else if (menu_data.children[i] != null)
|
||||
{
|
||||
Normal(menu_data.children[i]);
|
||||
}
|
||||
}
|
||||
return menu_data;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// 过滤所有已经删除的菜单
|
||||
// /// </summary>
|
||||
// /// <param name="menu_data"></param>
|
||||
// /// <returns></returns>
|
||||
// public static menu Normal(menu menu_data)
|
||||
// {
|
||||
// for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
// {
|
||||
// if (menu_data.children[i].is_delete == (short)Common.Enum.DelFlagEnum.Deleted)
|
||||
// {
|
||||
// menu_data.children.Remove(menu_data.children[i]);
|
||||
// }
|
||||
// else if (menu_data.children[i] != null)
|
||||
// {
|
||||
// Normal(menu_data.children[i]);
|
||||
// }
|
||||
// }
|
||||
// return menu_data;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public static menu ShowFormat(menu menu_data, List<int> allMenuIds)
|
||||
{
|
||||
return Format(Show(menu_data, allMenuIds));
|
||||
}
|
||||
// public static menu ShowFormat(menu menu_data, List<int> allMenuIds)
|
||||
// {
|
||||
// return Format(Show(menu_data, allMenuIds));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 过滤用户不展示及已删除及未拥有的菜单
|
||||
/// </summary>
|
||||
/// <param name="menu_data"></param>
|
||||
/// <param name="allMenuIds"></param>
|
||||
/// <returns></returns>
|
||||
private static menu Show(menu menu_data, List<int> allMenuIds)
|
||||
{
|
||||
for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
{
|
||||
if (!allMenuIds.Contains(menu_data.children[i].id) || menu_data.children[i].is_delete == (short)Common.Enum.DelFlagEnum.Deleted || menu_data.children[i].is_show == (short)Common.Enum.ShowFlagEnum.NoShow)
|
||||
{
|
||||
menu_data.children.Remove(menu_data.children[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Show(menu_data.children[i], allMenuIds);
|
||||
}
|
||||
}
|
||||
return menu_data;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// 过滤用户不展示及已删除及未拥有的菜单
|
||||
// /// </summary>
|
||||
// /// <param name="menu_data"></param>
|
||||
// /// <param name="allMenuIds"></param>
|
||||
// /// <returns></returns>
|
||||
// private static menu Show(menu menu_data, List<int> allMenuIds)
|
||||
// {
|
||||
// for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
// {
|
||||
// if (!allMenuIds.Contains(menu_data.children[i].id) || menu_data.children[i].is_delete == (short)Common.Enum.DelFlagEnum.Deleted || menu_data.children[i].is_show == (short)Common.Enum.ShowFlagEnum.NoShow)
|
||||
// {
|
||||
// menu_data.children.Remove(menu_data.children[i]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Show(menu_data.children[i], allMenuIds);
|
||||
// }
|
||||
// }
|
||||
// return menu_data;
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 为了匹配前端格式,通常和show方法一起
|
||||
/// </summary>
|
||||
/// <param name="menu_data"></param>
|
||||
/// <returns></returns>
|
||||
private static menu Format(menu menu_data)
|
||||
{
|
||||
for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
{
|
||||
if (menu_data.children[i].icon == null)
|
||||
{
|
||||
menu_data.children[i].icon = "mdi-view-dashboard";
|
||||
}
|
||||
if (menu_data.children != null || menu_data.children.Count() != 0)
|
||||
{
|
||||
Format(menu_data.children[i]);
|
||||
}
|
||||
}
|
||||
if (menu_data.children.Count() == 0)
|
||||
{
|
||||
menu_data.children = null;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// 为了匹配前端格式,通常和show方法一起
|
||||
// /// </summary>
|
||||
// /// <param name="menu_data"></param>
|
||||
// /// <returns></returns>
|
||||
// private static menu Format(menu menu_data)
|
||||
// {
|
||||
// for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
// {
|
||||
// if (menu_data.children[i].icon == null)
|
||||
// {
|
||||
// menu_data.children[i].icon = "mdi-view-dashboard";
|
||||
// }
|
||||
// if (menu_data.children != null || menu_data.children.Count() != 0)
|
||||
// {
|
||||
// Format(menu_data.children[i]);
|
||||
// }
|
||||
// }
|
||||
// if (menu_data.children.Count() == 0)
|
||||
// {
|
||||
// menu_data.children = null;
|
||||
// }
|
||||
|
||||
return menu_data;
|
||||
}
|
||||
// return menu_data;
|
||||
// }
|
||||
|
||||
public static menu Sort(menu menu_data)
|
||||
{
|
||||
if (menu_data.children != null)
|
||||
{
|
||||
for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
{
|
||||
menu_data.children = menu_data.children.AsEnumerable().OrderByDescending(u => u.sort).ToList();
|
||||
// public static menu Sort(menu menu_data)
|
||||
// {
|
||||
// if (menu_data.children != null)
|
||||
// {
|
||||
// for (int i = menu_data.children.Count() - 1; i >= 0; i--)
|
||||
// {
|
||||
// menu_data.children = menu_data.children.AsEnumerable().OrderByDescending(u => u.sort).ToList();
|
||||
|
||||
if (menu_data.children != null || menu_data.children.Count() != 0)
|
||||
{
|
||||
Sort(menu_data.children[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return menu_data;
|
||||
}
|
||||
// if (menu_data.children != null || menu_data.children.Count() != 0)
|
||||
// {
|
||||
// Sort(menu_data.children[i]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return menu_data;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Yi.Framework.Interface
|
||||
/// </summary>
|
||||
/// <param name="router"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<menu>> GetAxiosByRouter(string router,int userId, List<int> menuIds);
|
||||
Task<List<menu>> GetAxiosByRouter(string router, List<int> menuIds);
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class loopModel:baseModel<int>
|
||||
public class loopModel<T>:baseModel<int>
|
||||
{
|
||||
public int is_top { get; set; }
|
||||
public int sort { get; set; }
|
||||
public int is_show { get; set; }
|
||||
public int parentId { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public IList<T> children { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,219 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Yi.Framework.Model;
|
||||
|
||||
namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,732 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Yi.Framework.Model;
|
||||
|
||||
namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,436 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,770 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Yi.Framework.Model;
|
||||
|
||||
namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("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端,2:pc端,3:M端,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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,799 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Yi.Framework.Model;
|
||||
|
||||
namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("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端,2:pc端,3:M端,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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,50 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Yi.Framework.Model;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20211106082100_yi-1")]
|
||||
[Migration("20220221034128_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");
|
||||
.HasAnnotation("ProductVersion", "6.0.1")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
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 =>
|
||||
{
|
||||
@@ -40,10 +72,10 @@ namespace Yi.Framework.Model.Migrations
|
||||
b.Property<string>("menu_name")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int?>("menuid")
|
||||
b.Property<int?>("mouldid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("mouldid")
|
||||
b.Property<int>("parentId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("router")
|
||||
@@ -54,8 +86,6 @@ namespace Yi.Framework.Model.Migrations
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("menuid");
|
||||
|
||||
b.HasIndex("mouldid");
|
||||
|
||||
b.ToTable("menu");
|
||||
@@ -165,49 +195,6 @@ namespace Yi.Framework.Model.Migrations
|
||||
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)
|
||||
@@ -240,7 +227,11 @@ namespace Yi.Framework.Model.Migrations
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
||||
{
|
||||
b.Navigation("children");
|
||||
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
|
||||
.WithMany()
|
||||
.HasForeignKey("mouldid");
|
||||
|
||||
b.Navigation("mould");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
public partial class yi1 : Migration
|
||||
@@ -109,27 +111,20 @@ namespace Yi.Framework.Model.Migrations
|
||||
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)
|
||||
is_show = table.Column<int>(type: "int", nullable: false),
|
||||
parentId = 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);
|
||||
principalColumn: "id");
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
@@ -183,11 +178,6 @@ namespace Yi.Framework.Model.Migrations
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_menu_menuid",
|
||||
table: "menu",
|
||||
column: "menuid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_menu_mouldid",
|
||||
table: "menu",
|
||||
@@ -5,6 +5,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Yi.Framework.Model;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
@@ -14,64 +16,37 @@ namespace Yi.Framework.Model.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.11");
|
||||
.HasAnnotation("ProductVersion", "6.0.1")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.brand", b =>
|
||||
modelBuilder.Entity("menurole", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
b.Property<int>("menusid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("image")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("品牌图片");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
b.Property<int>("rolesid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("letter")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("品牌首字母");
|
||||
b.HasKey("menusid", "rolesid");
|
||||
|
||||
b.Property<string>("name")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("品牌名称");
|
||||
b.HasIndex("rolesid");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("brand");
|
||||
b.ToTable("menurole");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
|
||||
modelBuilder.Entity("roleuser", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
b.Property<int>("rolesid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("categoryid")
|
||||
b.Property<int>("usersid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
b.HasKey("rolesid", "usersid");
|
||||
|
||||
b.Property<int>("is_parent")
|
||||
.HasColumnType("int")
|
||||
.HasComment("是否父类别");
|
||||
b.HasIndex("usersid");
|
||||
|
||||
b.Property<string>("name")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("类别名称");
|
||||
|
||||
b.Property<int>("sort")
|
||||
.HasColumnType("int")
|
||||
.HasComment("排序");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("categoryid");
|
||||
|
||||
b.ToTable("category");
|
||||
b.ToTable("roleuser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
||||
@@ -95,10 +70,10 @@ namespace Yi.Framework.Model.Migrations
|
||||
b.Property<string>("menu_name")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int?>("menuid")
|
||||
b.Property<int?>("mouldid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("mouldid")
|
||||
b.Property<int>("parentId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("router")
|
||||
@@ -109,8 +84,6 @@ namespace Yi.Framework.Model.Migrations
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("menuid");
|
||||
|
||||
b.HasIndex("mouldid");
|
||||
|
||||
b.ToTable("menu");
|
||||
@@ -136,105 +109,6 @@ namespace Yi.Framework.Model.Migrations
|
||||
b.ToTable("mould");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.order", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("actual_pay")
|
||||
.HasColumnType("int")
|
||||
.HasComment("实付金额。单位:分。如:20007,表示:200元7分");
|
||||
|
||||
b.Property<string>("buyer_message")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("买家留言");
|
||||
|
||||
b.Property<string>("buyer_nick")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("买家昵称");
|
||||
|
||||
b.Property<int>("buyer_rate")
|
||||
.HasColumnType("int")
|
||||
.HasComment("买家是否已经评价,0未评价,1已评价");
|
||||
|
||||
b.Property<DateTime>("creat_time")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("订单创建时间");
|
||||
|
||||
b.Property<int>("invoice_type")
|
||||
.HasColumnType("int")
|
||||
.HasComment("发票类型:0无发票1普通发票,2电子发票,3增值税发票");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("payment_type")
|
||||
.HasColumnType("int")
|
||||
.HasComment("支付类型,1、在线支付,2、货到付款");
|
||||
|
||||
b.Property<int>("post_fee")
|
||||
.HasColumnType("int")
|
||||
.HasComment("邮费。单位:分。如:20007,表示:200元7分");
|
||||
|
||||
b.Property<string>("promotion_ids")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("promotion_ids");
|
||||
|
||||
b.Property<string>("receiver")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("收货人");
|
||||
|
||||
b.Property<string>("receiver_address")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("收获地址(街道、住址等详细地址)");
|
||||
|
||||
b.Property<string>("receiver_city")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("收获地址(市)");
|
||||
|
||||
b.Property<string>("receiver_district")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("收获地址(区/县)");
|
||||
|
||||
b.Property<string>("receiver_mobile")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("收货人手机");
|
||||
|
||||
b.Property<string>("receiver_state")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("收获地址(省)");
|
||||
|
||||
b.Property<string>("receiver_zip")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("收货人邮编");
|
||||
|
||||
b.Property<string>("shipping_code")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("物流单号");
|
||||
|
||||
b.Property<string>("shipping_name")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("物流名称");
|
||||
|
||||
b.Property<int?>("skuid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("source_type")
|
||||
.HasColumnType("int")
|
||||
.HasComment("订单来源:1:app端,2:pc端,3:M端,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")
|
||||
@@ -255,241 +129,6 @@ namespace Yi.Framework.Model.Migrations
|
||||
b.ToTable("role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("crate_time")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("创建时间");
|
||||
|
||||
b.Property<int>("enable")
|
||||
.HasColumnType("int")
|
||||
.HasComment("是否有效,0无效,1有效");
|
||||
|
||||
b.Property<string>("images")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("商品的图片,多个图片以‘,’分割");
|
||||
|
||||
b.Property<string>("indexes")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("特有规格属性在spu属性模板中的对应下标组合");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("last_update_time")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("最后更新时间");
|
||||
|
||||
b.Property<string>("own_spec")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序");
|
||||
|
||||
b.Property<int>("price")
|
||||
.HasColumnType("int")
|
||||
.HasComment("销售价格,单位为分");
|
||||
|
||||
b.Property<int?>("spuid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("title")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("商品标题");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("spuid");
|
||||
|
||||
b.ToTable("sku");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("categoryid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("name")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("规格组名称");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("categoryid");
|
||||
|
||||
b.ToTable("spec_group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("categoryid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("generic")
|
||||
.HasColumnType("int")
|
||||
.HasComment("是否是sku通用属性,true或false");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("name")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("参数名");
|
||||
|
||||
b.Property<int>("numeric")
|
||||
.HasColumnType("int")
|
||||
.HasComment("是否是数字类型参数,true或false");
|
||||
|
||||
b.Property<int>("searching")
|
||||
.HasColumnType("int")
|
||||
.HasComment("是否用于搜索过滤,true或false");
|
||||
|
||||
b.Property<string>("segments")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("数值类型参数,如果需要搜索,则添加分段间隔值,如CPU频率间隔:0.5-1.0");
|
||||
|
||||
b.Property<int?>("spec_Groupid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("unit")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("数字类型参数的单位,非数字类型可以为空");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("categoryid");
|
||||
|
||||
b.HasIndex("spec_Groupid");
|
||||
|
||||
b.ToTable("spec_param");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.spu", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("brandid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("crate_time")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("创建时间");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("last_update_time")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("最后更新时间");
|
||||
|
||||
b.Property<int>("saleable")
|
||||
.HasColumnType("int")
|
||||
.HasComment("是否上架");
|
||||
|
||||
b.Property<int?>("spu_Detailid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("sub_title")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("子标题");
|
||||
|
||||
b.Property<string>("title")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("标题");
|
||||
|
||||
b.Property<int>("valid")
|
||||
.HasColumnType("int")
|
||||
.HasComment("是否有效");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("brandid");
|
||||
|
||||
b.HasIndex("spu_Detailid");
|
||||
|
||||
b.ToTable("spu");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("after_service")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("售后服务");
|
||||
|
||||
b.Property<string>("description")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("描述");
|
||||
|
||||
b.Property<string>("generic_spec")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("通用规格参数数据");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("packing_list")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("包装清单");
|
||||
|
||||
b.Property<string>("special_spec")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("特有规格参数及可选值信息,json格式");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("spu_detail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.stock", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("is_delete")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("seckill_stock")
|
||||
.HasColumnType("int")
|
||||
.HasComment("可秒杀库存");
|
||||
|
||||
b.Property<int>("seckill_total")
|
||||
.HasColumnType("int")
|
||||
.HasComment("秒杀总数量");
|
||||
|
||||
b.Property<int?>("skuid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("stock_count")
|
||||
.HasColumnType("int")
|
||||
.HasComment("库存数量");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("skuid");
|
||||
|
||||
b.ToTable("stock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
@@ -554,180 +193,6 @@ namespace Yi.Framework.Model.Migrations
|
||||
b.ToTable("visit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("brandcategory", b =>
|
||||
{
|
||||
b.Property<int>("brandsid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("categoriesid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("brandsid", "categoriesid");
|
||||
|
||||
b.HasIndex("categoriesid");
|
||||
|
||||
b.ToTable("brandcategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("categoryspu", b =>
|
||||
{
|
||||
b.Property<int>("categoriesid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("spusid")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("categoriesid", "spusid");
|
||||
|
||||
b.HasIndex("spusid");
|
||||
|
||||
b.ToTable("categoryspu");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("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)
|
||||
@@ -758,38 +223,13 @@ namespace Yi.Framework.Model.Migrations
|
||||
.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");
|
||||
});
|
||||
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
|
||||
.WithMany()
|
||||
.HasForeignKey("mouldid");
|
||||
|
||||
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");
|
||||
b.Navigation("mould");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
|
||||
@@ -3,21 +3,19 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public class menu :loopModel
|
||||
public class menu :loopModel<menu>,ITreeModel<menu>
|
||||
{
|
||||
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; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Common.Helper;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.Models;
|
||||
@@ -12,33 +14,27 @@ namespace Yi.Framework.Service
|
||||
{
|
||||
public partial class MenuService:BaseService<menu>, IMenuService
|
||||
{
|
||||
short Normal = (short)Common.Enum.DelFlagEnum.Normal;
|
||||
short Normal = (short)DelFlagEnum.Normal;
|
||||
public async Task<menu> AddChildrenMenu(int menu_id, menu _children)
|
||||
{
|
||||
var menu_data = await _DbRead.Set<menu>().Include(u => u.children).Where(u => u.id == menu_id).FirstOrDefaultAsync();
|
||||
_children.is_top = (short)Common.Enum.TopFlagEnum.Children;
|
||||
menu_data.children.Add(_children);
|
||||
await UpdateAsync(menu_data);
|
||||
return menu_data;
|
||||
_children.parentId = menu_id;
|
||||
_children.is_top = (short)TopFlagEnum.Children;
|
||||
_children.is_delete = (short)DelFlagEnum.Normal;
|
||||
await AddAsync(_children);
|
||||
return _children;
|
||||
}
|
||||
|
||||
public async Task<bool> AddTopMenu(menu _menu)
|
||||
{
|
||||
_menu.is_top = (short)Common.Enum.TopFlagEnum.Children;
|
||||
_menu.is_top = (short)TopFlagEnum.Children;
|
||||
|
||||
return await AddAsync(_menu);
|
||||
}
|
||||
|
||||
public async Task<menu> GetMenuInMould()
|
||||
{
|
||||
var menu_data= await _DbRead.Set<menu>().Include(u=>u.mould)
|
||||
.Include(u => u.children).ThenInclude(u => u.mould).OrderByDescending(u => u.sort)
|
||||
.Include(u=>u.children).ThenInclude(u => u.children).ThenInclude(u => u.mould)
|
||||
.Include(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.mould)
|
||||
.Include(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.mould)
|
||||
.Where(u =>u.is_delete == Normal && u.is_show == (short)Common.Enum.ShowFlagEnum.Show && u.is_top == (short)Common.Enum.TopFlagEnum.Top)
|
||||
.FirstOrDefaultAsync();
|
||||
return TreeMenuBuild.Sort(TreeMenuBuild.Normal(menu_data));
|
||||
var menu_data = await _DbRead.Set<menu>().Include(u => u.mould).Where(u=>u.is_delete==(short)DelFlagEnum.Normal).ToListAsync();
|
||||
return TreeHelper.SetTree(menu_data, null)[0]; ;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +48,7 @@ namespace Yi.Framework.Service
|
||||
var menu_data = await _DbRead.Set<menu>().Include(u => u.mould).Where(u => u.id == id1).FirstOrDefaultAsync();
|
||||
var mould_data = await _DbRead.Set<mould>().Where(u => u.id == id1).FirstOrDefaultAsync();
|
||||
menu_data.mould = mould_data;
|
||||
_Db.Update(menu_data);
|
||||
_Db.Update(menu_data);
|
||||
return menu_data;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,31 +9,31 @@ using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Service
|
||||
{
|
||||
public partial class RoleService:BaseService<role>, IRoleService
|
||||
public partial class RoleService : BaseService<role>, IRoleService
|
||||
{
|
||||
short Normal = (short)Common.Enum.DelFlagEnum.Normal;
|
||||
|
||||
|
||||
public async Task<List<role>> GetRolesByUserId(int userId)
|
||||
{
|
||||
var user_data =await _Db.Set<user>().Include(u => u.roles).Where(u => u.id==userId).FirstOrDefaultAsync();
|
||||
var roleList = user_data.roles.Where(u=>u.is_delete==Normal).ToList();
|
||||
var user_data = await _Db.Set<user>().Include(u => u.roles).Where(u => u.id == userId).FirstOrDefaultAsync();
|
||||
var roleList = user_data.roles.Where(u => u.is_delete == Normal).ToList();
|
||||
roleList.ForEach(u => u.users = null);
|
||||
return roleList;
|
||||
}
|
||||
|
||||
|
||||
public async Task<bool> SetMenusByRolesId(List<int> menuIds,List<int> roleIds)
|
||||
public async Task<bool> SetMenusByRolesId(List<int> menuIds, List<int> roleIds)
|
||||
{
|
||||
var role_data = await _Db.Set<role>().Include(u => u.menus).ThenInclude(u => u.children).Where(u =>roleIds.Contains(u.id) && u.is_delete == Normal).ToListAsync();
|
||||
var menuList = await _Db.Set<menu>().Where(u => menuIds.Contains(u.id)&&u.is_delete ==Normal).ToListAsync();
|
||||
foreach(var role in role_data)
|
||||
var role_data = await _Db.Set<role>().Include(u => u.menus).Where(u => roleIds.Contains(u.id) && u.is_delete == Normal).ToListAsync();
|
||||
var menuList = await _Db.Set<menu>().Where(u => menuIds.Contains(u.id) && u.is_delete == Normal).ToListAsync();
|
||||
foreach (var role in role_data)
|
||||
{
|
||||
role.menus =menuList;
|
||||
}
|
||||
role.menus = menuList;
|
||||
}
|
||||
return await UpdateListAsync(role_data);
|
||||
}
|
||||
|
||||
public async Task<List<menu>> GetMenusByRoleId(List< int> roleIds)
|
||||
|
||||
public async Task<List<menu>> GetMenusByRoleId(List<int> roleIds)
|
||||
{
|
||||
var role_data = await _Db.Set<role>().Include(u => u.menus).Where(u => roleIds.Contains(u.id) && u.is_delete == Normal).ToListAsync();
|
||||
List<menu> menuList = new();
|
||||
@@ -46,7 +46,7 @@ namespace Yi.Framework.Service
|
||||
}
|
||||
public async Task<List<menu>> GetTopMenusByRoleId(int roleId)
|
||||
{
|
||||
var role_data = await _Db.Set<role>().Include(u=>u.menus).Where(u => u.id == roleId).FirstOrDefaultAsync();
|
||||
var role_data = await _Db.Set<role>().Include(u => u.menus).Where(u => u.id == roleId).FirstOrDefaultAsync();
|
||||
var menuList = role_data.menus.Where(u => u.is_delete == Normal).ToList();
|
||||
|
||||
menuList.ForEach(u => u.roles = null);
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Const;
|
||||
using Yi.Framework.Common.Helper;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.DTOModel;
|
||||
using Yi.Framework.Interface;
|
||||
@@ -49,28 +50,21 @@ namespace Yi.Framework.Service
|
||||
/// <returns></returns>
|
||||
public async Task<user> GetUserById(int userId)
|
||||
{
|
||||
return await _DbRead.Set<user>().Include(u => u.roles).ThenInclude(u => u.menus).ThenInclude(u => u.children).ThenInclude(u => u.mould).Where(u => u.id == userId).FirstOrDefaultAsync();
|
||||
var user_data = await _DbRead.Set<user>().Include(u => u.roles).ThenInclude(u => u.menus).ThenInclude(u => u.mould).Where(u => u.id == userId).FirstOrDefaultAsync();
|
||||
return user_data;
|
||||
|
||||
}
|
||||
public async Task<List<menu>> GetAxiosByRouter(string router, int userId, List<int> menuIds)
|
||||
public async Task<List<menu>> GetAxiosByRouter(string router, List<int> menuIds)
|
||||
{
|
||||
var user_data = await GetUserById(userId);
|
||||
List<menu> menuList = new();
|
||||
foreach (var item in user_data.roles)
|
||||
{
|
||||
var m = item.menus.Where(u => u?.router?.ToUpper() == router.ToUpper()).FirstOrDefault();
|
||||
if (m == null) { break; }
|
||||
menuList = m.children?.Where(u => menuIds.Contains(u.id) && u.is_delete == Normal).ToList();
|
||||
|
||||
}
|
||||
return menuList;
|
||||
var menu_data= await _DbRead.Set<menu>().Where(u => u.router.Trim().ToUpper() == router.Trim().ToUpper() && u.is_delete == (short)Common.Enum.DelFlagEnum.Normal).FirstOrDefaultAsync();
|
||||
return await _DbRead.Set<menu>().Include(u=>u.mould).Where(u => u.parentId == menu_data.id && u.is_delete == (short)Common.Enum.DelFlagEnum.Normal).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<menu> GetMenuByHttpUser(List<int> allMenuIds)
|
||||
{
|
||||
var topMenu = await _DbRead.Set<menu>().Include(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.children).ThenInclude(u => u.children).Where(u => u.is_top == (short)Common.Enum.ShowFlagEnum.Show).FirstOrDefaultAsync();
|
||||
var topMenu = await _DbRead.Set<menu>().Where(u => allMenuIds.Contains(u.id)&& u.is_show == (short)Common.Enum.ShowFlagEnum.Show && u.is_delete == (short)Common.Enum.DelFlagEnum.Normal).ToListAsync();
|
||||
//现在要开始关联菜单了
|
||||
return TreeMenuBuild.Sort(TreeMenuBuild.ShowFormat(topMenu, allMenuIds)); ;
|
||||
return TreeHelper.SetTree(topMenu)[0];
|
||||
}
|
||||
public async Task<user> GetUserInRolesByHttpUser(int userId)
|
||||
{
|
||||
@@ -109,11 +103,11 @@ namespace Yi.Framework.Service
|
||||
|
||||
public bool SaveUserApi(int userId, List<menuDto> menus)
|
||||
{
|
||||
return _cacheClientDB.Set(RedisConst.userMenusApi+":"+userId.ToString(),menus,new TimeSpan(0,30,0));
|
||||
return _cacheClientDB.Set(RedisConst.userMenusApi + ":" + userId.ToString(), menus, new TimeSpan(0, 30, 0));
|
||||
}
|
||||
public List<int> GetCurrentMenuInfo(int userId)
|
||||
{
|
||||
return _cacheClientDB.Get<List<menuDto>>(RedisConst.userMenusApi+":"+userId).Select(u=>u.id).ToList();
|
||||
return _cacheClientDB.Get<List<menuDto>>(RedisConst.userMenusApi + ":" + userId).Select(u => u.id).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,243 +16,63 @@ namespace Yi.Framework.WebCore.Init
|
||||
var _Db = _DbFactory.ConnWriteOrRead(Common.Enum.WriteAndReadEnum.Write);
|
||||
if (!_Db.Set<user>().Any())
|
||||
{
|
||||
await _Db.Set<user>().AddAsync(new user
|
||||
{
|
||||
username = "admin",
|
||||
password = "123",
|
||||
roles = new List<role>()
|
||||
{
|
||||
new role(){ role_name="普通用户"},
|
||||
List<menu> menus = new List<menu>{
|
||||
|
||||
new role()
|
||||
{
|
||||
role_name="管理员",
|
||||
menus = new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="根",is_show=1,is_top=1, children=new List<menu>(){
|
||||
new menu()
|
||||
{
|
||||
menu_name="首页",is_show=1,router="/"
|
||||
},
|
||||
new menu{ id=1, menu_name="根",is_show=1,is_top=1},
|
||||
new menu{ id=2,icon="mdi-view-dashboard", menu_name="首页",is_show=1,is_top=0,router="/",parentId=1},
|
||||
new menu{id=3,icon="mdi-account-box-multiple", menu_name="用户角色管理",is_show=1,is_top=0,parentId=1},
|
||||
|
||||
new menu()
|
||||
{
|
||||
menu_name="用户角色管理",is_show=1, children=new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="用户管理",router="/AdmUser/", is_show=1,children=new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="get",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="get",url="/user/getuser"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="update",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="update",url="/user/updateuser"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="del",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="del",url="/user/dellistUser"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="add",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="add",url="/user/adduser"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="角色管理",router="/admrole/", is_show=1,children=new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="get",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="get",url="/role/getrole"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="update",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="update",url="/role/updaterole"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="del",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="del",url="/role/dellistrole"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="add",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="add",url="/role/addrole"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
new menu{id=4,icon="mdi-account-box", menu_name="用户管理",router="/AdmUser/",is_show=1,is_top=0,parentId=3},
|
||||
new menu{id=5, menu_name="get",is_show=0,is_top=0,parentId=4,mould=new mould{mould_name="get",url="/user/getuser" } },
|
||||
new menu{id=6, menu_name="update",is_show=0,is_top=0,parentId=4,mould=new mould{mould_name="update",url="/user/updateuser" } },
|
||||
new menu{id=7, menu_name="del",is_show=0,is_top=0,parentId=4,mould=new mould{mould_name="del",url="/user/dellistUser" } },
|
||||
new menu{id=8, menu_name="add",is_show=0,is_top=0,parentId=4,mould=new mould{mould_name="add",url="/role/adduser" } },
|
||||
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="角色接口管理",is_show=1, children=new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="菜单管理",router="/AdmMenu/", is_show=1,children=new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="get",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="get",url="/Menu/getMenu"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="update",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="update",url="/Menu/updateMenu"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="del",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="del",url="/Menu/dellistMenu"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="add",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="add",url="/Menu/addMenu"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="接口管理",router="/admMould/", is_show=1,children=new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="get",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="get",url="/Mould/getMould"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="update",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="update",url="/Mould/updateMould"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="del",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="del",url="/Mould/dellistMould"
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="add",is_show=0,
|
||||
mould=new mould()
|
||||
{
|
||||
mould_name="add",url="/Mould/addMould"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="角色菜单分配管理",router="/admRoleMenu/", is_show=1, children=null
|
||||
}
|
||||
}
|
||||
new menu{ id=9,icon="mdi-account-circle", menu_name="角色管理",router="/admrole/",is_show=1,is_top=0,parentId=3},
|
||||
new menu{id=10, menu_name="get",is_show=0,is_top=0,parentId=9,mould=new mould{mould_name="get",url="/role/getrole" } },
|
||||
new menu{id=11, menu_name="update",is_show=0,is_top=0,parentId=9,mould=new mould{mould_name="update",url="/role/updaterole" } },
|
||||
new menu{id=12, menu_name="del",is_show=0,is_top=0,parentId=9,mould=new mould{mould_name="del",url="/role/dellistrole" } },
|
||||
new menu{id=13, menu_name="add",is_show=0,is_top=0,parentId=9,mould=new mould{mould_name="add",url="/role/addrole" } },
|
||||
|
||||
},
|
||||
new menu()
|
||||
{
|
||||
menu_name="路由管理",is_show=1,children=new List<menu>()
|
||||
{
|
||||
new menu()
|
||||
{
|
||||
menu_name="用户信息",router="/userinfo/", is_show=1,children=null
|
||||
|
||||
}
|
||||
}
|
||||
new menu{ id=14,icon="mdi-account-cash", menu_name="角色接口管理",is_show=1,is_top=0,parentId=1},
|
||||
|
||||
}
|
||||
|
||||
new menu{ id=15,icon="mdi-clipboard-check-multiple", menu_name="菜单管理",router="/AdmMenu/",is_show=1,is_top=0,parentId=14},
|
||||
new menu{id=16, menu_name="get",is_show=0,is_top=0,parentId=15,mould=new mould{mould_name="get",url="/menu/getmenu" } },
|
||||
new menu{id=17, menu_name="update",is_show=0,is_top=0,parentId=15,mould=new mould{mould_name="update",url="/menu/updatemenu" } },
|
||||
new menu{id=18, menu_name="del",is_show=0,is_top=0,parentId=15,mould=new mould{mould_name="del",url="/menu/dellistmenu" } },
|
||||
new menu{id=19, menu_name="add",is_show=0,is_top=0,parentId=15,mould=new mould{mould_name="add",url="/menu/addmenu" } },
|
||||
|
||||
|
||||
|
||||
new menu{ id=20,icon="mdi-circle-slice-8", menu_name="接口管理",router="/admMould/",is_show=1,is_top=0,parentId=14},
|
||||
new menu{id=21, menu_name="get",is_show=0,is_top=0,parentId=20,mould=new mould{mould_name="get",url="/Mould/getMould" } },
|
||||
new menu{id=22, menu_name="update",is_show=0,is_top=0,parentId=20,mould=new mould{mould_name="update",url="/Mould/updateMould" } },
|
||||
new menu{id=23, menu_name="del",is_show=0,is_top=0,parentId=20,mould=new mould{mould_name="del",url="/Mould/dellistMould" } },
|
||||
new menu{id=24, menu_name="add",is_show=0,is_top=0,parentId=20,mould=new mould{mould_name="add",url="/Mould/addMould" } },
|
||||
|
||||
new menu{ id=25,icon="mdi-clipboard-account", menu_name="角色菜单分配管理",router="/admRoleMenu/",is_show=1,is_top=0,parentId=14},
|
||||
|
||||
new menu{ id=26,icon="mdi-clipboard-flow-outline", menu_name="路由管理",is_show=1,is_top=0,parentId=1},
|
||||
new menu{ id=27,icon="mdi-account-eye", menu_name="用户信息",router="/userinfo/",is_show=1,is_top=0,parentId=26},
|
||||
|
||||
};
|
||||
|
||||
|
||||
List<role> roles = new List<role>() {
|
||||
new role(){role_name="普通用户" },
|
||||
new role(){role_name="管理员",menus= menus}
|
||||
};
|
||||
|
||||
List<user> users = new List<user>() {
|
||||
new user(){ username="admin",password="123",roles=roles}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
await _Db.Set<user>().AddRangeAsync(users);
|
||||
await _Db.SaveChangesAsync();
|
||||
Console.WriteLine(nameof(DbContext) + ":数据库初始成功!");
|
||||
}
|
||||
await _Db.SaveChangesAsync();
|
||||
|
||||
Console.WriteLine(nameof(DbContext) + ":数据库初始成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10192
Yi.Vue/package-lock.json
generated
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"name": "vuetify-test",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.22.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-chartist": "^2.3.1",
|
||||
"vue-router": "^3.2.0",
|
||||
"vuetify": "^2.4.0",
|
||||
"vuetify-dialog": "^2.0.17",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"sass": "~1.32.0",
|
||||
"sass-loader": "^10.0.0",
|
||||
"vue-cli-plugin-vuetify": "~2.4.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"vuetify-loader": "^1.7.0"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 808 KiB After Width: | Height: | Size: 808 KiB |
|
Before Width: | Height: | Size: 362 KiB After Width: | Height: | Size: 362 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 777 B |
|
Before Width: | Height: | Size: 637 KiB After Width: | Height: | Size: 637 KiB |
|
Before Width: | Height: | Size: 465 KiB After Width: | Height: | Size: 465 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 518 B |
@@ -1,11 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-divider></v-divider>
|
||||
<app-btn dark class="ma-4" @click="dialog = true"> 添加新项 </app-btn>
|
||||
<app-btn dark class="ma-4" @click="showAll"> 展开全部</app-btn>
|
||||
<app-btn dark class="my-4 mr-4" @click="dialog = true"> 添加新项 </app-btn>
|
||||
<app-btn dark class="my-4" color="secondary" @click="deleteItem(null)">
|
||||
删除所选
|
||||
</app-btn>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<v-dialog v-model="dialog" max-width="500px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
@@ -40,7 +44,8 @@
|
||||
</v-dialog>
|
||||
|
||||
<v-treeview
|
||||
open-on-click
|
||||
ref="tree"
|
||||
open-on-click
|
||||
selectable
|
||||
:items="desserts"
|
||||
:selection-type="selectionType"
|
||||
@@ -115,6 +120,10 @@ export default {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
showAll(){
|
||||
this.$refs.tree.updateAll(true);
|
||||
},
|
||||
|
||||
setMould(item) {
|
||||
menuApi.SetMouldByMenu(item.id, this.mouldSelect[0].id).then((resp) => {
|
||||
this.$dialog.notify.info(resp.msg, {
|
||||
@@ -175,6 +184,9 @@ export default {
|
||||
this.editedItem = Object.assign({}, this.defaultItem);
|
||||
this.editedIndex = -1;
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
editItem(item) {
|
||||
this.editedIndex = item.id;
|
||||