Skip to content

Commit 5526749

Browse files
authored
Merge pull request #7 from libxengine/develop
V2.5.0.1001 Merge
2 parents dc6c7eb + 1125e65 commit 5526749

File tree

89 files changed

+2063
-725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2063
-725
lines changed

CHANGELOG

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
XEngine_APIService V2.5.0.1001
2+
3+
添加:zipcode查询功能
4+
添加:计量转换插件
5+
修改:数据库模块错误定义
6+
更新:匹配XEngine V7.42版本
7+
删除:所有回复类型1模式,现在只有返回JSON了
8+
9+
added:zipcode query
10+
added:meter convert plugin
11+
modify:error code define for db module
12+
update:match xengine v7.42
13+
delete:reply type 1 functions for bank and id and ip and language and phone and translation
14+
======================================================================================
115
XEngine_APIService V2.4.0.1001
216

317
添加:分布式锁

README.en.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and support plugin module
1818
Support privatization deployment, free, safe, open source, controllable
1919

2020
## Software feature
21-
1. support json and string stream methods to return the content of the query
21+
1. permission verication
2222
2. support ip address location information query(IPV4 and IPV6)
2323
3. support ID verification and information query
2424
4. support phone number information query
@@ -30,7 +30,7 @@ Support privatization deployment, free, safe, open source, controllable
3030
10. Password generator
3131
11. World Time Zones
3232
12. Oil price inquiry (planned)
33-
13. Administrative zip code (planned)
33+
13. Administrative zip code
3434
14. Bank card verification
3535
15. Exchange rate calculation (planned)
3636
16. QR code generation and parse (planned)
@@ -40,6 +40,8 @@ Support privatization deployment, free, safe, open source, controllable
4040
20. Metering Conversion
4141
21. CDKey Creator
4242
22. Distributed lock
43+
23. short url creator
44+
24. local system time
4345

4446
## install
4547

@@ -59,7 +61,8 @@ use vs open and compile,suport windows 7sp1 and above
5961
Just Run it
6062

6163
#### Linux
62-
install opencc,ubuntu:sudo apt install libopencc-dev,centos:compile by self
64+
install opencc,ubuntu:sudo apt install libopencc-dev
65+
centos:compile by self
6366
use makefile compile,UBUNTU20.04 x64 or CENTOS8 x64
6467
Run it on the terminal
6568

@@ -106,7 +109,7 @@ Address:app.xyry.org,Port:5501
106109
#### example
107110
For more information please refer to the documentation
108111
phone information query
109-
api:http://app.xyry.org:5501/api?function=phone&params1=13699439999&params2=0
112+
api:http://app.xyry.org:5501/api?function=phone&params1=13699439999
110113
```json
111114
{
112115
"code":0,
@@ -121,7 +124,7 @@ api:http://app.xyry.org:5501/api?function=phone&params1=13699439999&params2=0
121124
}
122125
```
123126
ip address information
124-
api:http://app.xyry.org:5501/api?function=ip&params1=1.29.164.255&params2=0
127+
api:http://app.xyry.org:5501/api?function=ip&params1=1.29.164.255
125128
```json
126129
{
127130
"code":0,
@@ -141,7 +144,7 @@ api:http://app.xyry.org:5501/api?function=ip&params1=1.29.164.255&params2=0
141144
}
142145
```
143146
id information query
144-
api:http://app.xyry.org:5501/api?function=id&params1=511025198800000000&params2=0
147+
api:http://app.xyry.org:5501/api?function=id&params1=511025198800000000
145148
```json
146149
{
147150
"code":0,
@@ -161,7 +164,7 @@ api:http://app.xyry.org:5501/api?function=id&params1=511025198800000000&params2=
161164
}
162165
```
163166
bank card ver
164-
api:http://app.xyry.org:5501/api?function=bank&params1=6214832830000000&params2=0
167+
api:http://app.xyry.org:5501/api?function=bank&params1=6214832830000000
165168
```json
166169
{
167170
"code":0,
@@ -175,7 +178,7 @@ api:http://app.xyry.org:5501/api?function=bank&params1=6214832830000000&params2=
175178
}
176179
```
177180
language
178-
api:http://app.xyry.org:5501/api?function=language&params1=简体到繁体&params2=0&params3=1
181+
api:http://app.xyry.org:5501/api?function=language&params1=简体到繁体&params2=1
179182
```json
180183
{
181184
"code":0,
@@ -188,7 +191,7 @@ api:http://app.xyry.org:5501/api?function=language&params1=简体到繁体&param
188191
}
189192
```
190193
translation
191-
api:http://app.xyry.org:5501/api?function=translation&params1=中国&params2=0&params3=0
194+
api:http://app.xyry.org:5501/api?function=translation&params1=中国&params2=0
192195
```json
193196
{
194197
"code":0,

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ c c++ interface api service
1818

1919

2020
## 软件特性
21-
1. 支持JSON和字符串流方式返回查询的内容
21+
1. 权限验证
2222
2. 支持IP地址位置信息查询(IPV4和IPV6)
2323
3. 支持身份证校验与信息查询
2424
4. 支持手机号信息归属查询
@@ -30,16 +30,18 @@ c c++ interface api service
3030
10. 密码生成器
3131
11. 世界时区
3232
12. 油价查询(计划中)
33-
13. 行政邮编(计划中)
33+
13. 行政邮编
3434
14. 银行卡验证
3535
15. 汇率计算(计划中)
3636
16. 二维码生成解析(计划中)
3737
17. 简繁转换
3838
18. 二十四节气(计划中)
3939
19. 新华词典
40-
20. 计量转换(计划中)
40+
20. 计量转换
4141
21. CDKey创建支持
4242
22. 分布式锁API
43+
23. 短连接生成
44+
24. 本地标准时间
4345

4446
## 安装教程
4547

@@ -59,7 +61,8 @@ macos执行:./XEngine_LINEnv.sh -i 3
5961
直接运行即可
6062

6163
#### Linux
62-
安装opencc,ubuntu:sudo apt install libopencc-dev,centos:需要自己编译
64+
安装opencc,ubuntu:sudo apt install libopencc-dev
65+
centos:需要自己编译
6366
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
6467
在控制台运行
6568

@@ -104,7 +107,7 @@ make FLAGS=CleanAll 清理编译
104107
#### 测试接口示例
105108
更多内容请参考文档
106109
手机信息查询
107-
接口:http://app.xyry.org:5501/api?function=phone&params1=13699439999&params2=0
110+
接口:http://app.xyry.org:5501/api?function=phone&params1=13699439999
108111
```json
109112
{
110113
"code":0,
@@ -119,7 +122,7 @@ make FLAGS=CleanAll 清理编译
119122
}
120123
```
121124
IP地址查询
122-
接口:http://app.xyry.org:5501/api?function=ip&params1=1.29.164.255&params2=0
125+
接口:http://app.xyry.org:5501/api?function=ip&params1=1.29.164.255
123126
```json
124127
{
125128
"code":0,
@@ -139,7 +142,7 @@ IP地址查询
139142
}
140143
```
141144
身份证查询
142-
接口:http://app.xyry.org:5501/api?function=id&params1=511025198800000000&params2=0
145+
接口:http://app.xyry.org:5501/api?function=id&params1=511025198800000000
143146
```json
144147
{
145148
"code":0,
@@ -159,7 +162,7 @@ IP地址查询
159162
}
160163
```
161164
银行卡验证
162-
接口:http://app.xyry.org:5501/api?function=bank&params1=6214832830000000&params2=0
165+
接口:http://app.xyry.org:5501/api?function=bank&params1=6214832830000000
163166
```json
164167
{
165168
"code":0,
@@ -173,7 +176,7 @@ IP地址查询
173176
}
174177
```
175178
语言转换
176-
接口:http://app.xyry.org:5501/api?function=language&params1=简体到繁体&params2=0&params3=1
179+
接口:http://app.xyry.org:5501/api?function=language&params1=简体到繁体&params2=1
177180
```json
178181
{
179182
"code":0,
@@ -186,7 +189,7 @@ IP地址查询
186189
}
187190
```
188191
翻译
189-
接口:http://app.xyry.org:5501/api?function=translation&params1=中国&params2=0&params3=0
192+
接口:http://app.xyry.org:5501/api?function=translation&params1=中国&params2=0
190193
```json
191194
{
192195
"code":0,

XEngine_APPClient/APPClient_BankExample/APPClient_BankExample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main()
3131
TCHAR* ptszMsgBuffer = NULL;
3232
LPCTSTR lpszUrl = _T("http://127.0.0.1:5501/api?function=bank&params1=6214111100184841&params2=0");
3333

34-
if (!APIHelp_HttpRequest_Get(lpszUrl, &ptszMsgBuffer, &nLen))
34+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

XEngine_APPClient/APPClient_CDKeyExample/APPClient_CDKeyExample.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int main()
6363

6464
TCHAR* ptszCreateBuffer = NULL;
6565
TCHAR* ptszAuthBuffer = NULL;
66-
if (!APIHelp_HttpRequest_Post(lpszCreateUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszCreateBuffer, &nLen))
66+
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszCreateUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszCreateBuffer, &nLen))
6767
{
6868
printf("发送投递失败!\n");
6969
return 0;
@@ -77,7 +77,7 @@ int main()
7777
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszCreateBuffer);
7878

7979
LPCTSTR lpszAuthUrl = _T("http://127.0.0.1:5501/api?function=cdkey&params1=1&params2=123123");
80-
if (!APIHelp_HttpRequest_Post(lpszAuthUrl, tszMsgBuffer, &nCode, &ptszAuthBuffer, &nLen))
80+
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszAuthUrl, tszMsgBuffer, &nCode, &ptszAuthBuffer, &nLen))
8181
{
8282
printf("发送投递失败!\n");
8383
return 0;

XEngine_APPClient/APPClient_IDExample/APPClient_IDExample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main()
3131
TCHAR* ptszMsgBuffer = NULL;
3232
LPCTSTR lpszUrl = _T("http://127.0.0.1:5501/api?function=id&params1=511025191101018792&params2=0");
3333

34-
if (!APIHelp_HttpRequest_Get(lpszUrl, &ptszMsgBuffer, &nLen))
34+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

XEngine_APPClient/APPClient_IPExample/APPClient_IPExample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main()
3131
TCHAR* ptszMsgBuffer = NULL;
3232
LPCTSTR lpszUrl = _T("http://127.0.0.1:5501/api?function=ip&params1=1.29.164.255&params2=0");
3333

34-
if (!APIHelp_HttpRequest_Get(lpszUrl, &ptszMsgBuffer, &nLen))
34+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

XEngine_APPClient/APPClient_LanguageExample/APPClient_LanguageExample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main()
3131
TCHAR* ptszMsgBuffer = NULL;
3232
LPCTSTR lpszUrl = _T("http://127.0.0.1:5501/api?function=language&params1=简体&params2=0&param3=1");
3333

34-
if (!APIHelp_HttpRequest_Get(lpszUrl, &ptszMsgBuffer, &nLen))
34+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

XEngine_APPClient/APPClient_LockExample/APPClient_LockExample.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main()
3131
LPCTSTR lpszOPenUrl = _T("http://127.0.0.1:5501/api?function=lock&params1=1000106561&params1=1");
3232
//自己创建打开
3333
TCHAR* ptszBuffer = NULL;
34-
if (!APIHelp_HttpRequest_Get(lpszOPenUrl, &ptszBuffer, &nLen))
34+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszOPenUrl, NULL, NULL, &ptszBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;
@@ -40,7 +40,7 @@ int main()
4040
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer);
4141
//打开读锁
4242
LPCTSTR lpszReadUrl = _T("http://127.0.0.1:5501/api?function=lock&params1=1000106561&params2=3");
43-
if (!APIHelp_HttpRequest_Get(lpszReadUrl, &ptszBuffer, &nLen))
43+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszReadUrl, NULL, NULL, &ptszBuffer, &nLen))
4444
{
4545
printf("发送投递失败!\n");
4646
return 0;
@@ -49,7 +49,7 @@ int main()
4949
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer);
5050
//打开写锁
5151
LPCTSTR lpszWriteUrl = _T("http://127.0.0.1:5501/api?function=lock&params1=1000106561&params2=5");
52-
if (!APIHelp_HttpRequest_Get(lpszWriteUrl, &ptszBuffer, &nLen))
52+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszWriteUrl, NULL, NULL, &ptszBuffer, &nLen))
5353
{
5454
printf("发送投递失败!\n");
5555
return 0;
@@ -58,15 +58,15 @@ int main()
5858
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer);
5959
//释放读锁
6060
LPCTSTR lpszUNReadUrl = _T("http://127.0.0.1:5501/api?function=lock&params1=1000106561&params2=4");
61-
if (!APIHelp_HttpRequest_Get(lpszUNReadUrl, &ptszBuffer, &nLen))
61+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszUNReadUrl, NULL, NULL, &ptszBuffer, &nLen))
6262
{
6363
printf("发送投递失败!\n");
6464
return 0;
6565
}
6666
printf("接受到数据,大小:%d,内容:\n%s\n", nLen, ptszBuffer);
6767
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer);
6868
//打开解锁
69-
if (!APIHelp_HttpRequest_Get(lpszWriteUrl, &ptszBuffer, &nLen))
69+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszWriteUrl, NULL, NULL, &ptszBuffer, &nLen))
7070
{
7171
printf("发送投递失败!\n");
7272
return 0;
@@ -75,7 +75,7 @@ int main()
7575
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBuffer);
7676
//关闭
7777
LPCTSTR lpszCloseUrl = _T("http://127.0.0.1:5501/api?function=lock&params1=1000106561&params2=2");
78-
if (!APIHelp_HttpRequest_Get(lpszCloseUrl, &ptszBuffer, &nLen))
78+
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszCloseUrl, NULL, NULL, &ptszBuffer, &nLen))
7979
{
8080
printf("发送投递失败!\n");
8181
return 0;

XEngine_APPClient/APPClient_P2PExample/APPClient_P2PExample.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int APPClient_P2XPLogin()
6767
int nMsgLen = 0;
6868
int nHTTPCode = 0;
6969
TCHAR* ptszMsgBuffer = NULL;
70-
if (!APIHelp_HttpRequest_Post(lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
70+
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
7171
{
7272
return -1;
7373
}
@@ -88,7 +88,7 @@ int APPClient_P2XPList()
8888
int nMsgLen = 0;
8989
int nHTTPCode = 0;
9090
TCHAR* ptszMsgBuffer = NULL;
91-
if (!APIHelp_HttpRequest_Post(lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
91+
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
9292
{
9393
return -1;
9494
}
@@ -109,7 +109,7 @@ int APPClient_P2XPGetUser()
109109
int nMsgLen = 0;
110110
int nHTTPCode = 0;
111111
TCHAR* ptszMsgBuffer = NULL;
112-
if (!APIHelp_HttpRequest_Post(lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
112+
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
113113
{
114114
return -1;
115115
}
@@ -130,7 +130,7 @@ int APPClient_P2XPConnect()
130130
int nMsgLen = 0;
131131
int nHTTPCode = 0;
132132
TCHAR* ptszMsgBuffer = NULL;
133-
if (!APIHelp_HttpRequest_Post(lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
133+
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszAddr, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBuffer, &nMsgLen))
134134
{
135135
return -1;
136136
}

0 commit comments

Comments
 (0)