Skip to content

Commit 0dd1d41

Browse files
authored
Merge pull request #5 from libxengine/develop
V2.3.0.1001 Merge
2 parents 1ce5b34 + 73f3475 commit 0dd1d41

File tree

80 files changed

+2808
-139
lines changed

Some content is hidden

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

80 files changed

+2808
-139
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.3.0.1001
2+
3+
添加:服务器能力查询接口函数
4+
添加:bmi模块
5+
添加:时区插件
6+
更新:支持XENGINE V7.38版本了
7+
修改:支持MACOS系统了
8+
修改:插件支持负载内容参数了
9+
修改:现在打印xengine版本了
10+
修正:程序退出时候崩溃
11+
修正:构建错误
12+
删除:libopencc的linux模块,需要自己安装
13+
14+
added:server option supported
15+
added:bmi module
16+
added:timezone plugin module
17+
update:match xengine v7.38
18+
modify:support macos now
19+
modify:plugin support payload parament
20+
modify:printf xengine version now
21+
fixed:app exist crashed.
22+
fixed:build error
23+
delete:libopencc for linux module,install byself
24+
======================================================================================
125
XEngine_APIService V2.2.0.1001
226

327
添加:为p2p处理增加post方法

README.en.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ You can use this code to implement your own information query service, which sup
1313
The purpose of development and implementation based on libXEngine is a cross-platform network storage service
1414
and support plugin module
1515

16+
#### Why choose us
17+
18+
Support privatization deployment, free, safe, open source, controllable
19+
1620
## Software feature
1721
1. support json and string stream methods to return the content of the query
1822
2. support ip address location information query(IPV4 and IPV6)
@@ -21,10 +25,10 @@ and support plugin module
2125
5. Weather forecast (planned)
2226
6. Lunar calendar conversion (planning)
2327
7. News headlines (planned)
24-
8. Standard height and weight (planned)
28+
8. Standard height and weight
2529
9. Zodiac Constellation
2630
10. Password generator
27-
11. World Time Zones (planned)
31+
11. World Time Zones
2832
12. Oil price inquiry (planned)
2933
13. Administrative zip code (planned)
3034
14. Bank card verification
@@ -39,20 +43,30 @@ and support plugin module
3943

4044
## install
4145

42-
#### Requirements
43-
support system above windows 7sp1 and linux(ubuntu20.04,centos8)
44-
XEngine need V7.30 or above
46+
#### XEngine Evn
47+
you must install XEngine,need V7.38 or above,install XEngine can be refer to xengine Readme docment
48+
GITEE:https://gitee.com/xyry/libxengine
49+
GITHUB:https://github.com/libxengine/xengine
4550

46-
#### Windows
47-
use vs open and complie
48-
You need to configure the environment in the following way, otherwise you may need to set the library directory in the project yourself
51+
##### fast to deployment
52+
git clone https://gitee.com/xyry/libxengine.git or git clone https://github.com/libxengine/xengine.git
53+
window Exection XEngine_WINEnv.bat
54+
Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
55+
Macos Exection:./XEngine_LINEnv.sh -i 3
4956

50-
##### XEngine
51-
download xengine through git.read xengine project readme file to configure your env
57+
#### Windows
58+
use vs open and compile,suport windows 7sp1 and above
59+
Just Run it
5260

5361
#### Linux
54-
Linux use Makefile to complie
55-
supproted ubuntu x64 or centos x64
62+
install opencc,ubuntu:sudo apt install libopencc-dev,centos:compile by self
63+
use makefile compile,UBUNTU20.04 x64 or CENTOS8 x64
64+
Run it on the terminal
65+
66+
#### Macos
67+
install opencc:brew install opencc
68+
use makefile compile,mac 12 and above
69+
Run it on the terminal
5670

5771
##### complie
5872
execute command in XEngine_Source path
@@ -79,8 +93,10 @@ make FLAGS=CleanAll clear
7993
You can refer to the project under XEngine_PluginModule to write the plugin
8094
The written plugin needs to be configured via JSON to be enabled
8195

82-
## now task
96+
## Test Server
97+
Address:app.xyry.org,Port:5501
8398

99+
## now task
84100

85101
## other problems
86102
You can refer to the document under the docment directory. It contains API protocol and service description.

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ c c++ interface api service
1313
基于libXEngine开发并实现的一套简洁高性能跨平台接口服务
1414
并且支持模块插件
1515

16+
#### 为什么选择我们
17+
支持私有化部署,免费,安全.开源,可控
18+
19+
1620
## 软件特性
1721
1. 支持JSON和字符串流方式返回查询的内容
1822
2. 支持IP地址位置信息查询(IPV4和IPV6)
@@ -21,10 +25,10 @@ c c++ interface api service
2125
5. 天气预报(计划中)
2226
6. 农历公历转换(计划中)
2327
7. 新闻头条(计划中)
24-
8. 标准身高体重(计划中)
28+
8. 标准身高体重
2529
9. 生肖星座
2630
10. 密码生成器
27-
11. 世界时区(计划中)
31+
11. 世界时区
2832
12. 油价查询(计划中)
2933
13. 行政邮编(计划中)
3034
14. 银行卡验证
@@ -39,20 +43,30 @@ c c++ interface api service
3943

4044
## 安装教程
4145

42-
#### 版本需求
43-
支持WINDOWS 7SP1和LINUX(UBUNT20.04,CENTOS8)以上系统
44-
XEngine版本需要V7.30或者以上版本
46+
#### XEngine环境
47+
必须安装XEngine,版本需要V7.38或者以上版本,安装XEngine可以参考其Readme文档
48+
GITEE:https://gitee.com/xyry/libxengine
49+
GITHUB:https://github.com/libxengine/xengine
4550

46-
#### Windows
47-
使用VS打开并且编译
48-
你需要按照下面的方式配置环境,不然你可能需要自己在项目中设置库目录
51+
###### 快速部署
52+
git clone https://gitee.com/xyry/libxengine.git 或者 git clone https://github.com/libxengine/xengine.git
53+
window执行XEngine_WINEnv.bat 脚本.
54+
Linux执行:sudo ./XEngine_LINEnv.sh -i 3
55+
macos执行:./XEngine_LINEnv.sh -i 3
4956

50-
##### XEngine环境
51-
XEngine通过GIT下载,参考XEngine项目的readme配置环境
57+
#### Windows
58+
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
59+
直接运行即可
5260

5361
#### Linux
54-
Linux使用Makefile编译
55-
UBUNTU20.04 x64或者CENTOS8 x64均可
62+
安装opencc,ubuntu:sudo apt install libopencc-dev,centos:需要自己编译
63+
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
64+
在控制台运行
65+
66+
#### Macos
67+
安装opencc,执行命令:brew install opencc
68+
使用makefile编译,控制台运行,需要mac 12以及以上版本
69+
在控制台运行
5670

5771
##### 编译命令
5872
在XEngine_Source目录下执行命令
@@ -86,6 +100,7 @@ make FLAGS=CleanAll 清理编译
86100

87101
## 测试服务器
88102
地址:app.xyry.org,端口:5501
103+
89104
#### 测试接口示例
90105
更多内容请参考文档
91106
手机信息查询
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#ifdef _MSC_BUILD
2+
#include <Windows.h>
3+
#include <tchar.h>
4+
#pragma comment(lib,"Ws2_32")
5+
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
6+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
7+
#endif
8+
#include <stdio.h>
9+
#include <stdlib.h>
10+
#include <string.h>
11+
#include <inttypes.h>
12+
#include <XEngine_Include/XEngine_CommHdr.h>
13+
#include <XEngine_Include/XEngine_ProtocolHdr.h>
14+
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
15+
#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>
18+
19+
//需要优先配置XEngine
20+
//WINDOWS支持VS2022 x64 debug 编译调试
21+
//linux::g++ -std=c++17 -Wall -g APPClient_PluginExample.cpp -o APPClient_PluginExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp
22+
//macos::g++ -std=c++17 -Wall -g APPClient_PluginExample.cpp -o APPClient_PluginExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp
23+
24+
int main()
25+
{
26+
#ifdef _MSC_BUILD
27+
WSADATA st_WSAData;
28+
WSAStartup(MAKEWORD(2, 2), &st_WSAData);
29+
#endif
30+
int nLen = 0;
31+
TCHAR* ptszMsgBuffer = NULL;
32+
LPCTSTR lpszPassUrl = _T("http://127.0.0.1:5501/api?function=pass&params1=1&params2=4");
33+
if (!APIHelp_HttpRequest_Get(lpszPassUrl, &ptszMsgBuffer, &nLen))
34+
{
35+
printf("发送投递失败!\n");
36+
return 0;
37+
}
38+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
39+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
40+
41+
LPCTSTR lpszZodiacUrl = _T("http://127.0.0.1:5501/api?function=zodiac&params1=19880121");
42+
if (!APIHelp_HttpRequest_Get(lpszZodiacUrl, &ptszMsgBuffer, &nLen))
43+
{
44+
printf("发送投递失败!\n");
45+
return 0;
46+
}
47+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
48+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
49+
50+
LPCTSTR lpszTimeUrl = _T("http://127.0.0.1:5501/api?function=timezone&params1=1&params2=1-20");
51+
if (!APIHelp_HttpRequest_Get(lpszTimeUrl, &ptszMsgBuffer, &nLen))
52+
{
53+
printf("发送投递失败!\n");
54+
return 0;
55+
}
56+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
57+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
58+
59+
LPCTSTR lpszBmiUrl = _T("http://127.0.0.1:5501/api?function=bmindex&params1=1.78&params2=62");
60+
if (!APIHelp_HttpRequest_Get(lpszBmiUrl, &ptszMsgBuffer, &nLen))
61+
{
62+
printf("发送投递失败!\n");
63+
return 0;
64+
}
65+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
66+
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
67+
#ifdef _MSC_BUILD
68+
WSACleanup();
69+
#endif
70+
return 0;
71+
}
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>16.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{81b29f95-d383-437f-ad34-11e1f3b6eae5}</ProjectGuid>
25+
<RootNamespace>APPClientPluginExample</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>MultiByte</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
74+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
76+
</PropertyGroup>
77+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
78+
<ClCompile>
79+
<WarningLevel>Level3</WarningLevel>
80+
<SDLCheck>true</SDLCheck>
81+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
82+
<ConformanceMode>true</ConformanceMode>
83+
</ClCompile>
84+
<Link>
85+
<SubSystem>Console</SubSystem>
86+
<GenerateDebugInformation>true</GenerateDebugInformation>
87+
</Link>
88+
</ItemDefinitionGroup>
89+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
90+
<ClCompile>
91+
<WarningLevel>Level3</WarningLevel>
92+
<FunctionLevelLinking>true</FunctionLevelLinking>
93+
<IntrinsicFunctions>true</IntrinsicFunctions>
94+
<SDLCheck>true</SDLCheck>
95+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
96+
<ConformanceMode>true</ConformanceMode>
97+
</ClCompile>
98+
<Link>
99+
<SubSystem>Console</SubSystem>
100+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
101+
<OptimizeReferences>true</OptimizeReferences>
102+
<GenerateDebugInformation>true</GenerateDebugInformation>
103+
</Link>
104+
</ItemDefinitionGroup>
105+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
106+
<ClCompile>
107+
<WarningLevel>Level3</WarningLevel>
108+
<SDLCheck>true</SDLCheck>
109+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110+
<ConformanceMode>true</ConformanceMode>
111+
</ClCompile>
112+
<Link>
113+
<SubSystem>Console</SubSystem>
114+
<GenerateDebugInformation>true</GenerateDebugInformation>
115+
</Link>
116+
</ItemDefinitionGroup>
117+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
118+
<ClCompile>
119+
<WarningLevel>Level3</WarningLevel>
120+
<FunctionLevelLinking>true</FunctionLevelLinking>
121+
<IntrinsicFunctions>true</IntrinsicFunctions>
122+
<SDLCheck>true</SDLCheck>
123+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
124+
<ConformanceMode>true</ConformanceMode>
125+
</ClCompile>
126+
<Link>
127+
<SubSystem>Console</SubSystem>
128+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
129+
<OptimizeReferences>true</OptimizeReferences>
130+
<GenerateDebugInformation>true</GenerateDebugInformation>
131+
</Link>
132+
</ItemDefinitionGroup>
133+
<ItemGroup>
134+
<ClCompile Include="APPClient_PluginExample.cpp" />
135+
</ItemGroup>
136+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
137+
<ImportGroup Label="ExtensionTargets">
138+
</ImportGroup>
139+
</Project>

0 commit comments

Comments
 (0)