Skip to content

Commit

Permalink
Merge pull request #14 from libxengine/develop
Browse files Browse the repository at this point in the history
V2.10.0.1001 Merge
  • Loading branch information
xengine-qyt authored Aug 10, 2023
2 parents 1e88e73 + d2bba95 commit 55609b3
Show file tree
Hide file tree
Showing 48 changed files with 1,130 additions and 35 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
XEngine_APIService V2.10.0.1001

增加:敏感词过滤系统
增加:配置热重载功能,支持基本配置和插件配置热重载
修正:ModulePlugin_Loader_Destory 释放锁不正确的问题
修正:http json的返回CODE值不正确的问题
更新:匹配XEngineV8.15版本

added:words filter supported
added:basic and plugin configure hot reload support
fixed:ModulePlugin_Loader_Destory unlock is incorrent
fixed:code of http json for packet protocol is incorrent
update:match xengine v8.15
======================================================================================
XEngine_APIService V2.9.0.1001

增加:短连接生成与转发功能支持
Expand Down
7 changes: 3 additions & 4 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Support privatization deployment, free, safe, open source, controllable
24. local system time
25. math Calculation
26. log service
27. Plugin hot reload(planned)
28. Sensitive word detection(planned)
27. Plugin hot reload
28. Sensitive word detection

## install

Expand Down Expand Up @@ -92,8 +92,7 @@ make FLAGS=CleanAll clear
2. download code
3. complie
4. install
5. uncompress /XEngine_Release/XEngine_DBFile/ipdata.rar into current dir
6. run
5. run

## directory struct
- XEngine_Docment docment directory
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ c c++ interface api service
24. 本地标准时间
25. 数学计算
26. 日志服务
27. 插件脚本热重载(计划中)
28. 敏感词检测(计划中)
27. 插件脚本热重载
28. 敏感词检测

## 安装教程

Expand Down Expand Up @@ -96,8 +96,7 @@ make FLAGS=CleanAll 清理编译
2. 下载代码
3. 编译
4. 安装
5. 解压/XEngine_Release/XEngine_DBFile/ipdata.rar 到当前目录
6. 运行
5. 运行

## 目录结构
- XEngine_Docment 文档目录结构
Expand Down
108 changes: 108 additions & 0 deletions XEngine_APPClient/APPClient_WordFilter/APPClient_WordFilter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#ifdef _MSC_BUILD
#include <Windows.h>
#include <tchar.h>
#pragma comment(lib,"Ws2_32")
#pragma comment(lib,"jsoncpp")
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <json/json.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/APIClient_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>

//需要优先配置XEngine
//WINDOWS支持VS2022 x64 debug 编译调试
//linux::g++ -std=c++17 -Wall -g APPClient_WordFilter.cpp -o APPClient_WordFilter.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient
//macos::g++ -std=c++17 -Wall -g APPClient_WordFilter.cpp -o APPClient_WordFilter.exe -lXEngine_BaseLib -lNetHelp_APIClient

LPCXSTR lpszTableName = _T("xengine");

int test_insert()
{
int nLen = 0;
int nCode = 0;
LPCXSTR lpszAPIUrl = _T("http://127.0.0.1:5501/api?function=wordfilter&params1=0");

Json::Value st_JsonRoot;
Json::StreamWriterBuilder st_JsonBuilder;
st_JsonRoot["tszWordsFrom"] = "root";
st_JsonRoot["tszWordsTo"] = "user";
st_JsonRoot["nLevel"] = 1;

st_JsonBuilder["emitUTF8"] = true;

XCHAR* ptszMsgBuffer = NULL;
if (!APIClient_Http_Request(_T("POST"), lpszAPIUrl, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), &nCode, &ptszMsgBuffer, &nLen))
{
printf("发送投递失败!\n");
return 0;
}
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);

return 0;
}
int test_query()
{
int nLen = 0;
int nCode = 0;
LPCXSTR lpszAPIUrl = _T("http://127.0.0.1:5501/api?function=wordfilter&params1=2");

Json::Value st_JsonRoot;
st_JsonRoot["tszWordsFrom"] = "root";

XCHAR* ptszMsgBuffer = NULL;
if (!APIClient_Http_Request(_T("POST"), lpszAPIUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
{
printf("发送投递失败!\n");
return 0;
}
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);

return 0;
}
int test_delete()
{
int nLen = 0;
int nCode = 0;
LPCXSTR lpszAPIUrl = _T("http://127.0.0.1:5501/api?function=wordfilter&params1=1");

Json::Value st_JsonRoot;
st_JsonRoot["tszWordsFrom"] = "root";

XCHAR* ptszMsgBuffer = NULL;
if (!APIClient_Http_Request(_T("POST"), lpszAPIUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
{
printf("发送投递失败!\n");
return 0;
}
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);

return 0;
}

int main()
{
#ifdef _MSC_BUILD
WSADATA st_WSAData;
WSAStartup(MAKEWORD(2, 2), &st_WSAData);
#endif
test_insert();
test_query();
test_delete();

#ifdef _MSC_BUILD
WSACleanup();
#endif
return 0;
}
143 changes: 143 additions & 0 deletions XEngine_APPClient/APPClient_WordFilter/APPClient_WordFilter.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?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>{6f2d2186-1ed7-444d-9981-1acae4226811}</ProjectGuid>
<RootNamespace>APPClientWordFilter</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>MultiByte</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);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib64);../../XEngine_Source/x64/Debug;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(XEngine_Include);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
<LibraryPath>$(XEngine_Lib32);$(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_WordFilter.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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_WordFilter.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
10 changes: 10 additions & 0 deletions XEngine_APPClient/XEngine_APPClient.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_DTestExample", "A
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_SocketExample", "APPClient_SocketExample\APPClient_SocketExample.vcxproj", "{5DF5E1D4-318C-468D-A427-88D873E095D3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "APPClient_WordFilter", "APPClient_WordFilter\APPClient_WordFilter.vcxproj", "{6F2D2186-1ED7-444D-9981-1ACAE4226811}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -171,6 +173,14 @@ Global
{5DF5E1D4-318C-468D-A427-88D873E095D3}.Release|x64.Build.0 = Release|x64
{5DF5E1D4-318C-468D-A427-88D873E095D3}.Release|x86.ActiveCfg = Release|Win32
{5DF5E1D4-318C-468D-A427-88D873E095D3}.Release|x86.Build.0 = Release|Win32
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Debug|x64.ActiveCfg = Debug|x64
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Debug|x64.Build.0 = Debug|x64
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Debug|x86.ActiveCfg = Debug|Win32
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Debug|x86.Build.0 = Debug|Win32
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Release|x64.ActiveCfg = Release|x64
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Release|x64.Build.0 = Release|x64
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Release|x86.ActiveCfg = Release|Win32
{6F2D2186-1ED7-444D-9981-1ACAE4226811}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file modified XEngine_Docment/Docment_zh.docx
Binary file not shown.
1 change: 1 addition & 0 deletions XEngine_Release/XEngine_Config/XEngine_Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"nHTTPCode":301
},
"XVer":[
"2.10.0.1001 Build20230810",
"2.9.0.1001 Build20230421",
"2.8.0.1001 Build20230207",
"2.7.0.1001 Build20230117",
Expand Down
3 changes: 2 additions & 1 deletion XEngine_SQL/CreateDatabase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

CREATE DATABASE `XEngine_APIInfo` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE `XEngine_APILog` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE `XEngine_APISLink` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE `XEngine_APISLink` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE `XEngine_APIWords` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci;
Loading

0 comments on commit 55609b3

Please sign in to comment.