using Avalonia_Services.Core; using System.Threading.Tasks; namespace Avalonia_Services.Services.AuthService { /// /// API 鉴权端点服务接口,定义登录、刷新 Token 和登出操作。 /// public interface IApiAuthEndpointService { /// /// 处理用户登录请求。 /// /// 服务端点上下文。 /// 包含 Token 的认证响应。 Task LoginAsync(ServiceEndpointContext ctx); /// /// 使用 Refresh Token 刷新 Access Token。 /// /// 服务端点上下文。 /// 新的 Token 对。 Task RefreshAsync(ServiceEndpointContext ctx); /// /// 处理用户登出请求。 /// /// 服务端点上下文。 /// 登出结果。 Task LogoutAsync(ServiceEndpointContext ctx); } /// /// PC 端鉴权端点服务接口,定义授权码登录、Token 刷新和登出操作。 /// public interface IPcAuthEndpointService { /// /// 使用授权码进行登录授权。 /// /// 服务端点上下文。 /// 包含 Token 的认证响应。 Task AuthorizeAsync(ServiceEndpointContext ctx); /// /// 刷新当前 Token。 /// /// 服务端点上下文。 /// 新的 Token 响应。 Task RefreshAsync(ServiceEndpointContext ctx); /// /// 处理用户登出请求。 /// /// 服务端点上下文。 /// 登出结果。 Task LogoutAsync(ServiceEndpointContext ctx); } }