using BBWY.Client.Models;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace BBWY.Client
{
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [ComVisible(true)]
    public class GlobalContext : NotifyObject
    {
        public GlobalContext()
        {
            ShopServiceGroupList = new List<string>();
            ShopServiceGroupLowerList = new List<string>();
            ClientVersion = "10184";
        }

        private User user;

        public User User { get => user; set { Set(ref user, value); } }

        public string UserToken { get; set; }

        public IList<LogisticsResponse> LogisticsResponseList { get; set; }

        public IList<string> ShopServiceGroupList { get; set; }

        public IList<string> ShopServiceGroupLowerList { get; set; }

        public string ClientVersion { get; set; }

        /// <summary>
        /// JD客户端
        /// </summary>
        //public IJdClient JdClient { get; set; }

        #region APIHost
        public string BBYWApiHost { get; set; }

        public string MDSApiHost { get; set; }

        public string JOSApiHost { get; set; }

        public string _1688ApiHost { get; set; }

        public string QKApiHost { get; set; }


        #endregion

        #region Web
        public string GetUserString()
        {
            return JsonConvert.SerializeObject(User);
        }

        public string GetClientApiVersion()
        {
            return ClientVersion;
        }
        #endregion
    }
}