using DeviceRepair.Models;
using System;

namespace TsSFCDeivceClient.Biz
{
    public class CommonApi
    {
        private static CommonApi manager;
        public static CommonApi Instance { get { if (manager == null) { manager = new CommonApi(); } return manager; } }

        public APIResponseData GetTheEquipmentInMaintenance(string EquipmentCode)
        {
            APIResponseData apiResponseData = new APIResponseData() { Code = -1, Message = "接口调用失败!" };
            try
            {
                return HttpHelper.Instance.Get($"{RunConfig.config.ServiceApiUrl}{DeviceApiUrlConstValue.GetTheEquipmentInMaintenance}{EquipmentCode}");
            }
            catch (Exception ex)
            {

                throw;
            }
        }

        public APIResponseData GetTsSFCUserAuths(Guid userGuid)
        {
            APIResponseData apiResponseData = new APIResponseData() { Code = -1, Message = "接口调用失败!" };
            try
            {
                return HttpHelper.Instance.Get($"{RunConfig.config.ServiceApiUrl}{DeviceApiUrlConstValue.GetTsSFCUserAuths}{userGuid}");
            }
            catch (Exception ex)
            {

                throw;
            }
        }
    }
}
