Ejemplo n.º 1
0
        public virtual async Task <PushQueryMessageListResult> PushQueryMessageList()
        {
            CurrentUnitOfWork.DisableFilter(AbpDataFilters.SoftDelete);
            AccessToken token = await this.Repository.GetAsync(6526667356666593280);

            SyncAPIClient             client = new SyncAPIClient(token.App_Key, token.App_Secret);
            PushQueryMessageListParam param
                = new PushQueryMessageListParam();
            RequestPolicy oauthPolicy = new RequestPolicy();

            oauthPolicy.UseHttps = true;

            PushQueryMessageListResult response = client.execute <PushQueryMessageListResult>(param, token.Access_Token);

            return(null);
        }
Ejemplo n.º 2
0
        // Testing Method
        public void GetSellerTradeView()
        {
            SyncAPIClient client = new SyncAPIClient("3259943", "t6MpyARzzv");
            AlibabaTradeGetSellerOrderListParam param = new AlibabaTradeGetSellerOrderListParam();

            string accessToken = "aa200987-fcec-48d9-9521-967d3ce2eea2";

            RequestPolicy oauthPolicy = new RequestPolicy();

            oauthPolicy.UseHttps = true;

            AlibabaTradeGetSellerOrderListResult result =
                client.execute <AlibabaTradeGetSellerOrderListResult>(param, accessToken);

            Console.Write(result.getTotalRecord());
        }
Ejemplo n.º 3
0
        public IList <AlibabaOpenplatformTradeModelTradeInfo> GetModificationTradeInfos(
            IAccessToken token,
            DateTime modifyStart,
            DateTime modifyEnd)
        {
            string        accessToken = token.Access_Token;
            SyncAPIClient client      = new SyncAPIClient(token.App_Key, token.App_Secret);
            int           maxPageSize = 20; // Alibaba only support 20
            int           currentPage = 1;
            long          totalCount  = 0;
            // Save all trade into this collection.
            IList <AlibabaOpenplatformTradeModelTradeInfo> data
                = new List <AlibabaOpenplatformTradeModelTradeInfo>();

            // 先计算一次,拿到总数后,再做循环处理
            do
            {
                Console.WriteLine("Page " + currentPage.ToString());
                AlibabaTradeGetSellerOrderListParam param
                    = new AlibabaTradeGetSellerOrderListParam();
                // 设置查询条件,查询前一在的数据
                param.setModifyStartTime(modifyStart);
                param.setModifyEndTime(modifyEnd);
                // 分页计算
                param.setPageSize(maxPageSize);
                param.setPage(currentPage);
                RequestPolicy oauthPolicy = new RequestPolicy();
                oauthPolicy.UseHttps = true;
                AlibabaTradeGetSellerOrderListResult result =
                    client.execute <AlibabaTradeGetSellerOrderListResult>(param, accessToken);
                totalCount = result.getTotalRecord().Value;
                AlibabaOpenplatformTradeModelTradeInfo[] orders = result.getResult();
                foreach (var ord in orders)
                {
                    data.Add(ord);
                }
                currentPage++;
            }while (currentPage * 1.0 <= (totalCount * 1.0 / maxPageSize)); // 没有超出分页,继续执行

            Console.WriteLine("Alibaba Order Count : " + data.Count);
            Console.WriteLine("Pull Order Count : " + data.Count);
            return(data);
        }
Ejemplo n.º 4
0
        public AlibabaOpenplatformTradeModelTradeInfo GetTradeInfor(string appKey, string memberId, long orderId)
        {
            var token = accessTokenRepository.Single(
                t => t.App_Key == appKey &&
                t.MemberId == memberId &&
                t.IsActive == true &&
                t.IsDeleted == false);

            SyncAPIClient client = new SyncAPIClient(token.App_Key, token.App_Secret);
            // SyncAPIClient client = new SyncAPIClient("3259943", "t6MpyARzzv");

            AlibabaTradeGetSellerViewParam param
                = new AlibabaTradeGetSellerViewParam();
            RequestPolicy oauthPolicy = new RequestPolicy();

            oauthPolicy.UseHttps = true;

            param.setOrderId(orderId);

            AlibabaTradeGetSellerViewResult response = client.execute <AlibabaTradeGetSellerViewResult>(param, token.Access_Token);

            return(response.getResult());
        }