#pragma once

#include "comm.h"

enum struct  HTTPRET
{
	http_no = 0,
	http_f,
	http_yes,
	http_start,
	http_end,
	http_user_expired_at,
	http_user_transfer_enable,
	http_user_enable

};



class IBaseCurl
{
public:
	virtual ~IBaseCurl(void) {};

	virtual void SetUrl(LPCSTR url) = 0;

	//
	virtual bool Download(std::string path) = 0;

	virtual void SetUrlArray(std::vector<ServerListUrl> data) = 0;

	//登录xia'zai
	virtual HTTPRET PostLogin(LPCSTR username, LPCSTR password, std::string& data) = 0;

	//注册
	virtual HTTPRET PostReg(LPCSTR username, LPCSTR password, std::string& data) = 0;


	//獲取系統配置
	virtual HTTPRET GetSysConfig(std::string& data) = 0;
	//根据用户名和密码获取配置
	virtual HTTPRET GetSysConfigFromUser(LPCSTR username, LPCSTR password, std::string& data) = 0;

	//获取线路
	virtual HTTPRET GetServerNode(std::string& data) = 0;

	//鉴权
	virtual HTTPRET Auth(std::string& data) = 0;

	virtual HTTPRET Refresh(std::string& data) = 0;

	virtual HTTPRET Version(std::string& data) = 0;

	virtual SStringA  GetLastErrorA() = 0;
	virtual SStringW  GetLastErrorW() = 0;
	virtual int  GetHttpStatus() = 0;

};

