IBaseCurl.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. #include "comm.h"
  3. enum struct HTTPRET
  4. {
  5. http_no = 0,
  6. http_f,
  7. http_yes,
  8. http_start,
  9. http_end,
  10. http_user_expired_at,
  11. http_user_transfer_enable,
  12. http_user_enable
  13. };
  14. class IBaseCurl
  15. {
  16. public:
  17. virtual ~IBaseCurl(void) {};
  18. virtual void SetUrl(LPCSTR url) = 0;
  19. virtual HTTPRET GetloginByUrl(LPCSTR key, std::string& data) = 0;
  20. //
  21. virtual bool Download(std::string path) = 0;
  22. virtual void SetUrlArray(std::vector<ServerListUrl> data) = 0;
  23. //登录xia'zai
  24. virtual HTTPRET PostLogin(LPCSTR username, LPCSTR password, std::string& data) = 0;
  25. //注册
  26. virtual HTTPRET PostReg(LPCSTR username, LPCSTR password, std::string& data) = 0;
  27. //獲取系統配置
  28. virtual HTTPRET GetSysConfig(std::string& data) = 0;
  29. //根据用户名和密码获取配置
  30. virtual HTTPRET GetSysConfigFromUser(LPCSTR username, LPCSTR password, std::string& data) = 0;
  31. //获取线路
  32. virtual HTTPRET GetServerNode(std::string& data) = 0;
  33. //鉴权
  34. virtual HTTPRET Auth(std::string& data) = 0;
  35. virtual HTTPRET Refresh(std::string& data) = 0;
  36. virtual HTTPRET Version(std::string& data) = 0;
  37. // 获取的我订阅
  38. virtual HTTPRET GetMySub(std::string& data) = 0;
  39. virtual SStringA GetLastErrorA() = 0;
  40. virtual SStringW GetLastErrorW() = 0;
  41. virtual int GetHttpStatus() = 0;
  42. };