using HoneyBox.Model.Entities;
using HoneyBox.Model.Models.Auth;

namespace HoneyBox.Core.Interfaces;

/// <summary>
/// 用户服务接口
/// </summary>
public interface IUserService
{
    /// <summary>
    /// 根据用户ID获取用户
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <returns>用户实体</returns>
    Task<User?> GetUserByIdAsync(int userId);

    /// <summary>
    /// 根据openid获取用户
    /// </summary>
    /// <param name="openId">微信openid</param>
    /// <returns>用户实体</returns>
    Task<User?> GetUserByOpenIdAsync(string openId);

    /// <summary>
    /// 根据unionid获取用户
    /// </summary>
    /// <param name="unionId">微信unionid</param>
    /// <returns>用户实体</returns>
    Task<User?> GetUserByUnionIdAsync(string unionId);

    /// <summary>
    /// 根据手机号获取用户
    /// </summary>
    /// <param name="mobile">手机号</param>
    /// <returns>用户实体</returns>
    Task<User?> GetUserByMobileAsync(string mobile);

    /// <summary>
    /// 创建新用户
    /// </summary>
    /// <param name="dto">创建用户DTO</param>
    /// <returns>创建的用户实体</returns>
    Task<User> CreateUserAsync(CreateUserDto dto);

    /// <summary>
    /// 更新用户信息
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="dto">更新用户DTO</param>
    /// <returns>异步任务</returns>
    Task UpdateUserAsync(int userId, UpdateUserDto dto);

    /// <summary>
    /// 获取用户信息DTO
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <returns>用户信息DTO</returns>
    Task<UserInfoDto?> GetUserInfoAsync(int userId);

    /// <summary>
    /// 计算用户VIP等级
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <param name="currentVip">当前VIP等级</param>
    /// <returns>计算后的VIP等级</returns>
    Task<int> CalculateVipLevelAsync(int userId, int currentVip);
}
