54 changed files with 9921 additions and 9235 deletions
@ -1,9 +1,16 @@ |
|||||
using System; |
using LINGYUN.Platform.Routes; |
||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Validation; |
||||
|
|
||||
namespace LINGYUN.Platform.Layouts |
namespace LINGYUN.Platform.Layouts |
||||
{ |
{ |
||||
public class LayoutCreateDto : LayoutCreateOrUpdateDto |
public class LayoutCreateDto : LayoutCreateOrUpdateDto |
||||
{ |
{ |
||||
public Guid DataId { get; set; } |
public Guid DataId { get; set; } |
||||
|
|
||||
|
[Required] |
||||
|
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] |
||||
|
public string Framework { get; set; } |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,7 +1,11 @@ |
|||||
namespace LINGYUN.Platform.Menus |
using LINGYUN.Platform.Routes; |
||||
|
using Volo.Abp.Validation; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus |
||||
{ |
{ |
||||
public class GetMenuInput |
public class GetMenuInput |
||||
{ |
{ |
||||
public PlatformType PlatformType { get; set; } |
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] |
||||
|
public string Framework { get; set; } |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,7 @@ |
|||||
|
namespace LINGYUN.Platform.Routes |
||||
|
{ |
||||
|
public static class LayoutConsts |
||||
|
{ |
||||
|
public static int MaxFrameworkLength { get; set; } = 64; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,291 @@ |
|||||
|
using LINGYUN.Platform.Datas; |
||||
|
using LINGYUN.Platform.Layouts; |
||||
|
using LINGYUN.Platform.Menus; |
||||
|
using LINGYUN.Platform.Routes; |
||||
|
using LINGYUN.Platform.Utils; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Data; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.Guids; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
|
||||
|
namespace LINGYUN.Platform.DataSeeder |
||||
|
{ |
||||
|
public class VbenAdminDataSeedContributor : IDataSeedContributor, ITransientDependency |
||||
|
{ |
||||
|
protected ICurrentTenant CurrentTenant { get; } |
||||
|
protected IGuidGenerator GuidGenerator { get; } |
||||
|
protected IRouteDataSeeder RouteDataSeeder { get; } |
||||
|
protected IDataDictionaryDataSeeder DataDictionaryDataSeeder { get; } |
||||
|
protected IMenuRepository MenuRepository { get; } |
||||
|
protected ILayoutRepository LayoutRepository { get; } |
||||
|
|
||||
|
public VbenAdminDataSeedContributor( |
||||
|
ICurrentTenant currentTenant, |
||||
|
IRouteDataSeeder routeDataSeeder, |
||||
|
IMenuRepository menuRepository, |
||||
|
ILayoutRepository layoutRepository, |
||||
|
IGuidGenerator guidGenerator, |
||||
|
IDataDictionaryDataSeeder dataDictionaryDataSeeder) |
||||
|
{ |
||||
|
CurrentTenant = currentTenant; |
||||
|
GuidGenerator = guidGenerator; |
||||
|
RouteDataSeeder = routeDataSeeder; |
||||
|
MenuRepository = menuRepository; |
||||
|
LayoutRepository = layoutRepository; |
||||
|
DataDictionaryDataSeeder = dataDictionaryDataSeeder; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task SeedAsync(DataSeedContext context) |
||||
|
{ |
||||
|
using (CurrentTenant.Change(context.TenantId)) |
||||
|
{ |
||||
|
var uiDataItem = await SeedUIFrameworkDataAsync(context.TenantId); |
||||
|
|
||||
|
var layoutData = await SeedLayoutDataAsync(context.TenantId); |
||||
|
|
||||
|
var layout = await SeedDefaultLayoutAsync(layoutData, uiDataItem); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private async Task<DataItem> SeedUIFrameworkDataAsync(Guid? tenantId) |
||||
|
{ |
||||
|
var data = await DataDictionaryDataSeeder |
||||
|
.SeedAsync( |
||||
|
"UI Framewark", |
||||
|
CodeNumberGenerator.CreateCode(2), |
||||
|
"UI框架", |
||||
|
"UI Framewark", |
||||
|
null, |
||||
|
tenantId, |
||||
|
true); |
||||
|
|
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"Vue Vben Admin", |
||||
|
"Vue Vben Admin", |
||||
|
"Vue Vben Admin", |
||||
|
Datas.ValueType.String, |
||||
|
"Vue Vben Admin", |
||||
|
isStatic: true); |
||||
|
|
||||
|
return data.FindItem("Vue Vben Admin"); |
||||
|
} |
||||
|
|
||||
|
private async Task<Layout> SeedDefaultLayoutAsync(Data data, DataItem uiDataItem) |
||||
|
{ |
||||
|
var layout = await RouteDataSeeder.SeedLayoutAsync( |
||||
|
"Vben Admin Layout", |
||||
|
"LAYOUT", // 路由层面已经处理好了,只需要传递LAYOUT可自动引用布局
|
||||
|
"Vben Admin Layout", |
||||
|
data.Id, |
||||
|
uiDataItem.Name, |
||||
|
"", |
||||
|
"Vben Admin Layout", |
||||
|
data.TenantId |
||||
|
); |
||||
|
|
||||
|
return layout; |
||||
|
} |
||||
|
|
||||
|
private async Task<Data> SeedLayoutDataAsync(Guid? tenantId) |
||||
|
{ |
||||
|
var data = await DataDictionaryDataSeeder |
||||
|
.SeedAsync( |
||||
|
"Vben Admin Layout", |
||||
|
CodeNumberGenerator.CreateCode(3), |
||||
|
"Vben Admin布局约束", |
||||
|
"Vben Admin Layout Meta Dictionary", |
||||
|
null, |
||||
|
tenantId, |
||||
|
true); |
||||
|
|
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"hideMenu", |
||||
|
"不在菜单显示", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"当前路由不在菜单显示", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"icon", |
||||
|
"图标", |
||||
|
"", |
||||
|
Datas.ValueType.String, |
||||
|
"图标,也是菜单图标", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"currentActiveMenu", |
||||
|
"当前激活的菜单", |
||||
|
"", |
||||
|
Datas.ValueType.String, |
||||
|
"用于配置详情页时左侧激活的菜单路径", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"ignoreKeepAlive", |
||||
|
"KeepAlive缓存", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"是否忽略KeepAlive缓存", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"frameSrc", |
||||
|
"IFrame地址", |
||||
|
"", |
||||
|
Datas.ValueType.String, |
||||
|
"内嵌iframe的地址", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"transitionName", |
||||
|
"路由切换动画", |
||||
|
"", |
||||
|
Datas.ValueType.String, |
||||
|
"指定该路由切换的动画名", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"roles", |
||||
|
"可以访问的角色", |
||||
|
"", |
||||
|
Datas.ValueType.Array, |
||||
|
"可以访问的角色,只在权限模式为Role的时候有效", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"title", |
||||
|
"路由标题", |
||||
|
"", |
||||
|
Datas.ValueType.String, |
||||
|
"路由title 一般必填", |
||||
|
false, |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"carryParam", |
||||
|
"在tab页显示", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"如果该路由会携带参数,且需要在tab页上面显示。则需要设置为true", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"hideBreadcrumb", |
||||
|
"隐藏面包屑", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"隐藏该路由在面包屑上面的显示", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"ignoreAuth", |
||||
|
"忽略权限", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"是否忽略权限,只在权限模式为Role的时候有效", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"hideChildrenInMenu", |
||||
|
"隐藏所有子菜单", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"隐藏所有子菜单", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"hideTab", |
||||
|
"不在标签页显示", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"当前路由不在标签页显示", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"affix", |
||||
|
"固定标签页", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"是否固定标签页", |
||||
|
isStatic: true); |
||||
|
data.AddItem( |
||||
|
GuidGenerator, |
||||
|
"frameFormat", |
||||
|
"格式化IFrame", |
||||
|
"false", |
||||
|
Datas.ValueType.Boolean, |
||||
|
"扩展的格式化frame,{token}: 在打开的iframe页面传递token请求头"); |
||||
|
|
||||
|
return data; |
||||
|
} |
||||
|
|
||||
|
private async Task<Menu> SeedMenuAsync( |
||||
|
Layout layout, |
||||
|
Data data, |
||||
|
string name, |
||||
|
string path, |
||||
|
string code, |
||||
|
string component, |
||||
|
string displayName, |
||||
|
string redirect = "", |
||||
|
string description = "", |
||||
|
Guid? parentId = null, |
||||
|
Guid? tenantId = null, |
||||
|
Dictionary<string, object> meta = null, |
||||
|
string[] roles = null, |
||||
|
Guid[] users = null, |
||||
|
bool isPublic = false |
||||
|
) |
||||
|
{ |
||||
|
var menu = await RouteDataSeeder.SeedMenuAsync( |
||||
|
layout, |
||||
|
name, |
||||
|
path, |
||||
|
code, |
||||
|
component, |
||||
|
displayName, |
||||
|
redirect, |
||||
|
description, |
||||
|
parentId, |
||||
|
tenantId, |
||||
|
isPublic |
||||
|
); |
||||
|
foreach (var item in data.Items) |
||||
|
{ |
||||
|
menu.SetProperty(item.Name, item.DefaultValue); |
||||
|
} |
||||
|
if (meta != null) |
||||
|
{ |
||||
|
foreach (var item in meta) |
||||
|
{ |
||||
|
menu.SetProperty(item.Key, item.Value); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (roles != null) |
||||
|
{ |
||||
|
foreach (var role in roles) |
||||
|
{ |
||||
|
await RouteDataSeeder.SeedRoleMenuAsync(role, menu, tenantId); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (users != null) |
||||
|
{ |
||||
|
foreach (var user in users) |
||||
|
{ |
||||
|
await RouteDataSeeder.SeedUserMenuAsync(user, menu, tenantId); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return menu; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,665 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using LINGYUN.Platform.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(PlatformHttpApiHostMigrationsDbContext))] |
||||
|
[Migration("20210621020117_Rename-Route-Field-PlantType-To-Framework")] |
||||
|
partial class RenameRouteFieldPlantTypeToFramework |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64) |
||||
|
.HasAnnotation("ProductVersion", "5.0.7"); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Code") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(1024) |
||||
|
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Code"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1024) |
||||
|
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("tinyint(1)") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<bool>("IsStatic") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(30) |
||||
|
.HasColumnType("varchar(30) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<Guid?>("ParentId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name"); |
||||
|
|
||||
|
b.ToTable("AppPlatformDatas"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<bool>("AllowBeNull") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("tinyint(1)") |
||||
|
.HasDefaultValue(true); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid>("DataId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("DefaultValue") |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("DefaultValue"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(1024) |
||||
|
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("tinyint(1)") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<bool>("IsStatic") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(30) |
||||
|
.HasColumnType("varchar(30) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<int>("ValueType") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("DataId"); |
||||
|
|
||||
|
b.HasIndex("Name"); |
||||
|
|
||||
|
b.ToTable("AppPlatformDataItems"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid>("DataId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("Framework") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Framework"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("tinyint(1)") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("Path") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Path"); |
||||
|
|
||||
|
b.Property<string>("Redirect") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Redirect"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("AppPlatformLayouts"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Code") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(23) |
||||
|
.HasColumnType("varchar(23) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Code"); |
||||
|
|
||||
|
b.Property<string>("Component") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Component"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("Framework") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Framework"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("tinyint(1)") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<bool>("IsPublic") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<Guid>("LayoutId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<Guid?>("ParentId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Path") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Path"); |
||||
|
|
||||
|
b.Property<string>("Redirect") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Redirect"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("AppPlatformMenus"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<Guid>("MenuId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("RoleName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256) |
||||
|
.HasColumnType("varchar(256) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("RoleName"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("RoleName", "MenuId"); |
||||
|
|
||||
|
b.ToTable("AppPlatformRoleMenus"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<Guid>("MenuId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<Guid>("UserId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("UserId", "MenuId"); |
||||
|
|
||||
|
b.ToTable("AppPlatformUserMenus"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasMaxLength(2048) |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("tinyint(1)") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<int>("Level") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("PlatformType") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<string>("Title") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("varchar(50) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Title"); |
||||
|
|
||||
|
b.Property<string>("Version") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(20) |
||||
|
.HasColumnType("varchar(20) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Version"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Version"); |
||||
|
|
||||
|
b.ToTable("AppPlatformVersion"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b => |
||||
|
{ |
||||
|
b.Property<int>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid>("AppVersionId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<int>("DownloadCount") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<int>("FileType") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("Path") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Path"); |
||||
|
|
||||
|
b.Property<string>("SHA256") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(65) |
||||
|
.HasColumnType("varchar(65) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("SHA256"); |
||||
|
|
||||
|
b.Property<long>("Size") |
||||
|
.HasColumnType("bigint"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<string>("Version") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(20) |
||||
|
.HasColumnType("varchar(20) CHARACTER SET utf8mb4") |
||||
|
.HasColumnName("Version"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("AppVersionId"); |
||||
|
|
||||
|
b.HasIndex("Path", "Name", "Version") |
||||
|
.IsUnique(); |
||||
|
|
||||
|
b.ToTable("AppPlatformVersionFile"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => |
||||
|
{ |
||||
|
b.HasOne("LINGYUN.Platform.Datas.Data", null) |
||||
|
.WithMany("Items") |
||||
|
.HasForeignKey("DataId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Versions.VersionFile", b => |
||||
|
{ |
||||
|
b.HasOne("LINGYUN.Platform.Versions.AppVersion", "AppVersion") |
||||
|
.WithMany("Files") |
||||
|
.HasForeignKey("AppVersionId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
|
||||
|
b.Navigation("AppVersion"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => |
||||
|
{ |
||||
|
b.Navigation("Items"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Versions.AppVersion", b => |
||||
|
{ |
||||
|
b.Navigation("Files"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,81 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Migrations |
||||
|
{ |
||||
|
public partial class RenameRouteFieldPlantTypeToFramework : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "PlatformType", |
||||
|
table: "AppPlatformMenus"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "PlatformType", |
||||
|
table: "AppPlatformLayouts"); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Framework", |
||||
|
table: "AppPlatformMenus", |
||||
|
type: "varchar(64) CHARACTER SET utf8mb4", |
||||
|
maxLength: 64, |
||||
|
nullable: false, |
||||
|
defaultValue: ""); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Framework", |
||||
|
table: "AppPlatformLayouts", |
||||
|
type: "varchar(64) CHARACTER SET utf8mb4", |
||||
|
maxLength: 64, |
||||
|
nullable: false, |
||||
|
defaultValue: ""); |
||||
|
|
||||
|
migrationBuilder.AddColumn<bool>( |
||||
|
name: "IsStatic", |
||||
|
table: "AppPlatformDatas", |
||||
|
type: "tinyint(1)", |
||||
|
nullable: false, |
||||
|
defaultValue: false); |
||||
|
|
||||
|
migrationBuilder.AddColumn<bool>( |
||||
|
name: "IsStatic", |
||||
|
table: "AppPlatformDataItems", |
||||
|
type: "tinyint(1)", |
||||
|
nullable: false, |
||||
|
defaultValue: false); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Framework", |
||||
|
table: "AppPlatformMenus"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Framework", |
||||
|
table: "AppPlatformLayouts"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "IsStatic", |
||||
|
table: "AppPlatformDatas"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "IsStatic", |
||||
|
table: "AppPlatformDataItems"); |
||||
|
|
||||
|
migrationBuilder.AddColumn<int>( |
||||
|
name: "PlatformType", |
||||
|
table: "AppPlatformMenus", |
||||
|
type: "int", |
||||
|
nullable: false, |
||||
|
defaultValue: 0); |
||||
|
|
||||
|
migrationBuilder.AddColumn<int>( |
||||
|
name: "PlatformType", |
||||
|
table: "AppPlatformLayouts", |
||||
|
type: "int", |
||||
|
nullable: false, |
||||
|
defaultValue: 0); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue