Init commit
This commit is contained in:
39
include/alipan.h
Normal file
39
include/alipan.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include <json-c/json.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace drive {
|
||||
typedef struct {
|
||||
std::string name, id, parent;
|
||||
bool isDir = false;
|
||||
size_t size;
|
||||
} gdItem;
|
||||
} // namespace drive
|
||||
|
||||
class alipan {
|
||||
public:
|
||||
virtual ~alipan() = default;
|
||||
|
||||
bool checkLogin();
|
||||
void getListWithParent(const std::string& _parent, std::vector<drive::gdItem>& _out);
|
||||
bool createDir(const std::string& _dirName, const std::string& _parent);
|
||||
bool deleteFile(const std::string& _fileID);
|
||||
|
||||
private:
|
||||
std::string deviceId;
|
||||
std::string accessToken;
|
||||
std::string rToken;
|
||||
|
||||
std::string driveId;
|
||||
std::string userId;
|
||||
std::string signature;
|
||||
|
||||
json_object* request(const std::string& api, const std::string& data);
|
||||
|
||||
bool getSelfuser();
|
||||
bool refreshToken();
|
||||
bool createSession();
|
||||
bool qrLogin();
|
||||
};
|
||||
Reference in New Issue
Block a user