예제 #1
0
        /// <summary>
        /// 初始化,直接传入TokenData
        /// </summary>
        /// <param name="tokenData">token</param>
        /// <param name="funcGetTokenData">获取新TokenData的委托</param>
        public ApiHelper(TokenData tokenData, Func <TokenData> funcGetTokenData = null)
        {
            oAuthToken        = tokenData;
            _checkToken       = true;
            _funcGetTokenData = funcGetTokenData;

            _YouZanClient = new DefaultYZClient();
        }
예제 #2
0
        public ApiHelper(string clientId, string clientSecret, string grantId)
        {
            this.ClientId     = clientId;
            this.ClientSecret = clientSecret;
            this.GrantId      = grantId;

            _YouZanClient = new DefaultYZClient();

            this.GetAccessToken();
        }
예제 #3
0
        public ApiHelper(string clientId, string clientSecret, string grantId)
        {
            this.ClientId     = clientId;
            this.ClientSecret = clientSecret;
            this.GrantId      = grantId;

            _YouZanClient = new DefaultYZClient();

            Silent silent = new Silent(this.ClientId, this.ClientSecret, this.GrantId);

            oAuthToken = silent.GetToken();
        }