using Hotline.Share.Dtos.Snapshot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;

namespace Hotline.ThirdAccountDomainServices.Interfaces;

public interface IThirdAccountSupplier
{
    /// <summary>
    /// 如何用户不存在,注册新的用户
    /// </summary>
    /// <param name="account"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    Task RegisterAsync(ThirdAccount account, CancellationToken token);

    /// <summary>
    /// 登录成功后添加到SessionContext中的参数
    /// </summary>
    /// <param name="account"></param>
    /// <param name="claims"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    Task<string> GetClaimAsync(ThirdAccount account, List<Claim> claims, CancellationToken token);

    /// <summary>
    /// 登录成功后返回给前端的参数
    /// </summary>
    /// <param name="thirdAccount"></param>
    /// <param name="dicOutData"></param>
    /// <param name="cancel"></param>
    /// <returns></returns>
    Task<Dictionary<string, object>> GetLoginOutDataAsync(ThirdAccount thirdAccount, Dictionary<string, object> dicOutData, CancellationToken cancel);

    /// <summary>
    /// 调用第三方接口需要的入参
    /// </summary>
    /// <param name="thirdDto"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    Task<ThirdTokenDto> GetThirdParameterAsync(ThirdTokenDto thirdDto, CancellationToken token);
}
