using Furion.DependencyInjection;
using Senparc.Weixin;
using Senparc.Weixin.MP.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace YBDevice.NApi.Application.UserInfo
{
    /// <summary>
    /// 公众号相关处理
    /// </summary>
    public class MPService : IMPService, ITransient
    {
        private string appId = Config.SenparcWeixinSetting.WeixinAppId;
        private string appSecret = Config.SenparcWeixinSetting.WeixinAppSecret;
        /// <summary>
        /// 获取jssdk信息
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public async Task<JsSdkUiPackage> GetJsSdkUiPackageAsync(string url)
        {
            var jssdkUiPackage = await JSSDKHelper.GetJsSdkUiPackageAsync(appId, appSecret, url);
            return jssdkUiPackage;
        }
    }
}
