Skip to content

Commit ad7b490

Browse files
committed
update:machine and short link and word filter list function supported for example
1 parent 376f428 commit ad7b490

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

XEngine_APPClient/APPClient_MachineExample/APPClient_MachineExample.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@ int test_insert()
6161

6262
return 0;
6363
}
64+
int test_list()
65+
{
66+
int nLen = 0;
67+
int nCode = 0;
68+
LPCXSTR lpszAPIUrl = _X("http://127.0.0.1:5501/api?function=machine&params1=2");
69+
70+
XCHAR* ptszMsgBuffer = NULL;
71+
if (!APIClient_Http_Request(_X("POST"), lpszAPIUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
72+
{
73+
printf("发送投递失败!\n");
74+
return 0;
75+
}
76+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
77+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
78+
79+
return 0;
80+
}
6481
int test_delete()
6582
{
6683
int nLen = 0;
@@ -93,6 +110,7 @@ int main()
93110
#endif
94111
test_insert();
95112
test_insert();
113+
test_list();
96114
test_delete();
97115

98116
#ifdef _MSC_BUILD

XEngine_APPClient/APPClient_SLinkExample/APPClient_SLinkExample.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ int test_get()
6565
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
6666
return 0;
6767
}
68+
int test_List()
69+
{
70+
int nLen = 0;
71+
int nCode = 0;
72+
XCHAR* ptszMsgBuffer;
73+
74+
LPCXSTR lpszAPIUrl = _X("http://127.0.0.1:5501/api?function=slink&params1=3");
75+
if (!APIClient_Http_Request(_X("POST"), lpszAPIUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
76+
{
77+
printf("发送投递失败!\n");
78+
return 0;
79+
}
80+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
81+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
82+
return 0;
83+
}
6884
int test_delete()
6985
{
7086
int nLen = 0;
@@ -92,6 +108,7 @@ int main()
92108
#endif
93109
test_create();
94110
test_get();
111+
test_List();
95112
test_delete();
96113

97114
#ifdef _MSC_BUILD

XEngine_APPClient/APPClient_WordFilter/APPClient_WordFilter.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int test_insert()
3232

3333
Json::Value st_JsonRoot;
3434
Json::StreamWriterBuilder st_JsonBuilder;
35-
st_JsonRoot["tszWordsFrom"] = "中文";
35+
st_JsonRoot["tszWordsFrom"] = "root";
3636
st_JsonRoot["tszWordsTo"] = "user";
3737
st_JsonRoot["nLevel"] = 1;
3838

@@ -69,6 +69,23 @@ int test_query()
6969

7070
return 0;
7171
}
72+
int test_List()
73+
{
74+
int nLen = 0;
75+
int nCode = 0;
76+
LPCXSTR lpszAPIUrl = _X("http://127.0.0.1:5501/api?function=wordfilter&params1=3");
77+
78+
XCHAR* ptszMsgBuffer = NULL;
79+
if (!APIClient_Http_Request(_X("POST"), lpszAPIUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
80+
{
81+
printf("发送投递失败!\n");
82+
return 0;
83+
}
84+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
85+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
86+
87+
return 0;
88+
}
7289
int test_delete()
7390
{
7491
int nLen = 0;
@@ -98,6 +115,7 @@ int main()
98115
#endif
99116
test_insert();
100117
test_query();
118+
test_List();
101119
test_delete();
102120

103121
#ifdef _MSC_BUILD

0 commit comments

Comments
 (0)