using BBWY.Client.Models;
using BBWY.Common.Http;
using BBWY.Common.Models;
using System.Collections.Generic;
using System.Net.Http;

namespace BBWY.Client.APIServices
{
    public class LogisticsService : BaseApiService, IDenpendency
    {
        public LogisticsService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) { }

        public ApiResponse<IList<LogisticsResponse>> GetLogisticsList()
        {
            return SendRequest<IList<LogisticsResponse>>(globalContext.BBYWApiHost, "api/vender/GetLogisticsList", new
            {
                globalContext.User.Shop.Platform,
                globalContext.User.Shop.AppKey,
                globalContext.User.Shop.AppSecret,
                globalContext.User.Shop.AppToken
            }, null, HttpMethod.Post);
        }

        /// <summary>
        /// 获取仓库列表
        /// </summary>
        /// <returns></returns>
        public ApiResponse<IList<StoreResponse>> GetStoreList()
        {
            return SendRequest<IList<StoreResponse>>(globalContext.BBYWApiHost, "api/vender/GetStoreHouseList", new
            {
                globalContext.User.Shop.Platform,
                globalContext.User.Shop.AppKey,
                globalContext.User.Shop.AppSecret,
                globalContext.User.Shop.AppToken
            }, null, HttpMethod.Post);
        }
    }
}