Update to dms control phase1.

This commit is contained in:
sunwen
2023-08-21 14:22:41 +08:00
parent d1dc5df680
commit 20fb814608
59 changed files with 2538 additions and 904 deletions

View File

@@ -0,0 +1,5 @@
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH)
set(Req_INCLUDES_DIRS "${_DIR}/include")
add_library(Req SHARED IMPORTED)
set_target_properties(Req PROPERTIES IMPORTED_LOCATION "${_DIR}/lib/libReq.so")
set(Req_FOUND ON)

32
thirdParty/Req/pub/include/Request.h vendored Normal file
View File

@@ -0,0 +1,32 @@
#ifndef __REQUEST_H__
#define __REQUEST_H__
#include <string>
#include <unordered_map>
#include "Response.h"
namespace Req {
class Request {
public:
static void Init();
static void Dispose();
Request();
Request(Request &&) = delete;
Request(const Request &) = delete;
Request &operator=(Request &&) = delete;
Request &operator=(const Request &) = delete;
~Request();
void setClientCertificate(const std::string &cerPath, const std::string &keyPath);
void setVerbose(bool verbose);
Response post(const std::string& url, const std::string &body = std::string(),
const std::unordered_map<std::string, std::string>& headers =
std::unordered_map<std::string, std::string>());
private:
void* mCurl;
void* mHeaders;
std::string mCert;
std::string mKey;
bool mVerbose;
};
}
#endif // __REQUEST_H__

23
thirdParty/Req/pub/include/Response.h vendored Normal file
View File

@@ -0,0 +1,23 @@
#ifndef __RESPONSE_H__
#define __RESPONSE_H__
#include "string"
#include <string>
namespace Req {
class Response
{
public:
Response();
Response(Response &&) = default;
Response(const Response &) = default;
Response &operator=(Response &&) = delete;
Response &operator=(const Response &) = delete;
~Response();
long httpCode();
void setHttpCode(long code);
std::string& getContent();
private:
long mHttpCode = 404;
std::string mContent;
};
};
#endif // __RESPONSE_H__

BIN
thirdParty/Req/pub/lib/libReq.so vendored Normal file

Binary file not shown.