mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
4.2.7
This commit is contained in:
@@ -2,18 +2,12 @@
|
||||
#define SDK_CXX_OPENCLIENT_H
|
||||
|
||||
#include <string>
|
||||
#include <json/json.h>
|
||||
#include "httplib.h"
|
||||
#include "../request/BaseRequest.h"
|
||||
#include "../thirdparty/CJsonObject/CJsonObject.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct HostInfo {
|
||||
string host;
|
||||
int port;
|
||||
char *path;
|
||||
};
|
||||
|
||||
/**
|
||||
* 请求客户端
|
||||
*/
|
||||
@@ -21,6 +15,7 @@ class OpenClient {
|
||||
private:
|
||||
/** 应用id */
|
||||
string appId;
|
||||
string url;
|
||||
/** 私钥文件路径 */
|
||||
string privateKeyFilePath;
|
||||
|
||||
@@ -39,19 +34,17 @@ public:
|
||||
* @param token token
|
||||
* @return 返回响应结果
|
||||
*/
|
||||
neb::CJsonObject execute(BaseRequest *request, const string& token);
|
||||
Json::Value execute(BaseRequest *request, const string& token);
|
||||
|
||||
/**
|
||||
* 发送请求
|
||||
* @param request 请求对象,BaseRequest的子类
|
||||
* @return 返回响应结果
|
||||
*/
|
||||
neb::CJsonObject execute(BaseRequest *request);
|
||||
Json::Value execute(BaseRequest *request);
|
||||
|
||||
private:
|
||||
|
||||
HostInfo hostInfo;
|
||||
|
||||
map<string, string> buildParams(BaseRequest *request, const string& token);
|
||||
|
||||
static httplib::MultipartFormDataItems
|
||||
@@ -59,7 +52,9 @@ private:
|
||||
|
||||
static httplib::Params getParams(map<string, string> params);
|
||||
|
||||
static neb::CJsonObject parseResponse(const string& responseBody,BaseRequest *request);
|
||||
static string getQuery(map<string, string> params);
|
||||
|
||||
static Json::Value parseResponse(const string& responseBody,BaseRequest *request);
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user