29 changed files with 1269 additions and 162 deletions
@ -0,0 +1,13 @@ |
|||||
|
using LINGYUN.Platform.Routes; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Validation; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
|
||||
|
public class UserFavoriteMenuCreateDto : UserFavoriteMenuCreateOrUpdateDto |
||||
|
{ |
||||
|
[Required] |
||||
|
[DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] |
||||
|
|
||||
|
public string Framework { get; set; } |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Validation; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
|
||||
|
public abstract class UserFavoriteMenuCreateOrUpdateDto |
||||
|
{ |
||||
|
[Required] |
||||
|
public Guid MenuId { get; set; } |
||||
|
|
||||
|
[DynamicStringLength(typeof(UserFavoriteMenuConsts), nameof(UserFavoriteMenuConsts.MaxColorLength))] |
||||
|
public string Color { get; set; } |
||||
|
|
||||
|
[DynamicStringLength(typeof(UserFavoriteMenuConsts), nameof(UserFavoriteMenuConsts.MaxAliasNameLength))] |
||||
|
public string AliasName { get; set; } |
||||
|
|
||||
|
[DynamicStringLength(typeof(UserFavoriteMenuConsts), nameof(UserFavoriteMenuConsts.MaxIconLength))] |
||||
|
public string Icon { get; set; } |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
public class UserFavoriteMenuRemoveInput |
||||
|
{ |
||||
|
[Required] |
||||
|
public Guid MenuId { get; set; } |
||||
|
} |
||||
@ -1,11 +0,0 @@ |
|||||
using System; |
|
||||
using System.Collections.Generic; |
|
||||
|
|
||||
namespace LINGYUN.Platform.Menus; |
|
||||
|
|
||||
public class UserFavoriteMenuSetInput |
|
||||
{ |
|
||||
public string Framework { get; set; } |
|
||||
|
|
||||
public List<Guid> MenuIds { get; set; } = new List<Guid>(); |
|
||||
} |
|
||||
@ -0,0 +1,9 @@ |
|||||
|
using Volo.Abp.Domain.Entities; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
|
||||
|
public class UserFavoriteMenuUpdateDto : UserFavoriteMenuCreateOrUpdateDto, IHasConcurrencyStamp |
||||
|
{ |
||||
|
|
||||
|
public string ConcurrencyStamp { get; set; } |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
|
||||
|
public interface IUserFavoriteMenuAppService : IApplicationService |
||||
|
{ |
||||
|
Task<UserFavoriteMenuDto> CreateAsync(Guid userId, UserFavoriteMenuCreateDto input); |
||||
|
|
||||
|
Task<UserFavoriteMenuDto> CreateMyFavoriteMenuAsync(UserFavoriteMenuCreateDto input); |
||||
|
|
||||
|
Task<UserFavoriteMenuDto> UpdateAsync(Guid userId, UserFavoriteMenuUpdateDto input); |
||||
|
|
||||
|
Task<UserFavoriteMenuDto> UpdateMyFavoriteMenuAsync(UserFavoriteMenuUpdateDto input); |
||||
|
|
||||
|
Task DeleteAsync(Guid userId, UserFavoriteMenuRemoveInput input); |
||||
|
|
||||
|
Task DeleteMyFavoriteMenuAsync(UserFavoriteMenuRemoveInput input); |
||||
|
|
||||
|
Task<ListResultDto<UserFavoriteMenuDto>> GetMyFavoriteMenuListAsync(UserFavoriteMenuGetListInput input); |
||||
|
|
||||
|
Task<ListResultDto<UserFavoriteMenuDto>> GetListAsync(Guid userId, UserFavoriteMenuGetListInput input); |
||||
|
} |
||||
@ -0,0 +1,172 @@ |
|||||
|
using LINGYUN.Platform.Permissions; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Users; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
|
||||
|
[Authorize] |
||||
|
public class UserFavoriteMenuAppService : PlatformApplicationServiceBase, IUserFavoriteMenuAppService |
||||
|
{ |
||||
|
protected IStandardMenuConverter StandardMenuConverter => LazyServiceProvider.LazyGetRequiredService<IStandardMenuConverter>(); |
||||
|
protected IMenuRepository MenuRepository { get; } |
||||
|
protected IUserFavoriteMenuRepository UserFavoriteMenuRepository { get; } |
||||
|
|
||||
|
public UserFavoriteMenuAppService( |
||||
|
IMenuRepository menuRepository, |
||||
|
IUserFavoriteMenuRepository userFavoriteMenuRepository) |
||||
|
{ |
||||
|
MenuRepository = menuRepository; |
||||
|
UserFavoriteMenuRepository = userFavoriteMenuRepository; |
||||
|
} |
||||
|
|
||||
|
[Authorize(PlatformPermissions.Menu.ManageUserFavorites)] |
||||
|
public async virtual Task<UserFavoriteMenuDto> CreateAsync(Guid userId, UserFavoriteMenuCreateDto input) |
||||
|
{ |
||||
|
if (!await UserFavoriteMenuRepository.CheckExistsAsync(input.Framework, userId, input.MenuId)) |
||||
|
{ |
||||
|
throw new BusinessException(PlatformErrorCodes.UserDuplicateFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
var menu = await MenuRepository.GetAsync(input.MenuId); |
||||
|
var standardMenu = StandardMenuConverter.Convert(menu); |
||||
|
var userFavoriteMenu = new UserFavoriteMenu( |
||||
|
GuidGenerator.Create(), |
||||
|
input.MenuId, |
||||
|
userId, |
||||
|
input.Framework, |
||||
|
standardMenu.Name, |
||||
|
standardMenu.DisplayName, |
||||
|
standardMenu.Path, |
||||
|
standardMenu.Icon, |
||||
|
input.Color, |
||||
|
input.AliasName, |
||||
|
CurrentTenant.Id); |
||||
|
|
||||
|
userFavoriteMenu = await UserFavoriteMenuRepository.InsertAsync(userFavoriteMenu); |
||||
|
|
||||
|
await CurrentUnitOfWork.SaveChangesAsync(); |
||||
|
|
||||
|
return ObjectMapper.Map<UserFavoriteMenu, UserFavoriteMenuDto>(userFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task<UserFavoriteMenuDto> CreateMyFavoriteMenuAsync(UserFavoriteMenuCreateDto input) |
||||
|
{ |
||||
|
var userId = CurrentUser.GetId(); |
||||
|
if (!await UserFavoriteMenuRepository.CheckExistsAsync(input.Framework, userId, input.MenuId)) |
||||
|
{ |
||||
|
throw new BusinessException(PlatformErrorCodes.UserDuplicateFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
var menu = await MenuRepository.GetAsync(input.MenuId); |
||||
|
var standardMenu = StandardMenuConverter.Convert(menu); |
||||
|
var userFavoriteMenu = new UserFavoriteMenu( |
||||
|
GuidGenerator.Create(), |
||||
|
input.MenuId, |
||||
|
userId, |
||||
|
input.Framework, |
||||
|
standardMenu.Name, |
||||
|
standardMenu.DisplayName, |
||||
|
standardMenu.Path, |
||||
|
standardMenu.Icon, |
||||
|
input.Color, |
||||
|
input.AliasName, |
||||
|
CurrentTenant.Id); |
||||
|
|
||||
|
userFavoriteMenu = await UserFavoriteMenuRepository.InsertAsync(userFavoriteMenu); |
||||
|
|
||||
|
await CurrentUnitOfWork.SaveChangesAsync(); |
||||
|
|
||||
|
return ObjectMapper.Map<UserFavoriteMenu, UserFavoriteMenuDto>(userFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
[Authorize(PlatformPermissions.Menu.ManageUserFavorites)] |
||||
|
public async virtual Task DeleteAsync(Guid userId, UserFavoriteMenuRemoveInput input) |
||||
|
{ |
||||
|
var userFavoriteMenu = await GetUserMenuAsync(userId, input.MenuId); |
||||
|
|
||||
|
await UserFavoriteMenuRepository.DeleteAsync(userFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task DeleteMyFavoriteMenuAsync(UserFavoriteMenuRemoveInput input) |
||||
|
{ |
||||
|
var userFavoriteMenu = await GetUserMenuAsync(CurrentUser.GetId(), input.MenuId); |
||||
|
|
||||
|
await UserFavoriteMenuRepository.DeleteAsync(userFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
[Authorize(PlatformPermissions.Menu.ManageUserFavorites)] |
||||
|
public async virtual Task<ListResultDto<UserFavoriteMenuDto>> GetListAsync(Guid userId, UserFavoriteMenuGetListInput input) |
||||
|
{ |
||||
|
var userFacoriteMenus = await UserFavoriteMenuRepository.GetFavoriteMenusAsync( |
||||
|
userId, input.Framework); |
||||
|
|
||||
|
return new ListResultDto<UserFavoriteMenuDto>( |
||||
|
ObjectMapper.Map<List<UserFavoriteMenu>, List<UserFavoriteMenuDto>>(userFacoriteMenus)); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task<ListResultDto<UserFavoriteMenuDto>> GetMyFavoriteMenuListAsync(UserFavoriteMenuGetListInput input) |
||||
|
{ |
||||
|
var userFacoriteMenus = await UserFavoriteMenuRepository.GetFavoriteMenusAsync( |
||||
|
CurrentUser.GetId(), input.Framework); |
||||
|
|
||||
|
return new ListResultDto<UserFavoriteMenuDto>( |
||||
|
ObjectMapper.Map<List<UserFavoriteMenu>, List<UserFavoriteMenuDto>>(userFacoriteMenus)); |
||||
|
} |
||||
|
|
||||
|
[Authorize(PlatformPermissions.Menu.ManageUserFavorites)] |
||||
|
public async virtual Task<UserFavoriteMenuDto> UpdateAsync(Guid userId, UserFavoriteMenuUpdateDto input) |
||||
|
{ |
||||
|
var userFavoriteMenu = await GetUserMenuAsync(userId, input.MenuId); |
||||
|
|
||||
|
UpdateByInput(userFavoriteMenu, input); |
||||
|
|
||||
|
userFavoriteMenu = await UserFavoriteMenuRepository.UpdateAsync(userFavoriteMenu); |
||||
|
|
||||
|
await CurrentUnitOfWork.SaveChangesAsync(); |
||||
|
|
||||
|
return ObjectMapper.Map<UserFavoriteMenu, UserFavoriteMenuDto>(userFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task<UserFavoriteMenuDto> UpdateMyFavoriteMenuAsync(UserFavoriteMenuUpdateDto input) |
||||
|
{ |
||||
|
var userFavoriteMenu = await GetUserMenuAsync(CurrentUser.GetId(), input.MenuId); |
||||
|
|
||||
|
UpdateByInput(userFavoriteMenu, input); |
||||
|
|
||||
|
userFavoriteMenu = await UserFavoriteMenuRepository.UpdateAsync(userFavoriteMenu); |
||||
|
|
||||
|
await CurrentUnitOfWork.SaveChangesAsync(); |
||||
|
|
||||
|
return ObjectMapper.Map<UserFavoriteMenu, UserFavoriteMenuDto>(userFavoriteMenu); |
||||
|
} |
||||
|
|
||||
|
protected async virtual Task<UserFavoriteMenu> GetUserMenuAsync(Guid userId, Guid menuId) |
||||
|
{ |
||||
|
var userFavoriteMenu = await UserFavoriteMenuRepository.FindByUserMenuAsync(userId, menuId); |
||||
|
|
||||
|
return userFavoriteMenu ?? throw new BusinessException(PlatformErrorCodes.UserFavoriteMenuNotFound); |
||||
|
} |
||||
|
|
||||
|
protected virtual void UpdateByInput(UserFavoriteMenu userFavoriteMenu, UserFavoriteMenuCreateOrUpdateDto input) |
||||
|
{ |
||||
|
if (!string.Equals(userFavoriteMenu.Color, input.Color, StringComparison.CurrentCultureIgnoreCase)) |
||||
|
{ |
||||
|
userFavoriteMenu.Color = Check.Length(input.Color, nameof(UserFavoriteMenuCreateOrUpdateDto.Color), UserFavoriteMenuConsts.MaxColorLength); |
||||
|
} |
||||
|
|
||||
|
if (!string.Equals(userFavoriteMenu.AliasName, input.AliasName, StringComparison.CurrentCultureIgnoreCase)) |
||||
|
{ |
||||
|
userFavoriteMenu.AliasName = Check.Length(input.AliasName, nameof(UserFavoriteMenuCreateOrUpdateDto.AliasName), UserFavoriteMenuConsts.MaxAliasNameLength); |
||||
|
} |
||||
|
|
||||
|
if (!string.Equals(userFavoriteMenu.Icon, input.Icon, StringComparison.CurrentCultureIgnoreCase)) |
||||
|
{ |
||||
|
userFavoriteMenu.Icon = Check.Length(input.Icon, nameof(UserFavoriteMenuCreateOrUpdateDto.Icon), UserFavoriteMenuConsts.MaxIconLength); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
using LINGYUN.Platform.Routes; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
public class UserFavoriteMenuConsts |
||||
|
{ |
||||
|
public static int MaxIconLength { get; set; } = 512; |
||||
|
public static int MaxColorLength { get; set; } = 30; |
||||
|
public static int MaxAliasNameLength { get; set; } = RouteConsts.MaxDisplayNameLength; |
||||
|
} |
||||
@ -1,5 +0,0 @@ |
|||||
namespace LINGYUN.Platform.Routes; |
|
||||
public class UserFavoriteMenuConsts |
|
||||
{ |
|
||||
public static int MaxIconLength { get; set; } = 512; |
|
||||
} |
|
||||
@ -0,0 +1,78 @@ |
|||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace LINGYUN.Platform.Menus; |
||||
|
|
||||
|
[Authorize] |
||||
|
[RemoteService(Name = PlatformRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area("platform")] |
||||
|
[Route("api/platform/menus/favorites")] |
||||
|
public class UserFavoriteMenuController : PlatformControllerBase, IUserFavoriteMenuAppService |
||||
|
{ |
||||
|
protected IUserFavoriteMenuAppService Service { get; } |
||||
|
|
||||
|
public UserFavoriteMenuController(IUserFavoriteMenuAppService service) |
||||
|
{ |
||||
|
Service = service; |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
[Route("{userId}")] |
||||
|
public virtual Task<UserFavoriteMenuDto> CreateAsync(Guid userId, UserFavoriteMenuCreateDto input) |
||||
|
{ |
||||
|
return Service.CreateAsync(userId, input); |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
[Route("my-favorite-menu")] |
||||
|
public virtual Task<UserFavoriteMenuDto> CreateMyFavoriteMenuAsync(UserFavoriteMenuCreateDto input) |
||||
|
{ |
||||
|
return Service.CreateMyFavoriteMenuAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpDelete] |
||||
|
[Route("{userId}/{MenuId}")] |
||||
|
public virtual Task DeleteAsync(Guid userId, UserFavoriteMenuRemoveInput input) |
||||
|
{ |
||||
|
return Service.DeleteAsync(userId, input); |
||||
|
} |
||||
|
|
||||
|
[HttpDelete] |
||||
|
[Route("my-favorite-menu/{MenuId}")] |
||||
|
public virtual Task DeleteMyFavoriteMenuAsync(UserFavoriteMenuRemoveInput input) |
||||
|
{ |
||||
|
return Service.DeleteMyFavoriteMenuAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("{userId}")] |
||||
|
public virtual Task<ListResultDto<UserFavoriteMenuDto>> GetListAsync(Guid userId, UserFavoriteMenuGetListInput input) |
||||
|
{ |
||||
|
return Service.GetListAsync(userId, input); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("my-favorite-menus")] |
||||
|
public virtual Task<ListResultDto<UserFavoriteMenuDto>> GetMyFavoriteMenuListAsync(UserFavoriteMenuGetListInput input) |
||||
|
{ |
||||
|
return Service.GetMyFavoriteMenuListAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpPut] |
||||
|
[Route("{userId}")] |
||||
|
public virtual Task<UserFavoriteMenuDto> UpdateAsync(Guid userId, UserFavoriteMenuUpdateDto input) |
||||
|
{ |
||||
|
return Service.UpdateAsync(userId, input); |
||||
|
} |
||||
|
|
||||
|
[HttpPut] |
||||
|
[Route("my-favorite-menu")] |
||||
|
public virtual Task<UserFavoriteMenuDto> UpdateMyFavoriteMenuAsync(UserFavoriteMenuUpdateDto input) |
||||
|
{ |
||||
|
return Service.UpdateMyFavoriteMenuAsync(input); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,751 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using LY.MicroService.PlatformManagement.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace LY.MicroService.PlatformManagement.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(PlatformManagementMigrationsDbContext))] |
||||
|
[Migration("20220926012110_Add-Color-And-AliasName-With-UserFavoriteMenu")] |
||||
|
partial class AddColorAndAliasNameWithUserFavoriteMenu |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
||||
|
.HasAnnotation("ProductVersion", "6.0.9") |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
||||
|
|
||||
|
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)") |
||||
|
.HasColumnName("Code"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40)") |
||||
|
.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)") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.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)") |
||||
|
.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", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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)") |
||||
|
.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)") |
||||
|
.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)") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.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)") |
||||
|
.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", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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)") |
||||
|
.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"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("Framework") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64)") |
||||
|
.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)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("Path") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Path"); |
||||
|
|
||||
|
b.Property<string>("Redirect") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Redirect"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("AppPlatformLayouts", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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)") |
||||
|
.HasColumnName("Code"); |
||||
|
|
||||
|
b.Property<string>("Component") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Component"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("varchar(40)") |
||||
|
.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"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("Framework") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64)") |
||||
|
.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)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<Guid?>("ParentId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Path") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Path"); |
||||
|
|
||||
|
b.Property<string>("Redirect") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Redirect"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("AppPlatformMenus", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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)") |
||||
|
.HasColumnName("RoleName"); |
||||
|
|
||||
|
b.Property<bool>("Startup") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("RoleName", "MenuId"); |
||||
|
|
||||
|
b.ToTable("AppPlatformRoleMenus", (string)null); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("LINGYUN.Platform.Menus.UserFavoriteMenu", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("AliasName") |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("AliasName"); |
||||
|
|
||||
|
b.Property<string>("Color") |
||||
|
.HasMaxLength(30) |
||||
|
.HasColumnType("varchar(30)") |
||||
|
.HasColumnName("Color"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime(6)") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("char(36)") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("DisplayName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("varchar(128)") |
||||
|
.HasColumnName("DisplayName"); |
||||
|
|
||||
|
b.Property<string>("Framework") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64)") |
||||
|
.HasColumnName("Framework"); |
||||
|
|
||||
|
b.Property<string>("Icon") |
||||
|
.HasMaxLength(512) |
||||
|
.HasColumnType("varchar(512)") |
||||
|
.HasColumnName("Icon"); |
||||
|
|
||||
|
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>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64) |
||||
|
.HasColumnType("varchar(64)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("Path") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Path"); |
||||
|
|
||||
|
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("AppPlatformUserFavoriteMenus", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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<bool>("Startup") |
||||
|
.HasColumnType("tinyint(1)"); |
||||
|
|
||||
|
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", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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)") |
||||
|
.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("varchar(2048)") |
||||
|
.HasColumnName("Description"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("longtext") |
||||
|
.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)") |
||||
|
.HasColumnName("Title"); |
||||
|
|
||||
|
b.Property<string>("Version") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(20) |
||||
|
.HasColumnType("varchar(20)") |
||||
|
.HasColumnName("Version"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Version"); |
||||
|
|
||||
|
b.ToTable("AppPlatformVersion", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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)") |
||||
|
.HasColumnName("Name"); |
||||
|
|
||||
|
b.Property<string>("Path") |
||||
|
.HasMaxLength(255) |
||||
|
.HasColumnType("varchar(255)") |
||||
|
.HasColumnName("Path"); |
||||
|
|
||||
|
b.Property<string>("SHA256") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(65) |
||||
|
.HasColumnType("varchar(65)") |
||||
|
.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)") |
||||
|
.HasColumnName("Version"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("AppVersionId"); |
||||
|
|
||||
|
b.HasIndex("Path", "Name", "Version") |
||||
|
.IsUnique(); |
||||
|
|
||||
|
b.ToTable("AppPlatformVersionFile", (string)null); |
||||
|
}); |
||||
|
|
||||
|
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,71 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace LY.MicroService.PlatformManagement.Migrations |
||||
|
{ |
||||
|
public partial class AddColorAndAliasNameWithUserFavoriteMenu : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.UpdateData( |
||||
|
table: "AppPlatformUserFavoriteMenus", |
||||
|
keyColumn: "Path", |
||||
|
keyValue: null, |
||||
|
column: "Path", |
||||
|
value: ""); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Path", |
||||
|
table: "AppPlatformUserFavoriteMenus", |
||||
|
type: "varchar(255)", |
||||
|
maxLength: 255, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(255)", |
||||
|
oldMaxLength: 255, |
||||
|
oldNullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "AliasName", |
||||
|
table: "AppPlatformUserFavoriteMenus", |
||||
|
type: "varchar(128)", |
||||
|
maxLength: 128, |
||||
|
nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Color", |
||||
|
table: "AppPlatformUserFavoriteMenus", |
||||
|
type: "varchar(30)", |
||||
|
maxLength: 30, |
||||
|
nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "AliasName", |
||||
|
table: "AppPlatformUserFavoriteMenus"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Color", |
||||
|
table: "AppPlatformUserFavoriteMenus"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "Path", |
||||
|
table: "AppPlatformUserFavoriteMenus", |
||||
|
type: "varchar(255)", |
||||
|
maxLength: 255, |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(255)", |
||||
|
oldMaxLength: 255) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue