feat: 完成微信小程序账户应用服务

This commit is contained in:
橙子
2024-10-19 16:17:26 +08:00
parent 736995c35b
commit 0f687a7e34
16 changed files with 363 additions and 73 deletions

View File

@@ -0,0 +1,12 @@
namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Account;
public class AuthCreateOrUpdateInputDto
{
public Guid UserId { get; set; }
public string OpenId { get; set; }
public string Name { get; set; }
public string AuthType { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Account;
public class LoginOutputDto
{
public string Token { get; set; }
public string RefreshToken { get; set; }
}

View File

@@ -1,6 +1,7 @@
using Volo.Abp.Application.Services;
using Yi.Framework.Rbac.Application.Contracts.Dtos.Account;
using Yi.Framework.Rbac.Domain.Shared.Dtos;
using Yi.Framework.Rbac.Domain.Shared.Enums;
namespace Yi.Framework.Rbac.Application.Contracts.IServices
{
@@ -8,8 +9,29 @@ namespace Yi.Framework.Rbac.Application.Contracts.IServices
{
Task<UserRoleMenuDto> GetAsync();
Task<CaptchaImageDto> GetCaptchaImageAsync();
Task<object> PostLoginAsync(LoginInputVo input);
Task<LoginOutputDto> PostLoginAsync(LoginInputVo input);
Task PostRegisterAsync(RegisterDto input);
Task<bool> RestPasswordAsync(Guid userId, RestPasswordDto input);
/// <summary>
/// 提供其他服务使用根据用户id直接返回token
/// </summary>
/// <returns></returns>
Task<LoginOutputDto> PostLoginAsync(Guid userId);
/// <summary>
/// 根据信息查询用户,可能为空,代表该用户不存在或禁用
/// </summary>
/// <param name="userName"></param>
/// <param name="phone"></param>
/// <returns></returns>
Task<UserRoleMenuDto?> GetAsync(string? userName,long? phone);
/// <summary>
/// 手机验证码
/// </summary>
/// <returns></returns>
Task<object> PostCaptchaPhoneAsync(ValidationPhoneTypeEnum validationPhoneType,
PhoneCaptchaImageDto input);
}
}

View File

@@ -0,0 +1,10 @@
using Volo.Abp.Application.Dtos;
using Yi.Framework.Rbac.Application.Contracts.Dtos.Account;
namespace Yi.Framework.Rbac.Application.Contracts.IServices;
public interface IAuthService
{
Task<AuthOutputDto?> TryGetByOpenIdAsync(string openId, string authType);
Task<AuthOutputDto> CreateAsync(AuthCreateOrUpdateInputDto input);
}