Browse Source

Merge pull request #386 from colinin/4.4.2

feat(identity): remove file AvatarUrl with IdentityUser
pull/396/head
yx lin 4 years ago
committed by GitHub
parent
commit
494afd1b48
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 39
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModule.cs
  2. 14
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/ExtensionIdentityUserConsts.cs
  3. 30
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs
  4. 1770
      aspnet-core/services/account/AuthServer.Host/Migrations/20211118030445_Remote-Field-AvatarUrl-With-IdentityUser.Designer.cs
  5. 25
      aspnet-core/services/account/AuthServer.Host/Migrations/20211118030445_Remote-Field-AvatarUrl-With-IdentityUser.cs
  6. 6
      aspnet-core/services/account/AuthServer.Host/Migrations/AuthServerHostMigrationsDbContextModelSnapshot.cs

39
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModule.cs

@ -1,9 +1,6 @@
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;
using Volo.Abp.Threading;
namespace LINGYUN.Abp.Identity namespace LINGYUN.Abp.Identity
{ {
@ -13,7 +10,7 @@ namespace LINGYUN.Abp.Identity
typeof(AbpIdentityDomainModule))] typeof(AbpIdentityDomainModule))]
public class AbpIdentityApplicationModule : AbpModule public class AbpIdentityApplicationModule : 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.AddAutoMapperObjectMapper<AbpIdentityApplicationModule>(); context.Services.AddAutoMapperObjectMapper<AbpIdentityApplicationModule>();
@ -24,22 +21,22 @@ namespace LINGYUN.Abp.Identity
}); });
} }
public override void PostConfigureServices(ServiceConfigurationContext context) //public override void PostConfigureServices(ServiceConfigurationContext context)
{ //{
OneTimeRunner.Run(() => // OneTimeRunner.Run(() =>
{ // {
ObjectExtensionManager.Instance // ObjectExtensionManager.Instance
.AddOrUpdateProperty<string>( // .AddOrUpdateProperty<string>(
new[] // new[]
{ // {
typeof(IdentityUserDto), // typeof(IdentityUserDto),
typeof(IdentityUserCreateDto), // typeof(IdentityUserCreateDto),
typeof(IdentityUserUpdateDto), // typeof(IdentityUserUpdateDto),
typeof(ProfileDto), // typeof(ProfileDto),
typeof(UpdateProfileDto) // typeof(UpdateProfileDto)
}, // },
ExtensionIdentityUserConsts.AvatarUrlField); // ExtensionIdentityUserConsts.AvatarUrlField);
}); // });
} //}
} }
} }

14
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/ExtensionIdentityUserConsts.cs

@ -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;
}
}

30
aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs

@ -2,8 +2,6 @@
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
{ {
@ -11,7 +9,7 @@ namespace LINGYUN.Abp.Identity.EntityFrameworkCore
[DependsOn(typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))] [DependsOn(typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))]
public class AbpIdentityEntityFrameworkCoreModule : AbpModule 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)
{ {
@ -22,18 +20,18 @@ namespace LINGYUN.Abp.Identity.EntityFrameworkCore
}); });
} }
public override void PostConfigureServices(ServiceConfigurationContext context) //public override void PostConfigureServices(ServiceConfigurationContext context)
{ //{
OneTimeRunner.Run(() => // OneTimeRunner.Run(() =>
{ // {
ObjectExtensionManager.Instance // ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>( // .MapEfCoreProperty<IdentityUser, string>(
ExtensionIdentityUserConsts.AvatarUrlField, // ExtensionIdentityUserConsts.AvatarUrlField,
(etb, prop) => // (etb, prop) =>
{ // {
prop.HasMaxLength(ExtensionIdentityUserConsts.MaxAvatarUrlLength); // prop.HasMaxLength(ExtensionIdentityUserConsts.MaxAvatarUrlLength);
}); // });
}); // });
} //}
} }
} }

1770
aspnet-core/services/account/AuthServer.Host/Migrations/20211118030445_Remote-Field-AvatarUrl-With-IdentityUser.Designer.cs

File diff suppressed because it is too large

25
aspnet-core/services/account/AuthServer.Host/Migrations/20211118030445_Remote-Field-AvatarUrl-With-IdentityUser.cs

@ -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");
}
}
}

6
aspnet-core/services/account/AuthServer.Host/Migrations/AuthServerHostMigrationsDbContextModelSnapshot.cs

@ -17,7 +17,7 @@ namespace AuthServer.Migrations
modelBuilder modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("Relational:MaxIdentifierLength", 64) .HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.11"); .HasAnnotation("ProductVersion", "5.0.12");
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{ {
@ -256,10 +256,6 @@ namespace AuthServer.Migrations
.HasDefaultValue(0) .HasDefaultValue(0)
.HasColumnName("AccessFailedCount"); .HasColumnName("AccessFailedCount");
b.Property<string>("AvatarUrl")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasMaxLength(40) .HasMaxLength(40)

Loading…
Cancel
Save