using RB_MES_API.Models.Cloud;
using RB_MES_API.Models.Pangu;
using RB_MES_APICore.Models.Cloud;

namespace RB_MES_API.Controllers
{
    /// <summary>
    /// 金蝶云API访问接口类
    /// </summary>
    public interface IKDCloudHttpClient
    {
        /// <summary>
        /// Cloud身份认证，使保持一直在线
        /// </summary>
        /// <returns></returns>
        public Task<bool> LoginErp();
        /// <summary>
        /// HttpClient访问，.NET CORE推荐使用,无组件引用
        /// 仅开放给远程自定义查询数据时使用
        /// 使用前确保LoginErp=Ture
        /// </summary>
        /// <returns></returns>
        public Task<string> AsyncClientRequest(string myurl, string content);

        /// <summary>
        /// 向MES系统推送数据
        /// </summary>
        /// <param name="inputdata"></param>
        /// <returns></returns>
        public Task<PanguBreakJson> PushMesData(string inputdata);
        /// <summary>
        /// 第三方系统通过SDK组件查询云星空表单
        /// </summary>
        /// <param name="query">BillQuery实例</param>
        /// <returns></returns>
        public string SDKBillQuery(BillQuery query);
        /// <summary>
        /// 第三方系统通过SDK组件访问云星空
        /// </summary>
        /// <param name="formid"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public string SDKBatchSaveRequest(string formid, string data);
        /// <summary>
        /// 校验SDKBillQuery是否成功
        /// </summary>
        /// <param name="resultJson">接口返回的json</param>
        /// <returns></returns>
        public bool SDKBillQueryStatus(string resultJson);
        /// <summary>
        /// 对返回结果进行解析和校验
        /// </summary>
        /// <param name="resultJson">接口返回的json</param>
        /// <returns></returns>
        public bool SDKRequestStatus(string resultJson);
    }
}
