using MilitaryTrainingManagement.Models.Entities;

namespace MilitaryTrainingManagement.Services.Interfaces;

/// <summary>
/// 认证服务接口
/// </summary>
public interface IAuthenticationService
{
    Task<(UserAccount? User, string? Token)> LoginAsync(string username, string password);
    Task<UserAccount?> GetUserByIdAsync(int userId);
    Task<UserAccount?> GetUserByUsernameAsync(string username);
    Task<UserAccount> CreateUserAsync(string username, string password, string displayName, int organizationalUnitId);
    Task UpdateLastLoginAsync(int userId);
    string GenerateJwtToken(UserAccount user);
    bool ValidatePassword(string password, string passwordHash);
    string HashPassword(string password);
}
