Skip to content

Commit fcb765c

Browse files
authored
Merge pull request #10 from libxengine/develop
V2.7.0.1001 Merge
2 parents 4429baf + 3a3d301 commit fcb765c

File tree

123 files changed

+10748
-1502
lines changed

Some content is hidden

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

123 files changed

+10748
-1502
lines changed

CHANGELOG

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
XEngine_APIService V2.7.0.1001
2+
3+
增加:日志信息操作API相关函数
4+
增加:时间信息获取lua脚本
5+
优化:扩展了HTTP参数缓存大小
6+
优化:HTTP请求函数
7+
修改:ip查询功能修改为模块插件
8+
修改:电话查询功能修改为模块插件
9+
修改:数据库从SQLITE改为MYSQL
10+
修正:id和银行查询打包中文不正确的问题
11+
删除:cdkey相关API函数库
12+
删除:SQLITE相关代码
13+
14+
added:log info support
15+
added:time plugin of lua
16+
improved:extend http parament cache size
17+
improved:http request function
18+
modify:ipaddr query modify to plugin of module
19+
modify:phone number query modify to plugin of module
20+
modify:database to mysql from sqlite
21+
fixed:id and bank query packet chinese is incorrent
22+
delete:cdkey functions
23+
delete:sqlite db
24+
======================================================================================
125
XEngine_APIService V2.6.1.1001
226

327
修正:在linux系统下无法加载模块插件的问题

COPYRIGHT

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
the open source software depend on the following libraries, please note the copyright
22
XEngine:https://gitee.com/xyry/libxengine or https://github.com/libxengine/xengine
33
jsoncpp:https://github.com/open-source-parsers/jsoncpp
4-
opencc:https://github.com/BYVoid/OpenCC
4+
opencc:https://github.com/BYVoid/OpenCC
5+
6+
data sources:
7+
IP:https://github.com/lionsoul2014/ip2region
8+
Phone:https://github.com/xluohome/phonedata

README.en.md

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Support privatization deployment, free, safe, open source, controllable
1919

2020
## Software feature
2121
1. permission verication
22-
2. support ip address location information query(IPV4 and IPV6)
22+
2. support ip address location information query
2323
3. support ID verification and information query
2424
4. support phone number information query
2525
5. Weather forecast (planned)
@@ -40,10 +40,11 @@ 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
43+
23. short url creator(planned)
4444
24. local system time
4545
25. math Calculation
46-
26. log service(plan)
46+
26. log service
47+
27. Plugin hot reload(planned)
4748

4849
## install
4950

@@ -58,13 +59,17 @@ window Exection XEngine_WINEnv.bat
5859
Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
5960
Macos Exection:./XEngine_LINEnv.sh -i 3
6061

62+
#### Database Env
63+
MYSQL database version 8.0 or above is required. Create a table through CreateDatabase.sql, and then import the table with XEngine_APIInfo.sql
64+
Modify the database configuration in XSQL in the configuration file to your
65+
6166
#### Windows
6267
need to vcpkg configure third-part env.refer vcpkg install guide.after installed and execution:vcpkg.exe install lua lua:x64-windows opencc opencc:x64-windows
6368
use vs open and compile,suport windows 7sp1 and above
6469
Just Run it
6570

6671
#### Linux
67-
install opencc,ubuntu:sudo apt install libopencc-dev
72+
ubuntu:sudo apt install libopencc-dev
6873
centos:compile by self
6974
use makefile compile,UBUNTU20.04 x64 or CENTOS8 x64
7075
Run it on the terminal
@@ -111,41 +116,6 @@ You can refer to the document under the docment directory. It contains API proto
111116
Address:app.xyry.org,Port:5501
112117
#### example
113118
For more information please refer to the documentation
114-
phone information query
115-
api:http://app.xyry.org:5501/api?function=phone&params1=13699439999
116-
```json
117-
{
118-
"code":0,
119-
"data":{
120-
"nAreaCode":28,
121-
"nPhoneNumber":13699439999,
122-
"nZipCode":610000,
123-
"tszCity":"成都",
124-
"tszProvincer":"四川"
125-
},
126-
"msg":"success"
127-
}
128-
```
129-
ip address information
130-
api:http://app.xyry.org:5501/api?function=ip&params1=1.29.164.255
131-
```json
132-
{
133-
"code":0,
134-
"data":{
135-
"tszIPAddr":"1.29.164.255",
136-
"tszIPAddress":"内蒙古通辽市霍林郭勒市",
137-
"tszIPCity":"通辽市",
138-
"tszIPCountry":"中国",
139-
"tszIPCounty":"霍林郭勒市",
140-
"tszIPEnd":"1.29.164.255",
141-
"tszIPISP":"联通",
142-
"tszIPProvince":"内蒙古",
143-
"tszIPStart":"1.29.164.0",
144-
"tszIPTime":"2021-11-03 07:33:50"
145-
},
146-
"msg":"success"
147-
}
148-
```
149119
id information query
150120
api:http://app.xyry.org:5501/api?function=id&params1=511025198800000000
151121
```json

README.md

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ c c++ interface api service
1919

2020
## 软件特性
2121
1. 权限验证
22-
2. 支持IP地址位置信息查询(IPV4和IPV6)
22+
2. 支持IP地址位置信息查询
2323
3. 支持身份证校验与信息查询
2424
4. 支持手机号信息归属查询
2525
5. 天气预报(计划中)
@@ -40,10 +40,11 @@ c c++ interface api service
4040
20. 计量转换
4141
21. CDKey创建支持
4242
22. 分布式锁API
43-
23. 短连接生成
43+
23. 短连接生成(计划中)
4444
24. 本地标准时间
4545
25. 数学计算
46-
26. 日志服务(计划中)
46+
26. 日志服务
47+
27. 插件脚本热重载(计划中)
4748

4849
## 安装教程
4950

@@ -58,13 +59,17 @@ window执行XEngine_WINEnv.bat 脚本.
5859
Linux执行:sudo ./XEngine_LINEnv.sh -i 3
5960
macos执行:./XEngine_LINEnv.sh -i 3
6061

62+
#### 数据库环境
63+
需要MYSQL数据库8.0以上版本.通过CreateDatabase.sql创建表,然后XEngine_APIInfo.sql导入表
64+
修改配置文件里面XSQL里面的数据库配置为你的
65+
6166
#### Windows
6267
需要vcpkg配置第三方环境,具体参考vcpkg安装方式,安装好后执行:vcpkg.exe install lua lua:x64-windows opencc opencc:x64-windows
6368
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
6469
直接运行即可
6570

6671
#### Linux
67-
安装opencc,ubuntu:sudo apt install liblua5.3-dev libopencc-dev
72+
ubuntu:sudo apt install liblua5.3-dev libopencc-dev
6873
centos:需要自己编译
6974
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
7075
在控制台运行
@@ -109,41 +114,6 @@ make FLAGS=CleanAll 清理编译
109114

110115
#### 测试接口示例
111116
更多内容请参考文档
112-
手机信息查询
113-
接口:http://app.xyry.org:5501/api?function=phone&params1=13699439999
114-
```json
115-
{
116-
"code":0,
117-
"data":{
118-
"nAreaCode":28,
119-
"nPhoneNumber":13699439999,
120-
"nZipCode":610000,
121-
"tszCity":"成都",
122-
"tszProvincer":"四川"
123-
},
124-
"msg":"success"
125-
}
126-
```
127-
IP地址查询
128-
接口:http://app.xyry.org:5501/api?function=ip&params1=1.29.164.255
129-
```json
130-
{
131-
"code":0,
132-
"data":{
133-
"tszIPAddr":"1.29.164.255",
134-
"tszIPAddress":"内蒙古通辽市霍林郭勒市",
135-
"tszIPCity":"通辽市",
136-
"tszIPCountry":"中国",
137-
"tszIPCounty":"霍林郭勒市",
138-
"tszIPEnd":"1.29.164.255",
139-
"tszIPISP":"联通",
140-
"tszIPProvince":"内蒙古",
141-
"tszIPStart":"1.29.164.0",
142-
"tszIPTime":"2021-11-03 07:33:50"
143-
},
144-
"msg":"success"
145-
}
146-
```
147117
身份证查询
148118
接口:http://app.xyry.org:5501/api?function=id&params1=511025198800000000
149119
```json

XEngine_APPClient/APPClient_BankExample/APPClient_BankExample.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"Ws2_32")
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
#endif
88
#include <stdio.h>
99
#include <stdlib.h>
@@ -13,13 +13,13 @@
1313
#include <XEngine_Include/XEngine_ProtocolHdr.h>
1414
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1515
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
16-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
17-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
16+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
17+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
1818

1919
//需要优先配置XEngine
2020
//WINDOWS支持VS2022 x64 debug 编译调试
2121
//linux使用下面的命令编译
22-
//g++ -std=c++17 -Wall -g APPClient_BankExample.cpp -o APPClient_BankExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp
22+
//g++ -std=c++17 -Wall -g APPClient_BankExample.cpp -o APPClient_BankExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient
2323

2424
int main()
2525
{
@@ -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_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
34+
if (!APIClient_Http_Request(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

XEngine_APPClient/APPClient_CDKeyExample/APPClient_CDKeyExample.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma comment(lib,"jsoncpp")
66
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
77
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
8-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
8+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
99
#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_Authorize")
1010
#endif
1111
#include <stdio.h>
@@ -19,15 +19,15 @@
1919
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
2020
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
2121
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
22-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
23-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
22+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
23+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2424
#include <XEngine_Include/XEngine_HelpComponents/Authorize_Define.h>
2525
#include <XEngine_Include/XEngine_HelpComponents/Authorize_Error.h>
2626

2727
//需要优先配置XEngine
2828
//WINDOWS支持VS2022 x64 debug 编译调试
29-
//linux::g++ -std=c++17 -Wall -g APPClient_CDKeyExample.cpp -o APPClient_CDKeyExample.exe -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 /usr/local/lib/XEngine_Release/XEngine_HelpComponents -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIHelp -lHelpComponents_Authorize
30-
//macos::g++ -std=c++17 -Wall -g APPClient_CDKeyExample.cpp -o APPClient_CDKeyExample.exe -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIHelp -lHelpComponents_Authorize
29+
//linux::g++ -std=c++17 -Wall -g APPClient_CDKeyExample.cpp -o APPClient_CDKeyExample.exe -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 /usr/local/lib/XEngine_Release/XEngine_HelpComponents -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIClient -lHelpComponents_Authorize
30+
//macos::g++ -std=c++17 -Wall -g APPClient_CDKeyExample.cpp -o APPClient_CDKeyExample.exe -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIClient -lHelpComponents_Authorize
3131

3232
int main()
3333
{
@@ -63,7 +63,7 @@ int main()
6363

6464
TCHAR* ptszCreateBuffer = NULL;
6565
TCHAR* ptszAuthBuffer = NULL;
66-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszCreateUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszCreateBuffer, &nLen))
66+
if (!APIClient_Http_Request(_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_Custom(_T("POST"), lpszAuthUrl, tszMsgBuffer, &nCode, &ptszAuthBuffer, &nLen))
80+
if (!APIClient_Http_Request(_T("POST"), lpszAuthUrl, tszMsgBuffer, &nCode, &ptszAuthBuffer, &nLen))
8181
{
8282
printf("发送投递失败!\n");
8383
return 0;

XEngine_APPClient/APPClient_IDExample/APPClient_IDExample.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"Ws2_32")
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
#endif
88
#include <stdio.h>
99
#include <stdlib.h>
@@ -13,13 +13,13 @@
1313
#include <XEngine_Include/XEngine_ProtocolHdr.h>
1414
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1515
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
16-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
17-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
16+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
17+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
1818

1919
//需要优先配置XEngine
2020
//WINDOWS支持VS2022 x64 debug 编译调试
2121
//linux使用下面的命令编译
22-
//g++ -std=c++17 -Wall -g APPClient_IDExample.cpp -o APPClient_IDExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp
22+
//g++ -std=c++17 -Wall -g APPClient_IDExample.cpp -o APPClient_IDExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient
2323

2424
int main()
2525
{
@@ -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_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
34+
if (!APIClient_Http_Request(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

XEngine_APPClient/APPClient_IPExample/APPClient_IPExample.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"Ws2_32")
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
#endif
88
#include <stdio.h>
99
#include <stdlib.h>
@@ -13,13 +13,13 @@
1313
#include <XEngine_Include/XEngine_ProtocolHdr.h>
1414
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1515
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
16-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
17-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
16+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
17+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
1818

1919
//需要优先配置XEngine
2020
//WINDOWS支持VS2022 x64 debug 编译调试
2121
//linux使用下面的命令编译
22-
//g++ -std=c++17 -Wall -g APPClient_IPExample.cpp -o APPClient_IPExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp
22+
//g++ -std=c++17 -Wall -g APPClient_IPExample.cpp -o APPClient_IPExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient
2323

2424
int main()
2525
{
@@ -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_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
34+
if (!APIClient_Http_Request(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

XEngine_APPClient/APPClient_LanguageExample/APPClient_LanguageExample.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"Ws2_32")
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
#endif
88
#include <stdio.h>
99
#include <stdlib.h>
@@ -13,13 +13,13 @@
1313
#include <XEngine_Include/XEngine_ProtocolHdr.h>
1414
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1515
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
16-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
17-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
16+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
17+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
1818

1919
//需要优先配置XEngine
2020
//WINDOWS支持VS2022 x64 debug 编译调试
2121
//linux使用下面的命令编译
22-
//g++ -std=c++17 -Wall -g APPClient_LanguageExample.cpp -o APPClient_LanguageExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp
22+
//g++ -std=c++17 -Wall -g APPClient_LanguageExample.cpp -o APPClient_LanguageExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient
2323

2424
int main()
2525
{
@@ -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_Custom(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
34+
if (!APIClient_Http_Request(_T("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen))
3535
{
3636
printf("发送投递失败!\n");
3737
return 0;

0 commit comments

Comments
 (0)