SDK.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef __SDK_HEADER__
  2. #define __SDK_HEADER__
  3. #pragma once
  4. #include "TableInfo.h"
  5. #include "CurlClient.h"
  6. // Êý¾ÝÀàÐÍ;
  7. enum DATATYPE
  8. {
  9. DATA_JSON = 0, // jsonÊý¾Ý;
  10. DATA_FORM = 1 // ±íµ¥ÀàÐÍ;
  11. };
  12. class CSDK
  13. {
  14. public:
  15. CSDK(void);
  16. ~CSDK(void);
  17. public:
  18. int QueryMidInfo(std::string order);
  19. int DownloadMidData(std::string order);
  20. int QueryKeyInfo(std::string sn, STKeys &keys);
  21. int UpdateKeyCopyStatus(std::string sn );
  22. int UpdateKeyReportStatus(std::string sn);
  23. int ReportKeyCopyResults(std::string sn);
  24. int BatchReportKeyCopyResults();
  25. int GetMidInfo(std::string order, STMid &mid);
  26. static int ReportDownloadStatus(std::string order);
  27. static void ParserKey(std::string file, std::vector<STKeys> &vtKyes, STMid& mid);
  28. static bool ParserSNKey(std::string json, SNKeys &snKey);
  29. BOOL HttpPost(std::string host, std::string context, std::string &result, DATATYPE dt);
  30. BOOL GetBidInfo(std::string order, std::string macs);
  31. private:
  32. static std::string _host;
  33. static std::list<STMid> m_vtMidTask;
  34. static void AddDownloadTask(STMid &mid);
  35. static BOOL PopDownloadTask(STMid &mid);
  36. static bool CheckDownload(std::string file, STMid& mid);
  37. HANDLE m_hDownloadEvent;
  38. HANDLE m_hThreadDownload;
  39. static DWORD WINAPI ThreadDownload(LPVOID lpParam);
  40. void EndDowloadThread();
  41. HANDLE m_hReportEvent;
  42. HANDLE m_hThreadReport;
  43. static DWORD WINAPI ThreadReport(LPVOID lpParam);
  44. void EndReportThread();
  45. };
  46. #endif