未验证 提交 b8acb4f7 编写于 作者: xengine-qyt's avatar xengine-qyt 提交者: Gitee

!5 V2.3.0.1001 Merge

Merge pull request !5 from qyt/develop
XEngine_APIService V2.3.0.1001
添加:服务器能力查询接口函数
添加:bmi模块
添加:时区插件
更新:支持XENGINE V7.38版本了
修改:支持MACOS系统了
修改:插件支持负载内容参数了
修改:现在打印xengine版本了
修正:程序退出时候崩溃
修正:构建错误
删除:libopencc的linux模块,需要自己安装
added:server option supported
added:bmi module
added:timezone plugin module
update:match xengine v7.38
modify:support macos now
modify:plugin support payload parament
modify:printf xengine version now
fixed:app exist crashed.
fixed:build error
delete:libopencc for linux module,install byself
======================================================================================
XEngine_APIService V2.2.0.1001
添加:为p2p处理增加post方法
......
......@@ -13,6 +13,10 @@ You can use this code to implement your own information query service, which sup
The purpose of development and implementation based on libXEngine is a cross-platform network storage service
and support plugin module
#### Why choose us
Support privatization deployment, free, safe, open source, controllable
## Software feature
1. support json and string stream methods to return the content of the query
2. support ip address location information query(IPV4 and IPV6)
......@@ -21,10 +25,10 @@ and support plugin module
5. Weather forecast (planned)
6. Lunar calendar conversion (planning)
7. News headlines (planned)
8. Standard height and weight (planned)
8. Standard height and weight
9. Zodiac Constellation
10. Password generator
11. World Time Zones (planned)
11. World Time Zones
12. Oil price inquiry (planned)
13. Administrative zip code (planned)
14. Bank card verification
......@@ -39,20 +43,30 @@ and support plugin module
## install
#### Requirements
support system above windows 7sp1 and linux(ubuntu20.04,centos8)
XEngine need V7.30 or above
#### XEngine Evn
you must install XEngine,need V7.38 or above,install XEngine can be refer to xengine Readme docment
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine
#### Windows
use vs open and complie
You need to configure the environment in the following way, otherwise you may need to set the library directory in the project yourself
##### fast to deployment
git clone https://gitee.com/xyry/libxengine.git or git clone https://github.com/libxengine/xengine.git
window Exection XEngine_WINEnv.bat
Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
Macos Exection:./XEngine_LINEnv.sh -i 3
##### XEngine
download xengine through git.read xengine project readme file to configure your env
#### Windows
use vs open and compile,suport windows 7sp1 and above
Just Run it
#### Linux
Linux use Makefile to complie
supproted ubuntu x64 or centos x64
install opencc,ubuntu:sudo apt install libopencc-dev,centos:compile by self
use makefile compile,UBUNTU20.04 x64 or CENTOS8 x64
Run it on the terminal
#### Macos
install opencc:brew install opencc
use makefile compile,mac 12 and above
Run it on the terminal
##### complie
execute command in XEngine_Source path
......@@ -79,8 +93,10 @@ make FLAGS=CleanAll clear
You can refer to the project under XEngine_PluginModule to write the plugin
The written plugin needs to be configured via JSON to be enabled
## now task
## Test Server
Address:app.xyry.org,Port:5501
## now task
## other problems
You can refer to the document under the docment directory. It contains API protocol and service description.
......
......@@ -13,6 +13,10 @@ c c++ interface api service
基于libXEngine开发并实现的一套简洁高性能跨平台接口服务
并且支持模块插件
#### 为什么选择我们
支持私有化部署,免费,安全.开源,可控
## 软件特性
1. 支持JSON和字符串流方式返回查询的内容
2. 支持IP地址位置信息查询(IPV4和IPV6)
......@@ -21,10 +25,10 @@ c c++ interface api service
5. 天气预报(计划中)
6. 农历公历转换(计划中)
7. 新闻头条(计划中)
8. 标准身高体重(计划中)
8. 标准身高体重
9. 生肖星座
10. 密码生成器
11. 世界时区(计划中)
11. 世界时区
12. 油价查询(计划中)
13. 行政邮编(计划中)
14. 银行卡验证
......@@ -39,20 +43,30 @@ c c++ interface api service
## 安装教程
#### 版本需求
支持WINDOWS 7SP1和LINUX(UBUNT20.04,CENTOS8)以上系统
XEngine版本需要V7.30或者以上版本
#### XEngine环境
必须安装XEngine,版本需要V7.38或者以上版本,安装XEngine可以参考其Readme文档
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine
#### Windows
使用VS打开并且编译
你需要按照下面的方式配置环境,不然你可能需要自己在项目中设置库目录
###### 快速部署
git clone https://gitee.com/xyry/libxengine.git 或者 git clone https://github.com/libxengine/xengine.git
window执行XEngine_WINEnv.bat 脚本.
Linux执行:sudo ./XEngine_LINEnv.sh -i 3
macos执行:./XEngine_LINEnv.sh -i 3
##### XEngine环境
XEngine通过GIT下载,参考XEngine项目的readme配置环境
#### Windows
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
直接运行即可
#### Linux
Linux使用Makefile编译
UBUNTU20.04 x64或者CENTOS8 x64均可
安装opencc,ubuntu:sudo apt install libopencc-dev,centos:需要自己编译
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
在控制台运行
#### Macos
安装opencc,执行命令:brew install opencc
使用makefile编译,控制台运行,需要mac 12以及以上版本
在控制台运行
##### 编译命令
在XEngine_Source目录下执行命令
......@@ -86,6 +100,7 @@ make FLAGS=CleanAll 清理编译
## 测试服务器
地址:app.xyry.org,端口:5501
#### 测试接口示例
更多内容请参考文档
手机信息查询
......
#ifdef _MSC_BUILD
#include <Windows.h>
#include <tchar.h>
#pragma comment(lib,"Ws2_32")
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <XEngine_Include/XEngine_CommHdr.h>
#include <XEngine_Include/XEngine_ProtocolHdr.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
//需要优先配置XEngine
//WINDOWS支持VS2022 x64 debug 编译调试
//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
//macos::g++ -std=c++17 -Wall -g APPClient_PluginExample.cpp -o APPClient_PluginExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp
int main()
{
#ifdef _MSC_BUILD
WSADATA st_WSAData;
WSAStartup(MAKEWORD(2, 2), &st_WSAData);
#endif
int nLen = 0;
TCHAR* ptszMsgBuffer = NULL;
LPCTSTR lpszPassUrl = _T("http://127.0.0.1:5501/api?function=pass&params1=1&params2=4");
if (!APIHelp_HttpRequest_Get(lpszPassUrl, &ptszMsgBuffer, &nLen))
{
printf("发送投递失败!\n");
return 0;
}
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
LPCTSTR lpszZodiacUrl = _T("http://127.0.0.1:5501/api?function=zodiac&params1=19880121");
if (!APIHelp_HttpRequest_Get(lpszZodiacUrl, &ptszMsgBuffer, &nLen))
{
printf("发送投递失败!\n");
return 0;
}
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
LPCTSTR lpszTimeUrl = _T("http://127.0.0.1:5501/api?function=timezone&params1=1&params2=1-20");
if (!APIHelp_HttpRequest_Get(lpszTimeUrl, &ptszMsgBuffer, &nLen))
{
printf("发送投递失败!\n");
return 0;
}
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
LPCTSTR lpszBmiUrl = _T("http://127.0.0.1:5501/api?function=bmindex&params1=1.78&params2=62");
if (!APIHelp_HttpRequest_Get(lpszBmiUrl, &ptszMsgBuffer, &nLen))
{
printf("发送投递失败!\n");
return 0;
}
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
#ifdef _MSC_BUILD
WSACleanup();
#endif
return 0;
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{81b29f95-d383-437f-ad34-11e1f3b6eae5}</ProjectGuid>
<RootNamespace>APPClientPluginExample</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="APPClient_PluginExample.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="APPClient_PluginExample.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
......@@ -18,8 +18,8 @@
//需要优先配置XEngine
//WINDOWS支持VS2022 x64 debug 编译调试
//linux使用下面的命令编译
//g++ -std=c++17 -Wall -g APPClient_TranslationExample.cpp -o APPClient_TranslationExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp
//linux::g++ -std=c++17 -Wall -g APPClient_TranslationExample.cpp -o APPClient_TranslationExample.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp
//macos::g++ -std=c++17 -Wall -g APPClient_TranslationExample.cpp -o APPClient_TranslationExample.exe -lXEngine_BaseLib -lNetHelp_APIHelp
int main()
{
......
......@@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_TranslationExampl
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_P2PExample", "APPClient_P2PExample\APPClient_P2PExample.vcxproj", "{D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_PluginExample", "APPClient_PluginExample\APPClient_PluginExample.vcxproj", "{81B29F95-D383-437F-AD34-11E1F3B6EAE5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
......@@ -81,6 +83,14 @@ Global
{D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}.Release|x64.Build.0 = Release|x64
{D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}.Release|x86.ActiveCfg = Release|Win32
{D3C54AFE-44F5-4D2F-B4C6-7B3F9FAED95B}.Release|x86.Build.0 = Release|Win32
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x64.ActiveCfg = Debug|x64
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x64.Build.0 = Debug|x64
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x86.ActiveCfg = Debug|Win32
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Debug|x86.Build.0 = Debug|Win32
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x64.ActiveCfg = Release|x64
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x64.Build.0 = Release|x64
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x86.ActiveCfg = Release|Win32
{81B29F95-D383-437F-AD34-11E1F3B6EAE5}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -31,6 +31,7 @@
"tszPluginFile":"./XEngine_Config/XEngine_PluginConfig.json"
},
"XVer":[
"2.3.0.1001 Build20220723",
"2.2.0.1001 Build20220701",
"2.1.0.1001 Build20220429",
"1.1.0.1001 Build20220402",
......
{
"OPTionBase": [{
"OPTionEnable": true,
"OPTionMethod": "ip",
"OPTionNote": "IP地址信息查询",
"OPTionExample": "http://%s/api?function=ip&params1=1.29.164.255&params2=0"
},
{
"OPTionEnable": true,
"OPTionMethod": "id",
"OPTionNote": "身份证信息查询",
"OPTionExample": "http://%s/api?function=id&params1=511025191101018792&params2=0"
},
{
"OPTionEnable": true,
"OPTionMethod": "phone",
"OPTionNote": "电话号码查询",
"OPTionExample": "http://%s/api?function=phone&params1=13699428888&params2=0"
},
{
"OPTionEnable": true,
"OPTionMethod": "bank",
"OPTionNote": "银行卡验证",
"OPTionExample": "http://%s/api?function=bank&params1=6214000000&params2=0"
},
{
"OPTionEnable": true,
"OPTionMethod": "language",
"OPTionNote": "语言转换",
"OPTionExample": "http://%s/api?function=language&params1=繁体到简体&params2=0&params3=1"
},
{
"OPTionEnable": true,
"OPTionMethod": "translation",
"OPTionNote": "翻译",
"OPTionExample": "http://%s/api?function=translation&params1=中国&params2=0&params3=0"
},
{
"OPTionEnable": true,
"OPTionMethod": "p2p",
"OPTionNote": "p2p网络",
"OPTionExample": "参考文档"
}
],
"OPTionPlugin": [{
"OPTionEnable": true,
"OPTionMethod": "zodiac",
"OPTionNote": "生肖星座",
"OPTionExample": "http://%s/api?function=zodiac&params1=19880121"
},
{
"OPTionEnable": true,
"OPTionMethod": "pass",
"OPTionNote": "密码",
"OPTionExample": "http://%s/api?function=pass&params1=1&params2=4"
},
{
"OPTionEnable": true,
"OPTionMethod": "timezone",
"OPTionNote": "时区转换",
"OPTionExample": "http://%s/api?function=timezone&params1=0"
},
{
"OPTionEnable": true,
"OPTionMethod": "bmindex",
"OPTionNote": "体脂标准",
"OPTionExample": "http://%s/api?function=bmindex&params1=高(米))&param2=体重(千克)"
}
]
}
\ No newline at end of file
......@@ -9,6 +9,16 @@
"PluginEnable":true,
"PluginMethod":"pass",
"PluginFile":"./XEngine_Plugin/ModulePlugin_Password.dll"
},
{
"PluginEnable":true,
"PluginMethod":"timezone",
"PluginFile":"./XEngine_Plugin/ModulePlugin_Timezone.dll"
},
{
"PluginEnable":true,
"PluginMethod":"bmindex",
"PluginFile":"./XEngine_Plugin/ModulePlugin_BMIndex.dll"
}
]
}
\ No newline at end of file
......@@ -14,20 +14,20 @@ MODULE_PLUGIN_PATH = ./XEngine_ModulePlugin
PLUGIN_MODULE_ZODIAC = ./XEngine_PluginModule/ModulePlugin_Zodiac
PLUGIN_MODULE_PASSWORD = ./XEngine_PluginModule/ModulePlugin_Password
PLUGIN_MODULE_TIMEZONE = ./XEngine_PluginModule/ModulePlugin_Timezone
PLUGIN_MODULE_BMINDEX = ./XEngine_PluginModule/ModulePlugin_BMIndex
APP_CENTER_PATH = ./XEngine_ServiceApp/XEngine_CenterApp
APP_HTTP_PATH = ./XEngine_ServiceApp/XEngine_HttpApp
XENGINE_MODULES = libjsoncpp.so libopencc.so \
XENGINE_MODULES = libjsoncpp.so \
libXEngine_ModuleConfigure.so libXEngine_ModuleDatabase.so libXEngine_ModuleProtocol.so libXEngine_ModuleHelp.so libXEngine_ModulePlugin.so \
libModulePlugin_Zodiac.so libModulePlugin_Password.so \
XEngine_HttpApp.exe
libModulePlugin_Zodiac.so libModulePlugin_Password.so libModulePlugin_Timezone.so libModulePlugin_BMIndex.so\
XEngine_HttpApp.exe
.PHONY:MakeAll
MakeAll:$(XENGINE_MODULES)
libopencc.so:
cp -rf ./XEngine_ThirdPart/opencc/ubuntu/libopencc.so ../XEngine_Release/libopencc.so
libjsoncpp.so:
make -C $(THIRDPART_MODULE_JSONCPP) $(FLAGS)
......@@ -46,6 +46,10 @@ libModulePlugin_Zodiac.so:
make -C $(PLUGIN_MODULE_ZODIAC) $(FLAGS)
libModulePlugin_Password.so:
make -C $(PLUGIN_MODULE_PASSWORD) $(FLAGS)
libModulePlugin_Timezone.so:
make -C $(PLUGIN_MODULE_TIMEZONE) $(FLAGS)
libModulePlugin_BMIndex.so:
make -C $(PLUGIN_MODULE_BMINDEX) $(FLAGS)
XEngine_HttpApp.exe:
make -C $(APP_HTTP_PATH) $(FLAGS)
......
......@@ -32,6 +32,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_Zodiac", "XEng
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_Password", "XEngine_PluginModule\ModulePlugin_Password\ModulePlugin_Password.vcxproj", "{201B6D13-82A7-49E9-9736-D6B3BFE05B30}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_Timezone", "XEngine_PluginModule\ModulePlugin_Timezone\ModulePlugin_Timezone.vcxproj", "{37B8E91F-EC52-41F0-B21D-441D4270C05F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModulePlugin_BMIndex", "XEngine_PluginModule\ModulePlugin_BMIndex\ModulePlugin_BMIndex.vcxproj", "{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
......@@ -112,6 +116,22 @@ Global
{201B6D13-82A7-49E9-9736-D6B3BFE05B30}.Release|x64.Build.0 = Release|x64
{201B6D13-82A7-49E9-9736-D6B3BFE05B30}.Release|x86.ActiveCfg = Release|Win32
{201B6D13-82A7-49E9-9736-D6B3BFE05B30}.Release|x86.Build.0 = Release|Win32
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x64.ActiveCfg = Debug|x64
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x64.Build.0 = Debug|x64
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x86.ActiveCfg = Debug|Win32
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Debug|x86.Build.0 = Debug|Win32
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x64.ActiveCfg = Release|x64
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x64.Build.0 = Release|x64
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x86.ActiveCfg = Release|Win32
{37B8E91F-EC52-41F0-B21D-441D4270C05F}.Release|x86.Build.0 = Release|Win32
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x64.ActiveCfg = Debug|x64
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x64.Build.0 = Debug|x64
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x86.ActiveCfg = Debug|Win32
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Debug|x86.Build.0 = Debug|Win32
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x64.ActiveCfg = Release|x64
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x64.Build.0 = Release|x64
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x86.ActiveCfg = Release|Win32
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -121,6 +141,8 @@ Global
{F1736B3F-03A2-4FC7-B045-A12BA8D724FB} = {1F64BA84-8754-4FD3-87F8-9102F124EBC1}
{32BB166A-3D3D-45EF-8BED-2E0471274159} = {D0473C03-9464-4C44-818A-AE212680CD05}
{201B6D13-82A7-49E9-9736-D6B3BFE05B30} = {D0473C03-9464-4C44-818A-AE212680CD05}
{37B8E91F-EC52-41F0-B21D-441D4270C05F} = {D0473C03-9464-4C44-818A-AE212680CD05}
{BBC4B2B4-1143-45DF-8890-47CE26A61D0E} = {D0473C03-9464-4C44-818A-AE212680CD05}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9B202F91-A601-429E-BB0F-880DDEE096FE}
......
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./ -I ../XEngine_ThirdPart/jsoncpp
LOADBIN = -L ../XEngine_ThirdPart/jsoncpp
LIB = -ljsoncpp
LIBEX = -static-libgcc -lrt -ldl -lpthread
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=./,--disable-new-dtags
LIBINCLUDE = ModuleConfigure_Json.o pch.o
LIBINCLUDE = ModuleConfigure_Json.o ModuleConfigure_File.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,22 +35,24 @@ endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleConfigure.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleConfigure.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
ModuleConfigure_Json.o:./ModuleConfigure_Json/ModuleConfigure_Json.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleConfigure_Json/ModuleConfigure_Json.cpp
ModuleConfigure_File.o:./ModuleConfigure_File/ModuleConfigure_File.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleConfigure_File/ModuleConfigure_File.cpp
pch.o:./pch.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./pch.cpp
InstallAll:InstallSo
InstallSo:./libXEngine_ModuleConfigure.so
cp ./libXEngine_ModuleConfigure.so ../../XEngine_Release/libXEngine_ModuleConfigure.so
InstallSo:./libXEngine_ModuleConfigure.$(SHAREDLL)
cp ./libXEngine_ModuleConfigure.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleConfigure.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
rm *.$(SHAREDLL)
......@@ -86,6 +86,19 @@ typedef struct
list<XENGINE_PLUGININFO>* pStl_ListPlugin;
}XENGINE_PLUGINCONFIG;
//////////////////////////////////////////////////////////////////////////
typedef struct
{
BOOL bEnable;
TCHAR tszOPMethod[MAX_PATH];
TCHAR tszOPNote[MAX_PATH];
TCHAR tszOPExample[MAX_PATH];
}XENGINE_OPTIONINFO;
typedef struct
{
list<XENGINE_OPTIONINFO> stl_ListBase;
list<XENGINE_OPTIONINFO> stl_ListPlug;
}XENGINE_OPTIONLIST;
//////////////////////////////////////////////////////////////////////////
// 导出函数定义
//////////////////////////////////////////////////////////////////////////
extern "C" DWORD ModuleConfigure_GetLastError(int* pInt_ErrorCode = NULL);
......@@ -148,4 +161,26 @@ extern "C" BOOL ModuleConfigure_Json_OPenccFile(LPCTSTR lpszConfigFile, XENGINE_
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL ModuleConfigure_Json_PluginFile(LPCTSTR lpszConfigFile, XENGINE_PLUGINCONFIG* pSt_PluginConfig);
\ No newline at end of file
extern "C" BOOL ModuleConfigure_Json_PluginFile(LPCTSTR lpszConfigFile, XENGINE_PLUGINCONFIG* pSt_PluginConfig);
/************************************************************************/
/* 其他内容读取 */
/************************************************************************/
/********************************************************************
函数名称:ModuleConfigure_File_OPtion
函数功能:服务器可用方法查询配置文件
参数.一:lpszConfigFile
In/Out:In
类型:常量字符指针
可空:N
意思:输入要读取的配置文件
参数.二:pSt_OPtionList
In/Out:Out
类型:数据结构指针
可空:N
意思:输出信息列表
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST* pSt_OPtionList);
\ No newline at end of file
......@@ -19,4 +19,10 @@
#define ERROR_MODULE_CONFIGURE_JSON_XDB 0xA0007 //数据库配置错误
#define ERROR_MODULE_CONFIGURE_JSON_XPLUGIN 0xA0008 //插件配置错误
#define ERROR_MODULE_CONFIGURE_JSON_XVER 0xA0009 //版本配置文件读取错误
#define ERROR_MODULE_CONFIGURE_JSON_MALLOC 0xA000A //申请内存失败
\ No newline at end of file
#define ERROR_MODULE_CONFIGURE_JSON_MALLOC 0xA000A //申请内存失败
//////////////////////////////////////////////////////////////////////////
#define ERROR_MODULE_CONFIGURE_FILE_PARAMENT 0xA1001 //参数错误
#define ERROR_MODULE_CONFIGURE_FILE_OPENFILE 0xA1002 //打开文件失败
#define ERROR_MODULE_CONFIGURE_FILE_PARSE 0xA1003 //解析错误
#define ERROR_MODULE_CONFIGURE_FILE_BASE 0xA1004 //基础信息不存在
#define ERROR_MODULE_CONFIGURE_JSON_PLUGIN 0xA1005 //插件信息不存在
\ No newline at end of file
#include "pch.h"
#include "ModuleConfigure_File.h"
/********************************************************************
// Created: 2022/07/21 17:07:28
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File\ModuleConfigure_File.cpp
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File
// File Base: ModuleConfigure_File
// File Ext: cpp
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 文件信息读写
// History:
*********************************************************************/
CModuleConfigure_File::CModuleConfigure_File()
{
}
CModuleConfigure_File::~CModuleConfigure_File()
{
}
//////////////////////////////////////////////////////////////////////////
// 公用函数
//////////////////////////////////////////////////////////////////////////
/********************************************************************
函数名称:ModuleConfigure_File_OPtion
函数功能:服务器可用方法查询配置文件
参数.一:lpszConfigFile
In/Out:In
类型:常量字符指针
可空:N
意思:输入要读取的配置文件
参数.二:pSt_OPtionList
In/Out:Out
类型:数据结构指针
可空:N
意思:输出信息列表
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
BOOL CModuleConfigure_File::ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST* pSt_OPtionList)
{
Config_IsErrorOccur = FALSE;
if ((NULL == lpszConfigFile) || (NULL == pSt_OPtionList))
{
Config_IsErrorOccur = TRUE;
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_PARAMENT;
return FALSE;
}
Json::Value st_JsonRoot;
JSONCPP_STRING st_JsonError;
Json::CharReaderBuilder st_JsonBuilder;
//读取配置文件所有内容到缓冲区
FILE* pSt_File = _tfopen(lpszConfigFile, _T("rb"));
if (NULL == pSt_File)
{
Config_IsErrorOccur = TRUE;
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_OPENFILE;
return FALSE;
}
size_t nCount = 0;
TCHAR tszMsgBuffer[4096];
while (1)
{
size_t nRet = fread(tszMsgBuffer + nCount, 1, 2048, pSt_File);
if (nRet <= 0)
{
break;
}
nCount += nRet;
}
fclose(pSt_File);
//开始解析配置文件
std::unique_ptr<Json::CharReader> const pSt_JsonReader(st_JsonBuilder.newCharReader());
if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nCount, &st_JsonRoot, &st_JsonError))
{
Config_IsErrorOccur = TRUE;
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_PARSE;
return FALSE;
}
if (st_JsonRoot["OPTionBase"].empty())
{
Config_IsErrorOccur = TRUE;
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_FILE_BASE;
return FALSE;
}
if (st_JsonRoot["OPTionPlugin"].empty())
{
Config_IsErrorOccur = TRUE;
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_PLUGIN;
return FALSE;
}
Json::Value st_JsonBase = st_JsonRoot["OPTionBase"];
for (unsigned int i = 0; i < st_JsonBase.size(); i++)
{
XENGINE_OPTIONINFO st_OPTionInfo;
memset(&st_OPTionInfo, '\0', sizeof(XENGINE_OPTIONINFO));
st_OPTionInfo.bEnable = st_JsonBase[i]["OPTionEnable"].asBool();
_tcscpy(st_OPTionInfo.tszOPMethod, st_JsonBase[i]["OPTionMethod"].asCString());
_tcscpy(st_OPTionInfo.tszOPNote, st_JsonBase[i]["OPTionNote"].asCString());
_tcscpy(st_OPTionInfo.tszOPExample, st_JsonBase[i]["OPTionExample"].asCString());
pSt_OPtionList->stl_ListBase.push_back(st_OPTionInfo);
}
Json::Value st_JsonPlug = st_JsonRoot["OPTionPlugin"];
for (unsigned int i = 0; i < st_JsonPlug.size(); i++)
{
XENGINE_OPTIONINFO st_OPTionInfo;
memset(&st_OPTionInfo, '\0', sizeof(XENGINE_OPTIONINFO));
st_OPTionInfo.bEnable = st_JsonPlug[i]["OPTionEnable"].asBool();
_tcscpy(st_OPTionInfo.tszOPMethod, st_JsonPlug[i]["OPTionMethod"].asCString());
_tcscpy(st_OPTionInfo.tszOPNote, st_JsonPlug[i]["OPTionNote"].asCString());
_tcscpy(st_OPTionInfo.tszOPExample, st_JsonPlug[i]["OPTionExample"].asCString());
pSt_OPtionList->stl_ListPlug.push_back(st_OPTionInfo);
}
return TRUE;
}
\ No newline at end of file
#pragma once
/********************************************************************
// Created: 2022/07/21 17:07:01
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File\ModuleConfigure_File.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_File
// File Base: ModuleConfigure_File
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 文件信息读写
// History:
*********************************************************************/
class CModuleConfigure_File
{
public:
CModuleConfigure_File();
~CModuleConfigure_File();
public:
BOOL ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST* pSt_OPtionList);
protected:
private:
};
\ No newline at end of file
......@@ -5,4 +5,6 @@ EXPORTS
ModuleConfigure_Json_File
ModuleConfigure_Json_OPenccFile
ModuleConfigure_Json_PluginFile
\ No newline at end of file
ModuleConfigure_Json_PluginFile
ModuleConfigure_File_OPtion
\ No newline at end of file
......@@ -169,6 +169,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="ModuleConfigure_File\ModuleConfigure_File.h" />
<ClInclude Include="ModuleConfigure_Json\ModuleConfigure_Json.h" />
<ClInclude Include="ModuleConfig_Define.h" />
<ClInclude Include="ModuleConfig_Error.h" />
......@@ -176,6 +177,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="ModuleConfigure_File\ModuleConfigure_File.cpp" />
<ClCompile Include="ModuleConfigure_Json\ModuleConfigure_Json.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
......
......@@ -19,6 +19,12 @@
<Filter Include="源文件\ModuleConfigure_Json">
<UniqueIdentifier>{865425d8-f7eb-4fb9-bcd1-8bb631209b4e}</UniqueIdentifier>
</Filter>
<Filter Include="头文件\ModuleConfigure_File">
<UniqueIdentifier>{6976af83-32b2-4404-a20e-2f619e57daad}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\ModuleConfigure_File">
<UniqueIdentifier>{6b6efe12-6349-4581-a649-d81c086fb267}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
......@@ -36,6 +42,9 @@
<ClInclude Include="ModuleConfig_Error.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="ModuleConfigure_File\ModuleConfigure_File.h">
<Filter>头文件\ModuleConfigure_File</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
......@@ -47,6 +56,9 @@
<ClCompile Include="ModuleConfigure_Json\ModuleConfigure_Json.cpp">
<Filter>源文件\ModuleConfigure_Json</Filter>
</ClCompile>
<ClCompile Include="ModuleConfigure_File\ModuleConfigure_File.cpp">
<Filter>源文件\ModuleConfigure_File</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="XEngine_ModuleConfigure.def">
......
#include "pch.h"
#include "ModuleConfigure_Json/ModuleConfigure_Json.h"
#include "ModuleConfigure_File/ModuleConfigure_File.h"
/********************************************************************
// Created: 2021/12/02 16:20:26
// File Name: D:\XEngine_ServiceApp\XEngine_Source\XEngine_ModuleConfigure\pch.cpp
......@@ -15,6 +16,7 @@ BOOL Config_IsErrorOccur = FALSE;
DWORD Config_dwErrorCode = 0;
//////////////////////////////////////////////////////////////////////
CModuleConfigure_Json m_ConfigJson;
CModuleConfigure_File m_ConfigFile;
//////////////////////////////////////////////////////////////////////
// 导出函数定义
//////////////////////////////////////////////////////////////////////
......@@ -40,4 +42,11 @@ extern "C" BOOL ModuleConfigure_Json_OPenccFile(LPCTSTR lpszConfigFile, XENGINE_
extern "C" BOOL ModuleConfigure_Json_PluginFile(LPCTSTR lpszConfigFile, XENGINE_PLUGINCONFIG * pSt_PluginConfig)
{
return m_ConfigJson.ModuleConfigure_Json_PluginFile(lpszConfigFile, pSt_PluginConfig);
}
/************************************************************************/
/* 其他内容读取 */
/************************************************************************/
extern "C" BOOL ModuleConfigure_File_OPtion(LPCTSTR lpszConfigFile, XENGINE_OPTIONLIST * pSt_OPtionList)
{
return m_ConfigFile.ModuleConfigure_File_OPtion(lpszConfigFile, pSt_OPtionList);
}
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_HelpComponents
LIB = -lHelpComponents_DataBase
LIBEX = -static-libgcc -lrt -ldl -lpthread
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_HelpComponents
LIB = -lXEngine_BaseLib -lHelpComponents_DataBase
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=./,--disable-new-dtags
LIBINCLUDE = ModuleDatabase_IDCard.o ModuleDatabase_IPInfo.o ModuleDatabase_Phone.o ModuleDatabase_Bank.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,7 +35,7 @@ endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleDatabase.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleDatabase.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
ModuleDatabase_IDCard.o:./ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleDatabase_IDCard/ModuleDatabase_IDCard.cpp
......@@ -40,12 +51,12 @@ pch.o:./pch.cpp
InstallAll:InstallSo
InstallSo:./libXEngine_ModuleDatabase.so
cp ./libXEngine_ModuleDatabase.so ../../XEngine_Release/libXEngine_ModuleDatabase.so
InstallSo:./libXEngine_ModuleDatabase.$(SHAREDLL)
cp ./libXEngine_ModuleDatabase.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleDatabase.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
\ No newline at end of file
rm *.$(SHAREDLL)
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./ -I ../XEngine_ThirdPart/opencc/include
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../XEngine_ThirdPart/opencc/ubuntu
INCLUDE = -I ./
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib
LIB = -lXEngine_BaseLib -lopencc
LIBEX = -static-libgcc -lrt -ldl -lpthread
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=./,--disable-new-dtags
LIBINCLUDE = ModuleHelp_IDCard.o ModuleHelp_Language.o ModuleHelp_P2PClient.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,7 +35,7 @@ endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleHelp.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleHelp.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
ModuleHelp_IDCard.o:./ModuleHelp_IDCard/ModuleHelp_IDCard.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleHelp_IDCard/ModuleHelp_IDCard.cpp
......@@ -38,12 +49,12 @@ pch.o:./pch.cpp
InstallAll:InstallSo
InstallSo:./libXEngine_ModuleHelp.so
cp ./libXEngine_ModuleHelp.so ../../XEngine_Release/libXEngine_ModuleHelp.so
InstallSo:./libXEngine_ModuleHelp.$(SHAREDLL)
cp ./libXEngine_ModuleHelp.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleHelp.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
\ No newline at end of file
rm *.$(SHAREDLL)
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib
LIB = -lXEngine_BaseLib
LIBEX = -static-libgcc -lrt -ldl -lpthread
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=./,--disable-new-dtags
LIBINCLUDE = ModulePlugin_Core.o ModulePlugin_Loader.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,7 +35,7 @@ endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModulePlugin.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModulePlugin.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
ModulePlugin_Core.o:./ModulePlugin_Core/ModulePlugin_Core.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModulePlugin_Core/ModulePlugin_Core.cpp
......@@ -36,12 +47,12 @@ pch.o:./pch.cpp
InstallAll:InstallSo
InstallSo:./libXEngine_ModulePlugin.so
cp ./libXEngine_ModulePlugin.so ../../XEngine_Release/libXEngine_ModulePlugin.so
InstallSo:./libXEngine_ModulePlugin.$(SHAREDLL)
cp ./libXEngine_ModulePlugin.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModulePlugin.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
\ No newline at end of file
rm *.$(SHAREDLL)
\ No newline at end of file
......@@ -115,12 +115,22 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Push(XNETHANDLE* pxhModule, LPCTSTR l
类型:整数型指针
可空:N
意思:输出内容大小
参数.七:lpszMsgBufer
In/Out:Out
类型:常量字符指针
可空:Y
意思:输入负载内容
参数.八:nMsgLen
In/Out:Out
类型:整数型指针
可空:Y
意思:输入负载大小
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
BOOL CModulePlugin_Core::ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen)
BOOL CModulePlugin_Core::ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer /* = NULL */, int nMsgLen /* = 0 */)
{
ModulePlugin_IsErrorOccur = FALSE;
......@@ -134,7 +144,7 @@ BOOL CModulePlugin_Core::ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pp
st_csStl.unlock_shared();
return FALSE;
}
if (!stl_MapIterator->second.fpCall_PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen))
if (!stl_MapIterator->second.fpCall_PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBufer, nMsgLen))
{
ModulePlugin_IsErrorOccur = TRUE;
ModulePlugin_dwErrorCode = stl_MapIterator->second.fpCall_PluginCore_GetLastError();
......
......@@ -12,7 +12,7 @@
*********************************************************************/
typedef BOOL(*FPCall_PluginCore_Init)(LPVOID lParam);
typedef BOOL(*FPCall_PluginCore_UnInit)();
typedef BOOL(*FPCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen);
typedef BOOL(*FPCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen);
typedef DWORD(*FPCall_PluginCore_GetLastError)();
typedef struct
......@@ -22,7 +22,7 @@ typedef struct
BOOL(*fpCall_PluginCore_Init)(LPVOID lParam);
BOOL(*fpCall_PluginCore_UnInit)();
BOOL(*fpCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen);
BOOL(*fpCall_PluginCore_Call)(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen);
DWORD(*fpCall_PluginCore_GetLastError)();
}PLUGINCORE_FRAMEWORK, * LPPLUGINCORE_FRAMEWORK;
......@@ -34,7 +34,7 @@ public:
public:
BOOL ModulePlugin_Core_Init();
BOOL ModulePlugin_Core_Push(XNETHANDLE* pxhModule, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen);
BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0);
BOOL ModulePlugin_Core_Destroy();
protected:
BOOL ModulePlugin_Core_Add(XNETHANDLE xhNet, LPCTSTR lpszPluginFile, LPVOID lParam = NULL);
......
......@@ -83,12 +83,22 @@ extern "C" BOOL ModulePlugin_Core_Push(XNETHANDLE * pxhNet, LPCSTR lpszPluginFil
类型:整数型指针
可空:N
意思:输出内容大小
参数.七:lpszMsgBufer
In/Out:Out
类型:常量字符指针
可空:Y
意思:输入负载内容
参数.八:nMsgLen
In/Out:Out
类型:整数型指针
可空:Y
意思:输入负载大小
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen);
extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer = NULL, int nMsgLen = 0);
/********************************************************************
函数名称:ModulePlugin_Core_Destroy
函数功能:销毁插件核心并且清理资源
......
......@@ -39,7 +39,7 @@ extern "C" BOOL ModulePlugin_Core_Push(XNETHANDLE * pxhModule, LPCTSTR lpszPlugi
{
return m_PluginCore.ModulePlugin_Core_Push(pxhModule, lpszPluginFile, lParam);
}
extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen)
extern "C" BOOL ModulePlugin_Core_Exec(XNETHANDLE xhModule, TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBufer, int nMsgLen)
{
return m_PluginCore.ModulePlugin_Core_Exec(xhModule, pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen);
}
......
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./ -I ../XEngine_ThirdPart/jsoncpp
LOADBIN = -L ../XEngine_ThirdPart/jsoncpp
LIB = -ljsoncpp
LIBEX = -static-libgcc -lrt -ldl -lpthread
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../XEngine_ThirdPart/jsoncpp
LIB = -lXEngine_BaseLib -ljsoncpp
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=./,--disable-new-dtags
LIBINCLUDE = ModuleProtocol_Packet.o ModuleProtocol_Parse.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,7 +35,7 @@ endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleProtocol.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libXEngine_ModuleProtocol.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
ModuleProtocol_Packet.o:./ModuleProtocol_Packet/ModuleProtocol_Packet.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./ModuleProtocol_Packet/ModuleProtocol_Packet.cpp
......@@ -36,12 +47,12 @@ pch.o:./pch.cpp
InstallAll:InstallSo
InstallSo:./libXEngine_ModuleProtocol.so
cp ./libXEngine_ModuleProtocol.so ../../XEngine_Release/libXEngine_ModuleProtocol.so
InstallSo:./libXEngine_ModuleProtocol.$(SHAREDLL)
cp ./libXEngine_ModuleProtocol.$(SHAREDLL) ../../XEngine_Release/libXEngine_ModuleProtocol.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
\ No newline at end of file
rm *.$(SHAREDLL)
\ No newline at end of file
#pragma once
/********************************************************************
// Created: 2022/07/20 09:57:09
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Timezone_Define.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone
// File Base: Timezone_Define
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 时区工具导出定义
// History:
*********************************************************************/
//////////////////////////////////////////////////////////////////////////
// 导出函数定义
//////////////////////////////////////////////////////////////////////////
extern "C" DWORD PluginCore_GetLastError();
/*********************************************************************************
* 导出函数定义 *
*********************************************************************************/
/********************************************************************
函数名称:PluginCore_Init
函数功能:初始化插件模块
参数.一:lParam
In/Out:In/Out
类型:无类型指针
可空:N
意思:自定义参数
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL);
/********************************************************************
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_UnInit();
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0);
\ No newline at end of file
#pragma once
/********************************************************************
// Created: 2022/07/20 16:40:17
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\BMIndex_Error.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex
// File Base: BMIndex_Error
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: BMI错误导出
// History:
*********************************************************************/
//////////////////////////////////////////////////////////////////////////
// 错误定义
//////////////////////////////////////////////////////////////////////////
#define ERROR_XENGINE_APISERVICE_PLUGIN_MODULE_BMINDEX_PARAMENT 0x14001 //参数错误
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp
LIB = -lXEngine_BaseLib -ljsoncpp
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=../,--disable-new-dtags
LIBINCLUDE = Plugin_BMIndex.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
UNICODE = -D _UNICODE
else
UNICODE =
endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_BMIndex.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
Plugin_BMIndex.o:./Plugin_BMIndex/Plugin_BMIndex.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_BMIndex/Plugin_BMIndex.cpp
pch.o:./pch.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./pch.cpp
InstallAll:InstallSo
InstallSo:./libModulePlugin_BMIndex.$(SHAREDLL)
cp ./libModulePlugin_BMIndex.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_BMIndex.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.$(SHAREDLL)
\ No newline at end of file
LIBRARY
EXPORTS
PluginCore_GetLastError
PluginCore_Init
PluginCore_UnInit
PluginCore_Call
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{bbc4b2b4-1143-45df-8890-47ce26a61d0e}</ProjectGuid>
<RootNamespace>ModulePluginBMIndex</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\XEngine_Plugin\</OutDir>
<IncludePath>../../XEngine_ThirdPart/jsoncpp;$(XEngine_Include);$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Configuration)\XEngine_Plugin\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_BMIndex.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_BMIndex.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_BMIndex.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;MODULEPLUGINBMINDEX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_BMIndex.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="BMIndex_Define.h" />
<ClInclude Include="BMIndex_Error.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Plugin_BMIndex\Plugin_BMIndex.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Plugin_BMIndex\Plugin_BMIndex.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="ModulePlugin_BMIndex.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="头文件\Plugin_BMIndex">
<UniqueIdentifier>{df393b17-7b0b-4454-ad60-2f43a0449401}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\Plugin_BMIndex">
<UniqueIdentifier>{ef4df45c-5063-4625-b55b-aa7c907920b6}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Plugin_BMIndex\Plugin_BMIndex.h">
<Filter>头文件\Plugin_BMIndex</Filter>
</ClInclude>
<ClInclude Include="BMIndex_Define.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="BMIndex_Error.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="Plugin_BMIndex\Plugin_BMIndex.cpp">
<Filter>源文件\Plugin_BMIndex</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="ModulePlugin_BMIndex.def">
<Filter>源文件</Filter>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
#include "pch.h"
#include "Plugin_BMIndex.h"
/********************************************************************
// Created: 2022/07/20 16:37:26
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex\Plugin_BMIndex.cpp
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex
// File Base: Plugin_BMIndex
// File Ext: cpp
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 标准身高体重
// History:
*********************************************************************/
CPlugin_BMIndex::CPlugin_BMIndex()
{
}
CPlugin_BMIndex::~CPlugin_BMIndex()
{
}
//////////////////////////////////////////////////////////////////////////
// 公有函数
//////////////////////////////////////////////////////////////////////////
/********************************************************************
函数名称:PluginCore_Init
函数功能:初始化插件模块
参数.一:lParam
In/Out:In/Out
类型:无类型指针
可空:N
意思:自定义参数
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
BOOL CPlugin_BMIndex::PluginCore_Init(LPVOID lParam)
{
BMIndex_IsErrorOccur = FALSE;
return TRUE;
}
/********************************************************************
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
BOOL CPlugin_BMIndex::PluginCore_UnInit()
{
BMIndex_IsErrorOccur = FALSE;
return TRUE;
}
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
BOOL CPlugin_BMIndex::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
BMIndex_IsErrorOccur = FALSE;
if ((NULL == pInt_HTTPCode) || (NULL == ptszMsgBuffer) || (NULL == pInt_MsgLen))
{
BMIndex_IsErrorOccur = TRUE;
BMIndex_dwErrorCode = ERROR_XENGINE_APISERVICE_PLUGIN_MODULE_BMINDEX_PARAMENT;
return FALSE;
}
TCHAR tszKeyName[128];
TCHAR tszParamHigh[128];
TCHAR tszParamWeight[128];
memset(tszKeyName, '\0', sizeof(tszKeyName));
memset(tszParamHigh, '\0', sizeof(tszParamHigh));
memset(tszParamWeight, '\0', sizeof(tszParamWeight));
BaseLib_OperatorString_GetKeyValue((*pppHDRList)[1], "=", tszKeyName, tszParamHigh);
BaseLib_OperatorString_GetKeyValue((*pppHDRList)[2], "=", tszKeyName, tszParamWeight);
Plugin_Timezone_BMIndex(tszParamHigh, tszParamWeight, ptszMsgBuffer, pInt_MsgLen);
*pInt_HTTPCode = 200;
return TRUE;
}
//////////////////////////////////////////////////////////////////////////
// 保护函数
//////////////////////////////////////////////////////////////////////////
BOOL CPlugin_BMIndex::Plugin_Timezone_BMIndex(LPCTSTR lpszHigh, LPCTSTR lpszWeight, TCHAR* ptszMsgBufer, int* pInt_Len)
{
BMIndex_IsErrorOccur = FALSE;
Json::Value st_JsonRoot;
Json::Value st_JsonObject;
Json::StreamWriterBuilder st_JsonBuilder;
double dlHigh = _ttof(lpszHigh);
double dlWeight = _ttof(lpszWeight);
double dlValue = dlWeight / (dlHigh * dlHigh);
if (dlValue < 18.5)
{
st_JsonObject["Result"] = "偏瘦";
}
else if ((dlValue >= 18.5) && (dlValue <= 23.9))
{
st_JsonObject["Result"] = "正常";
}
else if ((dlValue >= 24) && (dlValue <= 27.9))
{
st_JsonObject["Result"] = "超重";
}
else if ((dlValue >= 28) && (dlValue < 30))
{
st_JsonObject["Result"] = "肥胖";
}
else if ((dlValue >= 30) && (dlValue < 40))
{
st_JsonObject["Result"] = "重度肥胖";
}
else if (dlValue >= 40)
{
st_JsonObject["Result"] = "极重度肥胖";
}
st_JsonObject["flValue"] = dlValue;
st_JsonObject["flWeight"] = dlWeight;
st_JsonObject["flHigh"] = dlHigh;
st_JsonRoot["data"] = st_JsonObject;
st_JsonRoot["code"] = 0;
st_JsonRoot["msg"] = "success";
st_JsonBuilder["emitUTF8"] = true;
*pInt_Len = Json::writeString(st_JsonBuilder, st_JsonRoot).length();
memcpy(ptszMsgBufer, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), *pInt_Len);
return TRUE;
}
\ No newline at end of file
#pragma once
/********************************************************************
// Created: 2022/07/20 16:36:59
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex\Plugin_BMIndex.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\Plugin_BMIndex
// File Base: Plugin_BMIndex
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 标准身高体重
// History:
*********************************************************************/
class CPlugin_BMIndex
{
public:
CPlugin_BMIndex();
~CPlugin_BMIndex();
public:
BOOL PluginCore_Init(LPVOID lParam);
BOOL PluginCore_UnInit();
BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen);
protected:
BOOL Plugin_Timezone_BMIndex(LPCTSTR lpszHigh, LPCTSTR lpszWeight, TCHAR* ptszMsgBufer, int* pInt_Len);
private:
};
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#pragma once
#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
// Windows 头文件
#include <windows.h>
#include "pch.h"
#include "Plugin_BMIndex/Plugin_BMIndex.h"
/********************************************************************
// Created: 2022/07/20 19:18:15
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex\pch.cpp
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_BMIndex
// File Base: pch
// File Ext: cpp
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 导出实现
// History:
*********************************************************************/
BOOL BMIndex_IsErrorOccur = FALSE;
DWORD BMIndex_dwErrorCode = 0;
//////////////////////////////////////////////////////////////////////////
CPlugin_BMIndex m_PluginBMIndex;
//////////////////////////////////////////////////////////////////////////
// 导出函数定义
//////////////////////////////////////////////////////////////////////////
extern "C" DWORD PluginCore_GetLastError()
{
return BMIndex_dwErrorCode;
}
/*********************************************************************************
* 导出函数定义 *
*********************************************************************************/
extern "C" BOOL PluginCore_Init(LPVOID lParam)
{
return m_PluginBMIndex.PluginCore_Init(lParam);
}
extern "C" BOOL PluginCore_UnInit()
{
return m_PluginBMIndex.PluginCore_UnInit();
}
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
return m_PluginBMIndex.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen);
}
\ No newline at end of file
// pch.h: 这是预编译标头文件。
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
#ifndef PCH_H
#define PCH_H
#ifdef _MSC_BUILD
// 添加要在此处预编译的标头
#include "framework.h"
#include <tchar.h>
#endif // _MSC_BUILD
#endif //PCH_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <json/json.h>
#include <XEngine_Include/XEngine_CommHdr.h>
#include <XEngine_Include/XEngine_Types.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include "BMIndex_Define.h"
#include "BMIndex_Error.h"
using namespace std;
/********************************************************************
// Created: 2022/07/20 10:23:48
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\pch.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone
// File Base: pch
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 公用头文件
// History:
*********************************************************************/
extern BOOL BMIndex_IsErrorOccur;
extern DWORD BMIndex_dwErrorCode;
#ifdef _MSC_BUILD
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#ifdef _DEBUG
#ifdef _WIN64
#pragma comment(lib,"../../x64/Debug/jsoncpp")
#else
#pragma comment(lib,"../../Debug/jsoncpp")
#endif
#else
#ifdef _WIN64
#pragma comment(lib,"../../x64/Release/jsoncpp")
#else
#pragma comment(lib,"../../Release/jsoncpp")
#endif
#endif
#endif
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp
LIB = -lXEngine_BaseLib -ljsoncpp
LIBEX = -static-libgcc -lrt -ldl -lpthread
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=../,--disable-new-dtags
LIBINCLUDE = Plugin_Password.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,7 +35,7 @@ endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Password.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Password.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
Plugin_Password.o:./Plugin_Password/Plugin_Password.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_Password/Plugin_Password.cpp
......@@ -34,11 +45,11 @@ pch.o:./pch.cpp
InstallAll:InstallSo
InstallSo:./libModulePlugin_Password.so
cp ./libModulePlugin_Password.so ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Password.so
InstallSo:./libModulePlugin_Password.$(SHAREDLL)
cp ./libModulePlugin_Password.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Password.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
\ No newline at end of file
rm *.$(SHAREDLL)
\ No newline at end of file
......@@ -48,4 +48,4 @@ extern "C" BOOL PluginCore_UnInit();
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen);
\ No newline at end of file
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0);
\ No newline at end of file
......@@ -61,7 +61,7 @@ BOOL CPlugin_Password::PluginCore_UnInit()
意思:是否成功
备注:
*********************************************************************/
BOOL CPlugin_Password::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen)
BOOL CPlugin_Password::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
Pass_IsErrorOccur = FALSE;
......
......@@ -19,7 +19,7 @@ public:
public:
BOOL PluginCore_Init(LPVOID lParam);
BOOL PluginCore_UnInit();
BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen);
BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen);
protected:
BOOL Plugin_Password_Creator(LPCTSTR lpszPassType, LPCTSTR lpszLength, TCHAR* ptszPassStr);
private:
......
......@@ -33,7 +33,7 @@ extern "C" BOOL PluginCore_UnInit()
{
return m_PluginPass.PluginCore_UnInit();
}
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen)
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
return m_PluginPass.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen);
return m_PluginPass.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen);
}
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp
LIB = -lXEngine_BaseLib -ljsoncpp
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=../,--disable-new-dtags
LIBINCLUDE = Plugin_Timezone.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
UNICODE = -D _UNICODE
else
UNICODE =
endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Timezone.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
Plugin_Timezone.o:./Plugin_Timezone/Plugin_Timezone.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_Timezone/Plugin_Timezone.cpp
pch.o:./pch.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./pch.cpp
InstallAll:InstallSo
InstallSo:./libModulePlugin_Timezone.$(SHAREDLL)
cp ./libModulePlugin_Timezone.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Timezone.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.$(SHAREDLL)
\ No newline at end of file
LIBRARY
EXPORTS
PluginCore_GetLastError
PluginCore_Init
PluginCore_UnInit
PluginCore_Call
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{37b8e91f-ec52-41f0-b21d-441d4270c05f}</ProjectGuid>
<RootNamespace>ModulePluginTimezone</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Configuration)\XEngine_Plugin\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Configuration)\XEngine_Plugin\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(XEngine_Include);../../XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\XEngine_Plugin\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_Timezone.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_Timezone.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_Timezone.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;MODULEPLUGINTIMEZONE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<ModuleDefinitionFile>ModulePlugin_Timezone.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Plugin_Timezone\Plugin_Timezone.h" />
<ClInclude Include="Timezone_Define.h" />
<ClInclude Include="Timezone_Error.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Plugin_Timezone\Plugin_Timezone.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="ModulePlugin_Timezone.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="源文件\Plugin_Timezone">
<UniqueIdentifier>{efd32df2-4d9e-4e1b-ab1a-6fbe715aaae7}</UniqueIdentifier>
</Filter>
<Filter Include="头文件\Plugin_Timezone">
<UniqueIdentifier>{2fc8c575-9c66-4d13-bd9d-ca41b3391e13}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Plugin_Timezone\Plugin_Timezone.h">
<Filter>头文件\Plugin_Timezone</Filter>
</ClInclude>
<ClInclude Include="Timezone_Define.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Timezone_Error.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="Plugin_Timezone\Plugin_Timezone.cpp">
<Filter>源文件\Plugin_Timezone</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="ModulePlugin_Timezone.def">
<Filter>源文件</Filter>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
#pragma once
/********************************************************************
// Created: 2022/07/20 09:56:02
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Plugin_Timezone\Plugin_Timezone.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Plugin_Timezone
// File Base: Plugin_Timezone
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 时区工具库
// History:
*********************************************************************/
typedef struct
{
XENGINE_LIBTIMER st_TimeZone;
TCHAR tszTimeCountry[MAX_PATH];
}MODULEPLUGIN_TIMEZONE;
class CPlugin_Timezone
{
public:
CPlugin_Timezone();
~CPlugin_Timezone();
public:
BOOL PluginCore_Init(LPVOID lParam);
BOOL PluginCore_UnInit();
BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen);
protected:
BOOL Plugin_Timezone_Count(TCHAR* ptszMsgBufer, int* pInt_Len);
BOOL Plugin_Timezone_List(LPCTSTR lpszConvert, TCHAR* ptszMsgBufer, int* pInt_Len);
BOOL Plugin_Timezone_Convert(LPCTSTR lpszConvert, LPCTSTR lpszTimeStr, TCHAR* ptszMsgBufer, int* pInt_Len);
private:
unordered_map<string, MODULEPLUGIN_TIMEZONE> stl_MapTimezone;
};
#pragma once
/********************************************************************
// Created: 2022/07/20 09:57:09
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Timezone_Define.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone
// File Base: Timezone_Define
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 时区工具导出定义
// History:
*********************************************************************/
//////////////////////////////////////////////////////////////////////////
// 导出函数定义
//////////////////////////////////////////////////////////////////////////
extern "C" DWORD PluginCore_GetLastError();
/*********************************************************************************
* 导出函数定义 *
*********************************************************************************/
/********************************************************************
函数名称:PluginCore_Init
函数功能:初始化插件模块
参数.一:lParam
In/Out:In/Out
类型:无类型指针
可空:N
意思:自定义参数
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_Init(LPVOID lParam = NULL);
/********************************************************************
函数名称:PluginCore_UnInit
函数功能:卸载插件
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_UnInit();
/********************************************************************
函数名称:PluginCore_Call
函数功能:调用插件
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0);
\ No newline at end of file
#pragma once
/********************************************************************
// Created: 2022/07/20 09:57:23
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\Timezone_Error.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone
// File Base: Timezone_Error
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 时区错误
// History:
*********************************************************************/
//////////////////////////////////////////////////////////////////////////
// 错误定义
//////////////////////////////////////////////////////////////////////////
#define ERROR_XENGINE_APISERVICE_PLUGIN_MODULE_TIMEZONE_PARAMENT 0x13001 //参数错误
\ No newline at end of file
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#pragma once
#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
// Windows 头文件
#include <windows.h>
#include "pch.h"
#include "Plugin_Timezone/Plugin_Timezone.h"
/********************************************************************
// Created: 2022/07/20 11:44:22
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\pch.cpp
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone
// File Base: pch
// File Ext: cpp
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 导出实现
// History:
*********************************************************************/
BOOL Timezone_IsErrorOccur = FALSE;
DWORD Timezone_dwErrorCode = 0;
//////////////////////////////////////////////////////////////////////////
CPlugin_Timezone m_PluginTimes;
//////////////////////////////////////////////////////////////////////////
// 导出函数定义
//////////////////////////////////////////////////////////////////////////
extern "C" DWORD PluginCore_GetLastError()
{
return Timezone_dwErrorCode;
}
/*********************************************************************************
* 导出函数定义 *
*********************************************************************************/
extern "C" BOOL PluginCore_Init(LPVOID lParam)
{
return m_PluginTimes.PluginCore_Init(lParam);
}
extern "C" BOOL PluginCore_UnInit()
{
return m_PluginTimes.PluginCore_UnInit();
}
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
return m_PluginTimes.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen);
}
\ No newline at end of file
// pch.h: 这是预编译标头文件。
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
#ifndef PCH_H
#define PCH_H
#ifdef _MSC_BUILD
// 添加要在此处预编译的标头
#include "framework.h"
#include <tchar.h>
#endif // _MSC_BUILD
#endif //PCH_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <json/json.h>
#include <XEngine_Include/XEngine_CommHdr.h>
#include <XEngine_Include/XEngine_Types.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include "Timezone_Define.h"
#include "Timezone_Error.h"
using namespace std;
/********************************************************************
// Created: 2022/07/20 10:23:48
// File Name: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone\pch.h
// File Path: H:\XEngine_APIService\XEngine_Source\XEngine_PluginModule\ModulePlugin_Timezone
// File Base: pch
// File Ext: h
// Project: XEngine(网络通信引擎)
// Author: qyt
// Purpose: 公用头文件
// History:
*********************************************************************/
extern BOOL Timezone_IsErrorOccur;
extern DWORD Timezone_dwErrorCode;
#ifdef _MSC_BUILD
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#ifdef _DEBUG
#ifdef _WIN64
#pragma comment(lib,"../../x64/Debug/jsoncpp")
#else
#pragma comment(lib,"../../Debug/jsoncpp")
#endif
#else
#ifdef _WIN64
#pragma comment(lib,"../../x64/Release/jsoncpp")
#else
#pragma comment(lib,"../../Release/jsoncpp")
#endif
#endif
#endif
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./ -I ../../XEngine_ThirdPart/jsoncpp
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L ../../XEngine_ThirdPart/jsoncpp
LIB = -lXEngine_BaseLib -lXEngine_Algorithm -ljsoncpp
LIBEX = -static-libgcc -lrt -ldl -lpthread
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=../,--disable-new-dtags
LIBINCLUDE = Plugin_Zodiac.o pch.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,7 +35,7 @@ endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Zodiac.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libModulePlugin_Zodiac.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
Plugin_Zodiac.o:./Plugin_Zodiac/Plugin_Zodiac.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) ./Plugin_Zodiac/Plugin_Zodiac.cpp
......@@ -34,11 +45,11 @@ pch.o:./pch.cpp
InstallAll:InstallSo
InstallSo:./libModulePlugin_Zodiac.so
cp ./libModulePlugin_Zodiac.so ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Zodiac.so
InstallSo:./libModulePlugin_Zodiac.$(SHAREDLL)
cp ./libModulePlugin_Zodiac.$(SHAREDLL) ../../../XEngine_Release/XEngine_Plugin/libModulePlugin_Zodiac.$(SHAREDLL)
CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
\ No newline at end of file
rm *.$(SHAREDLL)
\ No newline at end of file
......@@ -48,4 +48,4 @@ extern "C" BOOL PluginCore_UnInit();
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen);
\ No newline at end of file
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer = NULL, int nMsgLen = 0);
\ No newline at end of file
......@@ -73,7 +73,7 @@ BOOL CPlugin_Zodiac::PluginCore_UnInit()
意思:是否成功
备注:
*********************************************************************/
BOOL CPlugin_Zodiac::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen)
BOOL CPlugin_Zodiac::PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
Zodiac_IsErrorOccur = FALSE;
......
......@@ -19,7 +19,7 @@ public:
public:
BOOL PluginCore_Init(LPVOID lParam);
BOOL PluginCore_UnInit();
BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen);
BOOL PluginCore_Call(TCHAR*** pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen);
protected:
BOOL Plugin_Zodiac_Chinese(LPCTSTR lpszDate, TCHAR* ptszCZodiac);
BOOL Plugin_Zodiac_English(LPCTSTR lpszDate, TCHAR* ptszEZodiac);
......
......@@ -33,7 +33,7 @@ extern "C" BOOL PluginCore_UnInit()
{
return m_PluginZodiac.PluginCore_UnInit();
}
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen)
extern "C" BOOL PluginCore_Call(TCHAR * **pppHDRList, int nListCount, int* pInt_HTTPCode, TCHAR * ptszMsgBuffer, int* pInt_MsgLen, LPCTSTR lpszMsgBuffer, int nMsgLen)
{
return m_PluginZodiac.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen);
return m_PluginZodiac.PluginCore_Call(pppHDRList, nListCount, pInt_HTTPCode, ptszMsgBuffer, pInt_MsgLen, lpszMsgBuffer, nMsgLen);
}
\ No newline at end of file
......@@ -3,21 +3,25 @@ RELEASE = 0
UNICODE = 0
LOADBIN = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L /usr/local/lib/XEngine_Release/XEngine_HelpComponents -L /usr/local/lib/XEngine_Release/XEngine_RfcComponents -L /usr/local/lib/XEngine_Release/XEngine_NetHelp \
-L ../../XEngine_ModuleConfigure -L ../../XEngine_ModuleDatabase -L ../../XEngine_ModuleProtocol -L ../../XEngine_ModuleHelp -L ../../XEngine_ModulePlugin \
-L ../../XEngine_ThirdPart/jsoncpp -L ../../XEngine_ThirdPart/opencc/ubuntu
-L ../../XEngine_ThirdPart/jsoncpp
LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl -lHelpComponents_XLog -lRfcComponents_HttpServer -lNetHelp_APIHelp \
-lXEngine_ModuleConfigure -lXEngine_ModuleDatabase -lXEngine_ModuleProtocol -lXEngine_ModuleHelp -lXEngine_ModulePlugin \
-ljsoncpp -lopencc
LIBEX = -static-libgcc -ldl -lrt -lpthread
-ljsoncpp
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=./,--disable-new-dtags
LIBINCLUDE = XEngine_Configure.o XEngine_Network.o XEngine_HTTPTask.o XEngine_PluginTask.o XEngine_HttpApp.o \
HTTPTask_IPInfo.o HTTPTask_IDCard.o HTTPTask_Phone.o HTTPTask_Bank.o HTTPTask_Language.o HTTPTask_Translation.o HTTPTask_P2PClient.o
HTTPTask_IPInfo.o HTTPTask_IDCard.o HTTPTask_Phone.o HTTPTask_Bank.o HTTPTask_Language.o HTTPTask_Translation.o HTTPTask_P2PClient.o HTTPTask_OPtions.o
ifeq ($(shell uname),Darwin)
LOADSO =
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -52,6 +56,8 @@ HTTPTask_Translation.o:./XEngine_HTTPTask/HTTPTask_Translation.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HTTPTask/HTTPTask_Translation.cpp
HTTPTask_P2PClient.o:./XEngine_HTTPTask/HTTPTask_P2PClient.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HTTPTask/HTTPTask_P2PClient.cpp
HTTPTask_OPtions.o:./XEngine_HTTPTask/HTTPTask_OPtions.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HTTPTask/HTTPTask_OPtions.cpp
XEngine_HttpApp.o:./XEngine_HttpApp.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) ./XEngine_HttpApp.cpp
......
......@@ -13,11 +13,17 @@
BOOL XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pSt_Configure)
{
LPCTSTR lpszConfigFile = _T("./XEngine_Config/XEngine_Config.json");
LPCTSTR lpszOPtionFile = _T("./XEngine_Config/XEngine_OPtionConfig.json");
if (!ModuleConfigure_Json_File(lpszConfigFile, pSt_Configure))
{
printf("解析配置文件失败,ModuleConfigure_Json_File:%lX\n", ModuleConfigure_GetLastError());
return FALSE;
}
if (!ModuleConfigure_File_OPtion(lpszOPtionFile, &st_OPtionList))
{
printf("解析配置文件失败,ModuleConfigure_File_OPtion:%lX\n", ModuleConfigure_GetLastError());
return FALSE;
}
for (int i = 0; i < argc; i++)
......
......@@ -89,6 +89,7 @@ BOOL XEngine_HTTPTask_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCTSTR
LPCTSTR lpszFuncName = _T("api");
LPCTSTR lpszParamFuncKey = _T("function");
LPCTSTR lpszParamName = _T("params1");
LPCTSTR lpszParamOPtions = _T("options");
LPCTSTR lpszParamIPAddr = _T("ip");
LPCTSTR lpszParamIDCard = _T("id");
LPCTSTR lpszParamPhone = _T("phone");
......@@ -148,9 +149,14 @@ BOOL XEngine_HTTPTask_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCTSTR
}
else if (0 == _tcsnicmp(lpszMethodGet, pSt_HTTPParam->tszHttpMethod, _tcslen(lpszMethodGet)))
{
//是不是ip查询
if (0 == _tcsnicmp(lpszParamIPAddr, tszValue, _tcslen(lpszParamIPAddr)))
if (0 == _tcsnicmp(lpszParamOPtions, tszValue, _tcslen(lpszParamOPtions)))
{
//HTTP能力查询
XEngine_HTTPTask_OPTions(lpszClientAddr);
}
else if (0 == _tcsnicmp(lpszParamIPAddr, tszValue, _tcslen(lpszParamIPAddr)))
{
//是不是ip查询
memset(tszKey, '\0', sizeof(tszKey));
memset(tszValue, '\0', sizeof(tszValue));
BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue);
......
#include "../XEngine_Hdr.h"
BOOL XEngine_HTTPTask_OPTions(LPCTSTR lpszClientAddr)
{
int nMsgLen = 4096;
int nPktLen = 4096;
TCHAR tszMsgBuffer[4096];
TCHAR tszPktBuffer[4096];
RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数
memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer));
memset(tszPktBuffer, '\0', sizeof(tszPktBuffer));
memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM));
st_HDRParam.nHttpCode = 200; //HTTP CODE码
st_HDRParam.bIsClose = TRUE; //收到回复后就关闭
//解析能力配置
XENGINE_OPTIONLIST st_OPtionList;
LPCTSTR lpszOPFile = _T("./XEngine_Config/XEngine_OPtionConfig.json");
FILE* pSt_File = _tfopen(lpszOPFile, _T("rb"));
if (NULL == pSt_File)
{
st_HDRParam.nHttpCode = 404;
RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen);
XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen);
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("HTTP客户端:%s,查询服务器能力失败,没有找到配置文件"), lpszClientAddr);
return FALSE;
}
nPktLen = fread(tszPktBuffer, 1, nPktLen, pSt_File);
fclose(pSt_File);
//打包发送
RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen);
XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen);
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("HTTP客户端:%s,查询服务器能力成功"), lpszClientAddr);
return TRUE;
}
\ No newline at end of file
#pragma once
BOOL XEngine_HTTPTask_OPTions(LPCTSTR lpszClientAddr);
\ No newline at end of file
......@@ -63,6 +63,7 @@ using namespace std;
#include "XEngine_HTTPTask/HTTPTask_Language.h"
#include "XEngine_HTTPTask/HTTPTask_Translation.h"
#include "XEngine_HTTPTask/HTTPTask_P2PClient.h"
#include "XEngine_HTTPTask/HTTPTask_OPtions.h"
/********************************************************************
// Created: 2022/01/20 14:42:06
// File Name: D:\XEngine_ServiceApp\XEngine_Source\XEngine_ServiceApp\XEngine_HttpApp\XEngine_Hdr.h
......@@ -77,14 +78,15 @@ using namespace std;
extern BOOL bIsRun;
extern XLOG xhLog;
//HTTP服务器
extern XNETHANDLE xhHTTPSocket;
extern XNETHANDLE xhHTTPHeart;
extern XNETHANDLE xhHTTPPool;
extern XHANDLE xhHTTPSocket;
extern XHANDLE xhHTTPHeart;
extern XHANDLE xhHTTPPacket;
extern XNETHANDLE xhHTTPPool;
//配置文件
extern XENGINE_SERVICECONFIG st_ServiceConfig;
extern XENGINE_OPENCCCONFIG st_OPenccConfig;
extern XENGINE_PLUGINCONFIG st_PluginConfig;
extern XENGINE_OPTIONLIST st_OPtionList;
//连接库
#ifdef _WINDOWS
#ifdef _WIN64
......
......@@ -13,14 +13,15 @@
BOOL bIsRun = FALSE;
XLOG xhLog = NULL;
//HTTP服务器
XNETHANDLE xhHTTPSocket = 0;
XNETHANDLE xhHTTPHeart = 0;
XNETHANDLE xhHTTPPool = 0;
XHANDLE xhHTTPSocket = NULL;
XHANDLE xhHTTPHeart = NULL;
XHANDLE xhHTTPPacket = NULL;
XNETHANDLE xhHTTPPool = 0;
//配置文件
XENGINE_SERVICECONFIG st_ServiceConfig;
XENGINE_OPENCCCONFIG st_OPenccConfig;
XENGINE_PLUGINCONFIG st_PluginConfig;
XENGINE_OPTIONLIST st_OPtionList;
void ServiceApp_Stop(int signo)
{
......@@ -39,10 +40,10 @@ void ServiceApp_Stop(int signo)
ModuleDatabase_Phone_Destory();
ModuleDatabase_Bank_Destory();
//销毁其他
ModulePlugin_Core_Destroy();
ModuleHelp_P2PClient_Destory();
//销毁日志资源
HelpComponents_XLog_Destroy(xhLog);
ModulePlugin_Core_Destroy();
}
#ifdef _WINDOWS
WSACleanup();
......@@ -187,19 +188,21 @@ int main(int argc, char** argv)
//启动心跳
if (st_ServiceConfig.st_XTime.nHTTPTimeOut > 0)
{
if (!SocketOpt_HeartBeat_InitEx(&xhHTTPHeart, st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck, Network_Callback_HTTPHeart))
xhHTTPHeart = SocketOpt_HeartBeat_InitEx(st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck, Network_Callback_HTTPHeart);
if (NULL == xhHTTPHeart)
{
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化HTTP心跳服务失败,错误:%lX"), NetCore_GetLastError());
goto XENGINE_SERVICEAPP_EXIT;
}
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化HTTP心跳服务成功,句柄:%llu,时间:%d,次数:%d"), xhHTTPHeart, st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck);
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化HTTP心跳服务成功,时间:%d,次数:%d"), st_ServiceConfig.st_XTime.nHTTPTimeOut, st_ServiceConfig.st_XTime.nTimeCheck);
}
else
{
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("启动服务中,HTTP心跳服务被设置为不启用"));
}
//网络
if (!NetCore_TCPXCore_StartEx(&xhHTTPSocket, st_ServiceConfig.nHttpPort, st_ServiceConfig.st_XMax.nMaxClient, st_ServiceConfig.st_XMax.nIOThread))
xhHTTPSocket = NetCore_TCPXCore_StartEx(st_ServiceConfig.nHttpPort, st_ServiceConfig.st_XMax.nMaxClient, st_ServiceConfig.st_XMax.nIOThread);
if (NULL == xhHTTPSocket)
{
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,启动HTTP网络服务器失败,错误:%lX"), NetCore_GetLastError());
goto XENGINE_SERVICEAPP_EXIT;
......@@ -242,9 +245,8 @@ int main(int argc, char** argv)
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务中,初始化插件系统失败,错误:%lX"), ModulePlugin_GetLastError());
goto XENGINE_SERVICEAPP_EXIT;
}
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化插件系统成功"));
//加载插件
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,开始加载插件,总共:%d 插件"), st_PluginConfig.pStl_ListPlugin->size());
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,初始化插件系统成功,开始加载插件"));
{
list<XENGINE_PLUGININFO>::const_iterator stl_ListIterator = st_PluginConfig.pStl_ListPlugin->begin();
for (int i = 1; stl_ListIterator != st_PluginConfig.pStl_ListPlugin->end(); stl_ListIterator++, i++)
......@@ -266,9 +268,11 @@ int main(int argc, char** argv)
}
}
}
//展示能力
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,加载的基本查询服务总:%d 个,插件:%d 个"), st_OPtionList.stl_ListBase.size(), st_OPtionList.stl_ListPlug.size());
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("所有服务成功启动,服务运行中,发行版本次数:%d,当前版本:%s。。。"), st_ServiceConfig.st_XVer.pStl_ListVer->size(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str());
while (bIsRun)
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("所有服务成功启动,服务运行中,XEngine版本:%s,发行版本次数:%d,当前版本:%s。。。"), BaseLib_OperatorVer_XGetStr(), st_ServiceConfig.st_XVer.pStl_ListVer->size(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str());
while (TRUE)
{
std::this_thread::sleep_for(std::chrono::seconds(1));
}
......@@ -289,10 +293,10 @@ XENGINE_SERVICEAPP_EXIT:
ModuleDatabase_Phone_Destory();
ModuleDatabase_Bank_Destory();
//销毁其他
ModulePlugin_Core_Destroy();
ModuleHelp_P2PClient_Destory();
//销毁日志资源
HelpComponents_XLog_Destroy(xhLog);
ModulePlugin_Core_Destroy();
}
#ifdef _WINDOWS
WSACleanup();
......
......@@ -160,6 +160,7 @@
<ClCompile Include="XEngine_HTTPTask\HTTPTask_IDCard.cpp" />
<ClCompile Include="XEngine_HTTPTask\HTTPTask_IPInfo.cpp" />
<ClCompile Include="XEngine_HTTPTask\HTTPTask_Language.cpp" />
<ClCompile Include="XEngine_HTTPTask\HTTPTask_OPtions.cpp" />
<ClCompile Include="XEngine_HTTPTask\HTTPTask_P2PClient.cpp" />
<ClCompile Include="XEngine_HTTPTask\HTTPTask_Phone.cpp" />
<ClCompile Include="XEngine_HTTPTask\HTTPTask_Translation.cpp" />
......@@ -174,6 +175,7 @@
<ClInclude Include="XEngine_HTTPTask\HTTPTask_IDCard.h" />
<ClInclude Include="XEngine_HTTPTask\HTTPTask_IPInfo.h" />
<ClInclude Include="XEngine_HTTPTask\HTTPTask_Language.h" />
<ClInclude Include="XEngine_HTTPTask\HTTPTask_OPtions.h" />
<ClInclude Include="XEngine_HTTPTask\HTTPTask_P2PClient.h" />
<ClInclude Include="XEngine_HTTPTask\HTTPTask_Phone.h" />
<ClInclude Include="XEngine_HTTPTask\HTTPTask_Translation.h" />
......
......@@ -57,6 +57,9 @@
<ClCompile Include="XEngine_HTTPTask\HTTPTask_P2PClient.cpp">
<Filter>源文件\XEngine_HTTPTask</Filter>
</ClCompile>
<ClCompile Include="XEngine_HTTPTask\HTTPTask_OPtions.cpp">
<Filter>源文件\XEngine_HTTPTask</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="XEngine_Configure.h">
......@@ -95,5 +98,8 @@
<ClInclude Include="XEngine_HTTPTask\HTTPTask_P2PClient.h">
<Filter>头文件\XEngine_HTTPTask</Filter>
</ClInclude>
<ClInclude Include="XEngine_HTTPTask\HTTPTask_OPtions.h">
<Filter>头文件\XEngine_HTTPTask</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
CC = g++ -Wall -std=c++17 -fPIC
SHAREFLAG = -shared
SHAREDLL = so
RELEASE = 0
UNICODE = 0
INCLUDE = -I ./
FILECENTOS = /etc/redhat-release
LOADBIN =
LIB =
LIBEX = -static-libgcc -lrt -ldl -lpthread
LIBEX = -ldl -lpthread
LOADSO = -Wl,-rpath=
LIBINCLUDE = json_reader.o json_value.o json_writer.o
ifeq ($(shell uname),Darwin)
SHAREDLL = dylib
SHAREFLAG = -dynamiclib
LOADSO =
else
SHAREDLL = so
SHAREFLAG = -shared
endif
ifeq ($(RELEASE),1)
FLAGS = -c -O2
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
FLAGS = -c
DEBUG = -g
endif
ifeq ($(UNICODE),1)
......@@ -24,7 +35,7 @@ UNICODE =
endif
all:$(LIBINCLUDE)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libjsoncpp.so -shared -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
$(CC) $(DEBUG) $(LIBINCLUDE) -o libjsoncpp.$(SHAREDLL) $(SHAREFLAG) -fPIC $(LOADBIN) $(LIB) $(LIBEX) $(LOADSO)
json_reader.o:json_reader.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) json_reader.cpp
......@@ -34,8 +45,8 @@ json_writer.o:json_writer.cpp
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(INCLUDE) json_writer.cpp
InstallAll:InstallSo
InstallSo:./libjsoncpp.so
cp ./libjsoncpp.so ../../../XEngine_Release/libjsoncpp.so
InstallSo:./libjsoncpp.$(SHAREDLL)
cp ./libjsoncpp.$(SHAREDLL) ../../../XEngine_Release/libjsoncpp.$(SHAREDLL)
......@@ -43,4 +54,4 @@ CleanAll:CleanObj CleanMk
CleanObj:
rm *.o
CleanMk:
rm *.so
rm *.$(SHAREDLL)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册