using BBWY.Common.Models;
using BBWY.JDSDK.Request;
using BBWY.Server.Model.Db;
using BBWY.Server.Model.Dto;
using Jd.Api;
using Jd.Api.Request;
using Jd.Api.Response;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using io = System.IO;
namespace BBWY.Test
{
    internal class Program
    {
        private static IJdClient GetJdClient(string appKey, string appSecret)
        {
            return new DefaultJdClient("https://api.jd.com/routerjson", appKey, appSecret);
        }

        static void Main(string[] args)
        {
            var appKey = "120EA9EC65AB017567D78CC1139EEEA5";
            var appSecret = "866a9877f5f24b03b537483b4defe75d";
            var token = "2ace3023200c4ea9aa682bbf8bffee18jztm";
            var jdClient = GetJdClient(appKey, appSecret);

            AscQueryListRequest req = new AscQueryListRequest();

            req.buId = "10598776";
            req.operatePin = "开发测试";
            req.operateNick = "开发测试";
            req.orderId = 249263452032;
            //req.serviceId = 123L;
            //req.orderId = 123L;
            //req.applyTimeBegin = new Date();
            //req.applyTimeEnd = new Date();
            //req.finishTimeBegin = new Date();
            //req.finishTimeEnd = new Date();
            //req.verificationCode = "abc";
            //req.expressCode = "abc";
            //req.orderType = 123;
            //req.processResult = 123;
            //req.customerPin = "abc";
            //req.customerName = "abc";
            //req.customerTel = "abc";
            //req.approveTimeBegin = new Date();
            //req.approveTimeEnd = new Date();
            //req.pageNumber = 123;
            //req.pageSize = 123;
            //req.extJsonStr = "abc";

            AscQueryListResponse response = jdClient.Execute(req, token, DateTime.Now.ToLocalTime());
            Console.WriteLine(JsonConvert.SerializeObject(response));
            Console.ReadKey();
        }
    }
}