6 changed files with 1875 additions and 103 deletions
@ -1,45 +1,42 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
using Microsoft.Extensions.DependencyInjection; |
||||
using Volo.Abp.AutoMapper; |
using Volo.Abp.AutoMapper; |
||||
using Volo.Abp.Identity; |
using Volo.Abp.Modularity; |
||||
using Volo.Abp.Modularity; |
|
||||
using Volo.Abp.ObjectExtending; |
namespace LINGYUN.Abp.Identity |
||||
using Volo.Abp.Threading; |
{ |
||||
|
[DependsOn( |
||||
namespace LINGYUN.Abp.Identity |
typeof(Volo.Abp.Identity.AbpIdentityApplicationModule), |
||||
{ |
typeof(AbpIdentityApplicationContractsModule), |
||||
[DependsOn( |
typeof(AbpIdentityDomainModule))] |
||||
typeof(Volo.Abp.Identity.AbpIdentityApplicationModule), |
public class AbpIdentityApplicationModule : AbpModule |
||||
typeof(AbpIdentityApplicationContractsModule), |
{ |
||||
typeof(AbpIdentityDomainModule))] |
// private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
|
||||
public class AbpIdentityApplicationModule : AbpModule |
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
{ |
{ |
||||
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); |
context.Services.AddAutoMapperObjectMapper<AbpIdentityApplicationModule>(); |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
|
||||
{ |
Configure<AbpAutoMapperOptions>(options => |
||||
context.Services.AddAutoMapperObjectMapper<AbpIdentityApplicationModule>(); |
{ |
||||
|
options.AddProfile<AbpIdentityApplicationModuleAutoMapperProfile>(validate: true); |
||||
Configure<AbpAutoMapperOptions>(options => |
}); |
||||
{ |
} |
||||
options.AddProfile<AbpIdentityApplicationModuleAutoMapperProfile>(validate: true); |
|
||||
}); |
//public override void PostConfigureServices(ServiceConfigurationContext context)
|
||||
} |
//{
|
||||
|
// OneTimeRunner.Run(() =>
|
||||
public override void PostConfigureServices(ServiceConfigurationContext context) |
// {
|
||||
{ |
// ObjectExtensionManager.Instance
|
||||
OneTimeRunner.Run(() => |
// .AddOrUpdateProperty<string>(
|
||||
{ |
// new[]
|
||||
ObjectExtensionManager.Instance |
// {
|
||||
.AddOrUpdateProperty<string>( |
// typeof(IdentityUserDto),
|
||||
new[] |
// typeof(IdentityUserCreateDto),
|
||||
{ |
// typeof(IdentityUserUpdateDto),
|
||||
typeof(IdentityUserDto), |
// typeof(ProfileDto),
|
||||
typeof(IdentityUserCreateDto), |
// typeof(UpdateProfileDto)
|
||||
typeof(IdentityUserUpdateDto), |
// },
|
||||
typeof(ProfileDto), |
// ExtensionIdentityUserConsts.AvatarUrlField);
|
||||
typeof(UpdateProfileDto) |
// });
|
||||
}, |
//}
|
||||
ExtensionIdentityUserConsts.AvatarUrlField); |
} |
||||
}); |
} |
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,14 +0,0 @@ |
|||||
namespace LINGYUN.Abp.Identity |
|
||||
{ |
|
||||
public static class ExtensionIdentityUserConsts |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// 头像字段
|
|
||||
/// </summary>
|
|
||||
public static string AvatarUrlField { get; set; } = "AvatarUrl"; |
|
||||
/// <summary>
|
|
||||
/// 头像字段最大长度
|
|
||||
/// </summary>
|
|
||||
public static int MaxAvatarUrlLength { get; set; } = 128; |
|
||||
} |
|
||||
} |
|
||||
@ -1,39 +1,37 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
using Microsoft.Extensions.DependencyInjection; |
||||
using Volo.Abp.Identity; |
using Volo.Abp.Identity; |
||||
using Volo.Abp.Identity.EntityFrameworkCore; |
using Volo.Abp.Identity.EntityFrameworkCore; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
using Volo.Abp.ObjectExtending; |
|
||||
using Volo.Abp.Threading; |
namespace LINGYUN.Abp.Identity.EntityFrameworkCore |
||||
|
{ |
||||
namespace LINGYUN.Abp.Identity.EntityFrameworkCore |
[DependsOn(typeof(LINGYUN.Abp.Identity.AbpIdentityDomainModule))] |
||||
{ |
[DependsOn(typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))] |
||||
[DependsOn(typeof(LINGYUN.Abp.Identity.AbpIdentityDomainModule))] |
public class AbpIdentityEntityFrameworkCoreModule : AbpModule |
||||
[DependsOn(typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))] |
{ |
||||
public class AbpIdentityEntityFrameworkCoreModule : AbpModule |
// private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
|
||||
{ |
|
||||
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); |
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
context.Services.AddAbpDbContext<IdentityDbContext>(options => |
||||
{ |
{ |
||||
context.Services.AddAbpDbContext<IdentityDbContext>(options => |
options.AddRepository<IdentityRole, EfCoreIdentityRoleRepository>(); |
||||
{ |
options.AddRepository<IdentityUser, EfCoreIdentityUserRepository>(); |
||||
options.AddRepository<IdentityRole, EfCoreIdentityRoleRepository>(); |
}); |
||||
options.AddRepository<IdentityUser, EfCoreIdentityUserRepository>(); |
} |
||||
}); |
|
||||
} |
//public override void PostConfigureServices(ServiceConfigurationContext context)
|
||||
|
//{
|
||||
public override void PostConfigureServices(ServiceConfigurationContext context) |
// OneTimeRunner.Run(() =>
|
||||
{ |
// {
|
||||
OneTimeRunner.Run(() => |
// ObjectExtensionManager.Instance
|
||||
{ |
// .MapEfCoreProperty<IdentityUser, string>(
|
||||
ObjectExtensionManager.Instance |
// ExtensionIdentityUserConsts.AvatarUrlField,
|
||||
.MapEfCoreProperty<IdentityUser, string>( |
// (etb, prop) =>
|
||||
ExtensionIdentityUserConsts.AvatarUrlField, |
// {
|
||||
(etb, prop) => |
// prop.HasMaxLength(ExtensionIdentityUserConsts.MaxAvatarUrlLength);
|
||||
{ |
// });
|
||||
prop.HasMaxLength(ExtensionIdentityUserConsts.MaxAvatarUrlLength); |
// });
|
||||
}); |
//}
|
||||
}); |
} |
||||
} |
} |
||||
} |
|
||||
} |
|
||||
|
|||||
File diff suppressed because it is too large
@ -0,0 +1,25 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace AuthServer.Migrations |
||||
|
{ |
||||
|
public partial class RemoteFieldAvatarUrlWithIdentityUser : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "AvatarUrl", |
||||
|
table: "AbpUsers"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "AvatarUrl", |
||||
|
table: "AbpUsers", |
||||
|
type: "varchar(128)", |
||||
|
maxLength: 128, |
||||
|
nullable: true) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue