Пример #1
0
        public async Task GetOrderById()
        {
            var res = await _client.GetRequestAsync(new OrderByIdRequest(apikey, apivalue, sharekey)
            {
                id = "201018105037101"
            });

            Assert.True(res.code == 0);
        }
        public async Task <List <OrderAsyncModel> > GetOrderList(ShopResponseDto shop, DateTime startTime, DateTime endTime)
        {
            var list = new List <OrderAsyncModel>();

            for (int page = 1; ; page++)
            {
                var res = await _client.GetRequestAsync(new OrderListRequest(shop.ApiKey, shop.ApiKeyValue, shop.ShareKey)
                {
                    page       = page,
                    limit      = 100,
                    time_start = startTime,
                    time_end   = endTime
                });

                if (res.data.data.Count == 0)
                {
                    break;
                }
                list.AddRange(res.data.data.MapTo <List <OrderAsyncModel> >());
            }
            return(list);
        }