#ifndef __SDK_HEADER__ #define __SDK_HEADER__ #pragma once #include "TableInfo.h" #include "CurlClient.h" // 数据类型; enum DATATYPE { DATA_JSON = 0, // json数据; DATA_FORM = 1 // 表单类型; }; class CSDK { public: CSDK(void); ~CSDK(void); public: int QueryMidInfo(std::string order); int DownloadMidData(std::string order); int QueryKeyInfo(std::string sn, STKeys &keys); int UpdateKeyCopyStatus(std::string sn ); int UpdateKeyReportStatus(std::string sn); int ReportKeyCopyResults(std::string sn); int BatchReportKeyCopyResults(); int GetMidInfo(std::string order, STMid &mid); static int ReportDownloadStatus(std::string order); static void ParserKey(std::string file, std::vector &vtKyes, STMid& mid); static bool ParserSNKey(std::string json, SNKeys &snKey); BOOL HttpPost(std::string host, std::string context, std::string &result, DATATYPE dt); BOOL GetBidInfo(std::string order, std::string macs); private: static std::string _host; static std::list m_vtMidTask; static void AddDownloadTask(STMid &mid); static BOOL PopDownloadTask(STMid &mid); static bool CheckDownload(std::string file, STMid& mid); HANDLE m_hDownloadEvent; HANDLE m_hThreadDownload; static DWORD WINAPI ThreadDownload(LPVOID lpParam); void EndDowloadThread(); HANDLE m_hReportEvent; HANDLE m_hThreadReport; static DWORD WINAPI ThreadReport(LPVOID lpParam); void EndReportThread(); }; #endif