1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #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<STKeys> &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<STMid> 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
|