committed by
GitHub
7 changed files with 151 additions and 104 deletions
@ -1,17 +1,6 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public class IdentityUserClaimCreateDto |
|||
{ |
|||
[Required] |
|||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] |
|||
public string ClaimType { get; set; } |
|||
|
|||
[Required] |
|||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
|||
public string ClaimValue { get; set; } |
|||
} |
|||
} |
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public class IdentityUserClaimCreateDto: IdentityUserClaimCreateOrUpdateDto |
|||
{ |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,16 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public abstract class IdentityUserClaimCreateOrUpdateDto |
|||
{ |
|||
[Required] |
|||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] |
|||
public string ClaimType { get; set; } |
|||
|
|||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
|||
public string ClaimValue { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public class IdentityUserClaimSetDto : IdentityUserClaimCreateDto |
|||
{ |
|||
} |
|||
} |
|||
@ -1,13 +1,11 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public class IdentityUserClaimUpdateDto : IdentityUserClaimCreateDto |
|||
{ |
|||
[Required] |
|||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
|||
public string NewClaimValue { get; set; } |
|||
} |
|||
} |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Validation; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public class IdentityUserClaimUpdateDto : IdentityUserClaimCreateOrUpdateDto |
|||
{ |
|||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
|||
public string NewClaimValue { get; set; } |
|||
} |
|||
} |
|||
|
|||
@ -1,30 +1,36 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public interface IMyProfileAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 改变二次认证
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input); |
|||
/// <summary>
|
|||
/// 发送改变手机号验证码
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input); |
|||
/// <summary>
|
|||
/// 改变手机绑定
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
/// <remarks>
|
|||
/// 需二次认证,主要是为了无法用到重定向页面修改相关信息的地方(点名微信小程序)
|
|||
/// </remarks>
|
|||
Task ChangePhoneNumberAsync(ChangePhoneNumberDto input); |
|||
} |
|||
} |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
public interface IMyProfileAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 设置声明
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task SetClaimAsync(IdentityUserClaimSetDto input); |
|||
/// <summary>
|
|||
/// 改变二次认证
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input); |
|||
/// <summary>
|
|||
/// 发送改变手机号验证码
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input); |
|||
/// <summary>
|
|||
/// 改变手机绑定
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
/// <remarks>
|
|||
/// 需二次认证,主要是为了无法用到重定向页面修改相关信息的地方(点名微信小程序)
|
|||
/// </remarks>
|
|||
Task ChangePhoneNumberAsync(ChangePhoneNumberDto input); |
|||
} |
|||
} |
|||
|
|||
@ -1,44 +1,52 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.Identity; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] |
|||
[Area("identity")] |
|||
[ControllerName("Profile")] |
|||
[Route("/api/identity/my-profile")] |
|||
public class MyProfileController : AbpController, IMyProfileAppService |
|||
{ |
|||
protected IMyProfileAppService MyProfileAppService { get; } |
|||
|
|||
public MyProfileController( |
|||
IMyProfileAppService myProfileAppService) |
|||
{ |
|||
MyProfileAppService = myProfileAppService; |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("change-two-factor")] |
|||
public virtual async Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input) |
|||
{ |
|||
await MyProfileAppService.ChangeTwoFactorEnabledAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("send-phone-number-change-code")] |
|||
public virtual async Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input) |
|||
{ |
|||
await MyProfileAppService.SendChangePhoneNumberCodeAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("change-phone-number")] |
|||
public virtual async Task ChangePhoneNumberAsync(ChangePhoneNumberDto input) |
|||
{ |
|||
await MyProfileAppService.ChangePhoneNumberAsync(input); |
|||
} |
|||
} |
|||
} |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.Identity; |
|||
|
|||
namespace LINGYUN.Abp.Identity |
|||
{ |
|||
[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] |
|||
[Area("identity")] |
|||
[ControllerName("Profile")] |
|||
[Route("/api/identity/my-profile")] |
|||
public class MyProfileController : AbpController, IMyProfileAppService |
|||
{ |
|||
protected IMyProfileAppService MyProfileAppService { get; } |
|||
|
|||
public MyProfileController( |
|||
IMyProfileAppService myProfileAppService) |
|||
{ |
|||
MyProfileAppService = myProfileAppService; |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("/claims")] |
|||
public virtual async Task SetClaimAsync(IdentityUserClaimSetDto input) |
|||
{ |
|||
await MyProfileAppService.SetClaimAsync(input); |
|||
} |
|||
|
|||
|
|||
[HttpPut] |
|||
[Route("change-two-factor")] |
|||
public virtual async Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input) |
|||
{ |
|||
await MyProfileAppService.ChangeTwoFactorEnabledAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("send-phone-number-change-code")] |
|||
public virtual async Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input) |
|||
{ |
|||
await MyProfileAppService.SendChangePhoneNumberCodeAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("change-phone-number")] |
|||
public virtual async Task ChangePhoneNumberAsync(ChangePhoneNumberDto input) |
|||
{ |
|||
await MyProfileAppService.ChangePhoneNumberAsync(input); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue