IUsAppAuthAppService.cs 3.31 KB
using FoodLabeling.Application.Contracts.Dtos.UsAppAuth;
using Volo.Abp.Application.Services;
using Yi.Framework.Rbac.Application.Contracts.Dtos.Account;

namespace FoodLabeling.Application.Contracts.IServices;

/// <summary>
/// 美国版移动端认证(登录返回绑定门店)
/// </summary>
public interface IUsAppAuthAppService : IApplicationService
{
    /// <summary>
    /// App 登录:使用邮箱 + 密码校验并签发 Token,同时返回 userlocation 绑定的门店
    /// </summary>
    Task<UsAppLoginOutputDto> LoginAsync(UsAppLoginInputVo input);

    /// <summary>
    /// 获取当前登录账号已绑定的门店(用于切换门店等场景)
    /// </summary>
    Task<List<UsAppBoundLocationDto>> GetMyLocationsAsync();

    /// <summary>
    /// 获取当前登录用户资料(My Profile:姓名、邮箱、电话、员工号、角色)
    /// </summary>
    /// <returns>资料 DTO</returns>
    /// <response code="200">成功</response>
    /// <response code="400">未登录或用户不存在</response>
    /// <response code="500">服务器错误</response>
    Task<UsAppMyProfileOutputDto> GetMyProfileAsync();

    /// <summary>
    /// 当前登录用户修改密码(校验原密码与复杂度规则)
    /// </summary>
    /// <param name="input">当前密码、新密码、确认密码</param>
    /// <remarks>
    /// 新密码需满足:至少 8 位;含大写与小写字母;至少 1 位数字;至少 1 个非字母数字特殊字符。
    /// </remarks>
    /// <response code="200">成功</response>
    /// <response code="400">参数或校验失败</response>
    /// <response code="500">服务器错误</response>
    Task ChangePasswordAsync(UsAppChangePasswordInputVo input);

    /// <summary>
    /// 按门店 Id 查询 Location 详情(须为当前账号 userlocation 绑定门店)
    /// </summary>
    /// <param name="locationId">门店 Guid 字符串</param>
    /// <returns>店名、地址、电话、经营时间(operatingHours)、店长信息</returns>
    /// <response code="200">成功</response>
    /// <response code="400">参数非法、未绑定或无权限</response>
    /// <response code="500">服务器错误</response>
    Task<UsAppLocationDetailOutputDto> GetLocationDetailAsync(string locationId);

    /// <summary>
    /// App forgot password: send email verification code (same user store and rules as platform).
    /// </summary>
    /// <remarks>
    /// When <c>RbacOptions.EnableCaptcha</c> is true, pass <c>Uuid</c> and <c>Code</c> from platform captcha API.
    /// </remarks>
    /// <param name="input">Email and optional image captcha.</param>
    /// <response code="200">Accepted.</response>
    /// <response code="400">Validation or rate limit.</response>
    /// <response code="500">Server error</response>
    Task PostSendForgotPasswordCodeByEmailAsync(EmailCaptchaImageDto input);

    /// <summary>
    /// App forgot password: reset password with email OTP.
    /// </summary>
    /// <param name="input">Email, OTP, new password.</param>
    /// <returns>Account user name.</returns>
    /// <response code="200">Password updated.</response>
    /// <response code="400">Invalid code or password policy.</response>
    /// <response code="500">Server error</response>
    Task<string> PostResetPasswordByEmailAsync(RetrievePasswordByEmailDto input);
}