Files
tiku-backend.net/Tiku.Application/Auth/IWechatOAuthClient.cs
2026-07-26 13:12:53 +08:00

27 lines
659 B
C#

namespace Tiku.Application.Auth;
public sealed record WechatProviderOptions(
string AppId,
string AppSecret);
public sealed record WechatIdentity(
string OpenId,
string? UnionId,
string? Nickname,
string? AvatarUrl,
string? SessionKey,
string RawJson);
public interface IWechatOAuthClient
{
Task<WechatIdentity> ExchangeWebCodeAsync(
WechatProviderOptions options,
string code,
CancellationToken cancellationToken = default);
Task<WechatIdentity> ExchangeMiniAppCodeAsync(
WechatProviderOptions options,
string code,
CancellationToken cancellationToken = default);
}