using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hotline.Settings;
using Fw.Utility.UnifyResponse;
using Hotline.Share.Dtos.Identity;
using Hotline.Users;
using Hotline.Share.Dtos.Snapshot;
using DocumentFormat.OpenXml.Drawing.Diagrams;

namespace Hotline.Application.Identity
{
    public interface IIdentityAppService
    {
        /// <summary>
        /// 获取三方令牌
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        /// <exception cref="UserFriendlyException"></exception>
        Task<Dictionary<string, object>> GetThirdTokenAsync(ThirdTokenInDto dto, CancellationToken token);

        /// <summary>
        /// 第三方登录
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        Task<Dictionary<string, object>> GetThirdTokenAsync(ThirdOpenIdInDto dto, CancellationToken token);

        /// <summary>
        /// 根据OpenId刷新令牌
        /// </summary>
        /// <param name="openId"></param>
        /// <returns></returns>
        Task<Dictionary<string, object>> RefreshTokenAsync(string openId, CancellationToken token);

        Task<string> LoginAsync(LoginDto dto, CancellationToken cancellationToken);

        Task<string> OldToNewLoginAsync(HotlineLoginOldToNewDto dto, CancellationToken cancellationToken);

        Task<(bool,bool,User)> IsCheckAdmin(string userName);

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<string> LoginWithSignatureAsync(LoginWithSignatureRequest request, CancellationToken cancellationToken);
    }
}
