Skip to content

Commit f35dc10

Browse files
committed
modify:match example for xengine v7.48
1 parent f7fa644 commit f35dc10

File tree

7 files changed

+63
-68
lines changed

7 files changed

+63
-68
lines changed

XEngine_APPClient/APPClient_Download/APPClient_Download.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
#include <windows.h>
77
#include <tchar.h>
88
#pragma comment(lib,"x86/XEngine_BaseLib/XEngine_BaseLib")
9-
#pragma comment(lib,"x86/XEngine_NetHelp/NetHelp_APIHelp")
10-
#pragma comment(lib,"x86/XEngine_DownLoad/XEngine_DownLoad")
9+
#pragma comment(lib,"x86/XEngine_NetHelp/NetHelp_APIClient")
1110
#pragma comment(lib,"x86/XEngine_SystemSdk/XEngine_SystemApi")
1211
#pragma comment(lib,"Ws2_32")
1312
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
@@ -21,10 +20,8 @@
2120
#include <XEngine_Include/XEngine_ProtocolHdr.h>
2221
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2322
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
24-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
25-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
26-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Define.h>
27-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Error.h>
23+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
24+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2825
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
2926
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
3027
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
@@ -33,8 +30,8 @@ using namespace std;
3330

3431
//需要优先配置XEngine
3532
//WINDOWS使用VS2022 x86 debug 编译
36-
//linux::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L /usr/local/lib/XEngine_Release/XEngine_DownLoad -L /usr/local/lib/XEngine_Release/XEngine_SystemSdk -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIHelp -lXEngine_Download -lXEngine_SystemApi -ljsoncpp
37-
//macos::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIHelp -lXEngine_Download -lXEngine_SystemApi -ljsoncpp
33+
//linux::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L /usr/local/lib/XEngine_Release/XEngine_SystemSdk -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -lXEngine_SystemApi -ljsoncpp
34+
//macos::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -lXEngine_SystemApi -ljsoncpp
3835

3936
typedef struct
4037
{
@@ -115,23 +112,24 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
115112
nPos += nPiece;
116113
_stprintf(tszRange, _T("%lld-%lld"), pSt_P2PFile[i].nPosStart, pSt_P2PFile[i].nPosEnd);
117114
}
118-
pSt_P2PFile[i].xhToken = DownLoad_Http_Create(tszDLUrl, lpszFile, tszRange, NULL, NULL, NULL);
115+
pSt_P2PFile[i].xhToken = APIClient_File_Create(tszDLUrl, lpszFile, TRUE, tszRange);
119116
if (NULL == pSt_P2PFile[i].xhToken)
120117
{
121-
printf("create download task is failed:%X\n", Download_GetLastError());
118+
printf("create download task is failed:%X\n", APIClient_GetLastError());
122119
}
120+
APIClient_File_Start(pSt_P2PFile[i].xhToken);
123121
}
124122
//直到所有完成
125123
while (1)
126124
{
127125
BOOL bComplete = TRUE;
128126
for (unsigned int i = 0; i < pStl_ListFile->size(); i++)
129127
{
130-
NETDOWNLOAD_TASKINFO st_TaskInfo;
131-
memset(&st_TaskInfo, '\0', sizeof(NETDOWNLOAD_TASKINFO));
128+
NETHELP_FILEINFO st_TaskInfo;
129+
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
132130

133-
DownLoad_Http_Query(pSt_P2PFile[i].xhToken, &st_TaskInfo);
134-
if (ENUM_XENGINE_DOWNLOAD_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
131+
APIClient_File_Query(pSt_P2PFile[i].xhToken, &st_TaskInfo);
132+
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
135133
{
136134
bComplete = FALSE;
137135
}
@@ -146,7 +144,7 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
146144

147145
for (unsigned int i = 0; i < pStl_ListFile->size(); i++)
148146
{
149-
DownLoad_Http_Delete(pSt_P2PFile[i].xhToken);
147+
APIClient_File_Delete(pSt_P2PFile[i].xhToken);
150148
}
151149
delete[] pSt_P2PFile;
152150
pSt_P2PFile = NULL;
@@ -172,7 +170,7 @@ int main()
172170
//st_JsonRoot["lpszFileName"] = "qq.exe";
173171
st_JsonRoot["lpszFileHash"] = "D41D8CD98F00B204E9801998ECF8427E";
174172

175-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBody, &nBodyLen))
173+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBody, &nBodyLen))
176174
{
177175
return -1;
178176
}

XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
55
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
6-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
6+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
77
#pragma comment(lib,"Ws2_32")
88
#endif
99
#include <stdio.h>
@@ -16,15 +16,15 @@
1616
#include <XEngine_Include/XEngine_ProtocolHdr.h>
1717
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1818
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
19-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
20-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
19+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
20+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2121
using namespace std;
2222

23-
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
23+
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
2424
//需要优先配置XEngine
2525
//WINDOWS使用VS2022 x86 debug 编译
2626
//linux使用下面的命令编译
27-
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIHelp -ljsoncpp
27+
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp
2828

2929
//查询
3030
void API_Manage_Query()
@@ -38,9 +38,9 @@ void API_Manage_Query()
3838
st_JsonRoot["lpszTimeEnd"];
3939
st_JsonRoot["lpszBuckKey"] = "storagekey2";
4040

41-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
41+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
4242
{
43-
printf("API_Manage_Query:%lX\n", APIHelp_GetLastError());
43+
printf("API_Manage_Query:%lX\n", APIClient_GetLastError());
4444
return;
4545
}
4646
printf("API_Manage_Query:%d,%s\n", nCode, ptszMsgBuffer);
@@ -66,9 +66,9 @@ void API_Manage_Insert()
6666
st_JsonRoot["List"] = st_JsonArray;
6767
st_JsonRoot["Count"] = 1;
6868

69-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
69+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
7070
{
71-
printf("API_Manage_Insert:%lX\n", APIHelp_GetLastError());
71+
printf("API_Manage_Insert:%lX\n", APIClient_GetLastError());
7272
return;
7373
}
7474
printf("API_Manage_Insert:%d,%s\n", nCode, ptszMsgBuffer);
@@ -91,9 +91,9 @@ void API_Manage_Delete()
9191
st_JsonRoot["List"] = st_JsonArray;
9292
st_JsonRoot["Count"] = 1;
9393

94-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
94+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
9595
{
96-
printf("API_Manage_Delete:%lX\n", APIHelp_GetLastError());
96+
printf("API_Manage_Delete:%lX\n", APIClient_GetLastError());
9797
return;
9898
}
9999
printf("API_Manage_Delete:%d,%s\n", nCode, ptszMsgBuffer);
@@ -111,9 +111,9 @@ void API_Manage_Dir()
111111
st_JsonRoot["lpszBuckKey"] = "storagekey1";
112112
st_JsonRoot["lpszUserDir"] = "user";
113113
st_JsonRoot["nOPerator"] = 1;
114-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
114+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
115115
{
116-
printf("API_Manage_Dir:%lX\n", APIHelp_GetLastError());
116+
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
117117
return;
118118
}
119119
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
@@ -123,9 +123,9 @@ void API_Manage_Dir()
123123
st_JsonRoot["lpszBuckKey"] = "storagekey1";
124124
st_JsonRoot["lpszUserDir"];
125125
st_JsonRoot["nOPerator"] = 0;
126-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
126+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
127127
{
128-
printf("API_Manage_Dir:%lX\n", APIHelp_GetLastError());
128+
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
129129
return;
130130
}
131131
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
@@ -135,9 +135,9 @@ void API_Manage_Dir()
135135
st_JsonRoot["lpszBuckKey"] = "storagekey1";
136136
st_JsonRoot["lpszUserDir"] = "user";
137137
st_JsonRoot["nOPerator"] = 2;
138-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
138+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
139139
{
140-
printf("API_Manage_Dir:%lX\n", APIHelp_GetLastError());
140+
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
141141
return;
142142
}
143143
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
@@ -150,9 +150,9 @@ void API_Manage_Task()
150150
int nLen = 0;
151151
int nCode = 0;
152152
TCHAR* ptszMsgBuffer = NULL;
153-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
153+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
154154
{
155-
printf("API_Manage_Task:%lX\n", APIHelp_GetLastError());
155+
printf("API_Manage_Task:%lX\n", APIClient_GetLastError());
156156
return;
157157
}
158158
printf("API_Manage_Task:%d,%s\n", nCode, ptszMsgBuffer);

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ int main(int argc, char** argv)
1313
TCHAR* ptszMsgBuffer = NULL;
1414
int nMsgLen = 0;
1515

16-
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszDownload, NULL, NULL, &ptszMsgBuffer, &nMsgLen))
16+
if (!APIClient_Http_Request(_T("GET"), lpszDownload, NULL, NULL, &ptszMsgBuffer, &nMsgLen))
1717
{
18-
printf("APIHelp_HttpRequest_Custom:%lX\n", APIHelp_GetLastError());
18+
printf("APIHelp_HttpRequest_Custom:%lX\n", APIClient_GetLastError());
1919
return 0;
2020
}
2121
string m_StrDes;
@@ -72,26 +72,27 @@ int main(int argc, char** argv)
7272
for (; stl_ListIterator != stl_ListUPDate.end(); stl_ListIterator++)
7373
{
7474
TCHAR tszPathFile[1024];
75-
NETDOWNLOAD_TASKINFO st_TaskInfo;
75+
NETHELP_FILEINFO st_TaskInfo;
7676

7777
memset(tszPathFile, '\0', sizeof(tszPathFile));
78-
memset(&st_TaskInfo, '\0', sizeof(NETDOWNLOAD_TASKINFO));
78+
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
7979

8080
_stprintf_s(tszPathFile, _T("%s%s"), stl_ListIterator->tszModulePath, stl_ListIterator->tszModuleName);
8181
_tremove(tszPathFile);
82-
XHANDLE xhDown = DownLoad_Http_Create(stl_ListIterator->tszModuleDownload, tszPathFile);
82+
XHANDLE xhDown = APIClient_File_Create(stl_ListIterator->tszModuleDownload, tszPathFile);
83+
APIClient_File_Start(xhDown);
8384
while (TRUE)
8485
{
85-
if (!DownLoad_Http_Query(xhDown, &st_TaskInfo))
86+
if (!APIClient_File_Query(xhDown, &st_TaskInfo))
8687
{
8788
break;
8889
}
89-
if (ENUM_XENGINE_DOWNLOAD_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
90+
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
9091
{
9192
break;
9293
}
9394
}
94-
DownLoad_Http_Delete(xhDown);
95+
APIClient_File_Delete(xhDown);
9596
}
9697

9798
if (!HelpModule_Api_Copy(&stl_ListUPDate))

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPHdr.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#pragma comment(lib,"Ws2_32.lib")
55
#pragma comment(lib,"../../../XEngine_Source/Debug/jsoncpp")
66
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
7-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp.lib")
8-
#pragma comment(lib,"XEngine_DownLoad/XEngine_DownLoad.lib")
7+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient.lib")
98
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib")
109
#endif
1110
#include <stdio.h>
@@ -21,10 +20,8 @@ using namespace std;
2120
#include <XEngine_Include/XEngine_Types.h>
2221
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2322
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
24-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
25-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
26-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Define.h>
27-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Error.h>
23+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
24+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2825
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
2926
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
3027
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>

XEngine_APPClient/APPClient_UPDate/APPClient_UPMaker/APPClient_UPMaker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#pragma comment(lib,"../../../XEngine_Source/Debug/jsoncpp")
77
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
88
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib")
9-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp.lib")
9+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient.lib")
1010
#endif
1111
#include <stdio.h>
1212
#include <stdlib.h>
@@ -24,8 +24,8 @@ using namespace std;
2424
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
2525
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
2626
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
27-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
28-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
27+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
28+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2929

3030
typedef struct
3131
{
@@ -203,7 +203,7 @@ int main(int argc, char** argv)
203203
}
204204
SystemApi_File_SaveBuffToFile(lpszLocalFile, ptszLocalBuffer, nLocalLen);
205205
//如果服务器支持,可以直接把更新数据提交到服务器
206-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszPostFile, ptszRemoteBuffer, NULL, NULL, &nRemoteLen))
206+
if (!APIClient_Http_Request(_T("POST"), lpszPostFile, ptszRemoteBuffer, NULL, NULL, &nRemoteLen))
207207
{
208208
printf("erron\n");
209209
}

XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
55
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
6-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
6+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
77
#pragma comment(lib,"Ws2_32")
88
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
99
#else
@@ -20,14 +20,14 @@
2020
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
2121
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
2222
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
23-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
24-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
23+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
24+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2525
using namespace std;
2626

2727
//需要优先配置XEngine
2828
//WINDOWS使用VS2022 x86 debug 编译
29-
//linux::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIHelp -ljsoncpp
30-
//macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIHelp -ljsoncpp
29+
//linux::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIClient -ljsoncpp
30+
//macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIClient -ljsoncpp
3131

3232
//上传文件
3333
void File_UPLoad()
@@ -48,9 +48,9 @@ void File_UPLoad()
4848
OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer);
4949

5050
_stprintf(tszHdrBuffer, _T("Range: bytes=0-5/10\r\nAuthorization: %s\r\n"), tszBaseBuffer);
51-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, lpszMsgBuffer, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer))
51+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, lpszMsgBuffer, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer))
5252
{
53-
printf("upload failed:%lX\n", APIHelp_GetLastError());
53+
printf("upload failed:%lX\n", APIClient_GetLastError());
5454
return;
5555
}
5656
JSONCPP_STRING st_JsonError;
@@ -69,9 +69,9 @@ void File_UPLoad()
6969
nLen = 0;
7070
memset(tszHdrBuffer, '\0', MAX_PATH);
7171
_stprintf(tszHdrBuffer, _T("Range: bytes=5-9/10\r\nAuthorization: %s\r\nStorageKey: %s\r\n"), tszBaseBuffer, tszKeyBuffer);
72-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, lpszMsgBuffer2, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer))
72+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, lpszMsgBuffer2, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer))
7373
{
74-
printf("upload failed:%lX\n", APIHelp_GetLastError());
74+
printf("upload failed:%lX\n", APIClient_GetLastError());
7575
return;
7676
}
7777
printf("upload:%d\n%s\n", nCode, ptszMsgBuffer);
@@ -92,19 +92,19 @@ void File_Download()
9292
OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer);
9393

9494
_stprintf(tszHdrBuffer, _T("Range: bytes=0-5\r\nAuthorization: %s\r\n"), tszBaseBuffer);
95-
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer))
95+
if (!APIClient_Http_Request(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer))
9696
{
97-
printf("download failed:%lX\n", APIHelp_GetLastError());
97+
printf("download failed:%lX\n", APIClient_GetLastError());
9898
return;
9999
}
100100
printf("download:%d,%s\n", nLen, ptszMsgBuffer);
101101
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
102102

103103
memset(tszHdrBuffer, '\0', MAX_PATH);
104104
_stprintf(tszHdrBuffer, _T("Range: bytes=5-10\r\nAuthorization: %s\r\n"), tszBaseBuffer);
105-
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer))
105+
if (!APIClient_Http_Request(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer))
106106
{
107-
printf("download failed:%lX\n", APIHelp_GetLastError());
107+
printf("download failed:%lX\n", APIClient_GetLastError());
108108
return;
109109
}
110110
printf("download:%d,%s\n", nLen, ptszMsgBuffer);

0 commit comments

Comments
 (0)