28 lines
956 B
C#
28 lines
956 B
C#
using LiveForum.Model.Dto.Wechat;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace LiveForum.IService.Others
|
|
{
|
|
/// <summary>
|
|
/// 微信小程序服务接口
|
|
/// 定义业务需要的微信小程序功能,方便替换实现
|
|
/// </summary>
|
|
public interface IWechatMiniProgramService
|
|
{
|
|
/// <summary>
|
|
/// 通过 code 获取用户的 openId 和 sessionKey
|
|
/// </summary>
|
|
/// <param name="jsCode">微信小程序登录凭证 code</param>
|
|
/// <returns>用户登录信息(包含 openId、sessionKey 等)</returns>
|
|
Task<WechatLoginInfoDto> GetLoginInfoByCodeAsync(string jsCode);
|
|
|
|
/// <summary>
|
|
/// 通过手机号 code 获取用户手机号
|
|
/// </summary>
|
|
/// <param name="phoneCode">getPhoneNumber 回调中的 code</param>
|
|
/// <returns>手机号,失败返回 null</returns>
|
|
Task<string?> GetPhoneNumberByCodeAsync(string phoneCode);
|
|
}
|
|
}
|
|
|