Skip to content

Commit b5a67d4

Browse files
authored
Merge pull request #39 from libxengine/develop
Merge V3.9.0.1001
2 parents 11ed90e + ecb5a6b commit b5a67d4

109 files changed

Lines changed: 1113 additions & 181 deletions

File tree

Some content is hidden

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

.github/workflows/codeql.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CodeQL Advanced
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
12+
jobs:
13+
analyze:
14+
runs-on: ubuntu-24.04
15+
permissions:
16+
security-events: write
17+
packages: read
18+
actions: read
19+
contents: read
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- language: c-cpp
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
ref: 'develop'
31+
32+
- name: Checkout dependency repository (xengine)
33+
uses: actions/checkout@v4
34+
with:
35+
repository: libxengine/libxengine
36+
path: libxengine
37+
38+
- name: sub module checkout (opensource)
39+
run: |
40+
git submodule init
41+
git submodule update
42+
43+
- name: install library
44+
run: |
45+
sudo apt update -y
46+
sudo apt upgrade -y
47+
sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev libleptonica-dev libtesseract-dev -y
48+
49+
- name: Set up Dependency Environment
50+
run: |
51+
cd libxengine
52+
chmod +x ./XEngine_LINEnv.sh
53+
sudo ./XEngine_LINEnv.sh -i 3
54+
55+
- name: Initialize CodeQL
56+
uses: github/codeql-action/init@v3
57+
with:
58+
languages: ${{ matrix.language }}
59+
60+
- name: make
61+
run: |
62+
cd XEngine_Source
63+
make
64+
65+
- name: Perform CodeQL Analysis
66+
uses: github/codeql-action/analyze@v3
67+
with:
68+
category: "/language:${{ matrix.language }}"

.github/workflows/cppcheck.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: cpp check workflows
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout main repository code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: 'develop'
21+
22+
- name: Create static_analysis directory
23+
run: mkdir -p static_analysis
24+
25+
- name: Run Cppcheck
26+
run: |
27+
sudo apt-get install -y cppcheck
28+
cppcheck --enable=all --language=c++ --std=c++20 ./XEngine_Source/ --output-file=static_analysis/log.xml --xml
29+
continue-on-error: true
30+
31+
- name: Upload Cppcheck Results
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: cppcheck_results
35+
path: static_analysis/log.xml

.github/workflows/macbuild.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ name: macos build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
5+
branches:
6+
- 'develop'
67
paths:
78
- 'XEngine_Source/**'
89
- 'XEngine_Release/**'
910
- '.github/**'
1011

11-
permissions:
12-
contents: read
13-
1412
jobs:
1513
build:
1614
strategy:
@@ -89,9 +87,11 @@ jobs:
8987
with:
9088
name: XEngine_APIServiceApp-x86_64-Mac
9189
path: XEngine_Release/
90+
retention-days: 1
9291
- name: Upload folder as artifact with mac arm
9392
if: matrix.os == 'macos-14'
9493
uses: actions/upload-artifact@v4
9594
with:
9695
name: XEngine_APIServiceApp-Arm64-Mac
97-
path: XEngine_Release/
96+
path: XEngine_Release/
97+
retention-days: 1

.github/workflows/msbuild.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ name: windows build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
5+
branches:
6+
- 'develop'
67
paths:
78
- 'XEngine_Source/**'
89
- 'XEngine_Release/**'
910
- '.github/**'
1011

11-
permissions:
12-
contents: read
1312

1413
jobs:
1514
build:
@@ -121,10 +120,12 @@ jobs:
121120
with:
122121
name: XEngine_APIServiceApp-x86_32-Windows
123122
path: XEngine_Release/
123+
retention-days: 1
124124

125125
- name: Upload folder as artifact with x64
126126
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
127127
uses: actions/upload-artifact@v4
128128
with:
129129
name: XEngine_APIServiceApp-x86_64-Windows
130130
path: XEngine_Release/
131+
retention-days: 1

.github/workflows/ubuntubuild.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ name: ubuntu build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
5+
branches:
6+
- 'develop'
67
paths:
78
- 'XEngine_Source/**'
89
- 'XEngine_Release/**'
910
- '.github/**'
1011

11-
permissions:
12-
contents: read
1312

1413
jobs:
1514
build:
@@ -92,9 +91,12 @@ jobs:
9291
with:
9392
name: XEngine_APIServiceApp-x86_64-Ubuntu-22.04
9493
path: XEngine_Release/
94+
retention-days: 1
95+
9596
- name: Upload folder as artifact with ubuntu24.04
9697
if: matrix.os == 'ubuntu-24.04'
9798
uses: actions/upload-artifact@v4
9899
with:
99100
name: XEngine_APIServiceApp-x86_64-Ubuntu-24.04
100-
path: XEngine_Release/
101+
path: XEngine_Release/
102+
retention-days: 1

CHANGELOG

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
XEngine_APIService V3.9.0.1001
2+
3+
增加:设置日志类型配置支持
4+
更新:依赖库
5+
更新:makefile的g++
6+
更新:配置增加模型文件
7+
修改:报告次数现在直接在发送的时候获取了
8+
修改:守护进程新的重试次数参数支持
9+
修改:支持其他语言系统
10+
修改:油价查询实现通过http api了
11+
修正:编译问题
12+
修正:启用和禁用图像处理不正确的问题
13+
修正:密码插件不工作的问题
14+
修正:天气查询问题
15+
删除:守护功能启动程序失败不在重试
16+
17+
added:set log type support
18+
update:depend library
19+
update:make file g++ version
20+
update:configure file and add model file
21+
modify:reply time count when send report for machine protocol
22+
modify:new parameter re-number support for deamon
23+
modify:other language system supported
24+
modify:imp oil price query thought http api
25+
fixed:build problem
26+
fixed:enable or disable handle failed for image
27+
fixed:lib module password not work
28+
fixed:weather query is incorrect
29+
delete:not retry when start process failed
30+
======================================================================================
131
XEngine_APIService V3.8.0.1001
232

333
增加:OCR图片文本支持

README.en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ git submodule init
8787
git submodule update
8888

8989
#### Linux
90-
ubuntu:sudo apt install sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev
90+
ubuntu:sudo apt install sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev libleptonica-dev libtesseract-dev
9191
centos:compile by self
9292
use makefile compile,UBUNTU24.04 x64 or RockyLinux 9 x64
9393
Run it on the terminal
9494

9595
#### Macos
96-
install opencc:brew install lua opencv qrencode
96+
install environment:brew install lua opencv qrencode leptonica tesseract
9797
use makefile compile,mac 13 and above
9898
Run it on the terminal
9999

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ git clone https://gitee.com/xengine/XEngine_PhoneData.git XEngine_Source/XEngine
9494
直接运行即可
9595

9696
#### Linux
97-
ubuntu:sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev
97+
ubuntu:sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev libleptonica-dev libtesseract-dev
9898
centos:需要自己编译
9999
Linux使用Makefile编译,UBUNTU24.04 x64或者RockyLinux 9 x64
100100
在控制台运行
101101

102102
#### Macos
103-
安装opencc,执行命令:brew install lua opencv qrencode
103+
安装环境,执行命令:brew install lua opencv qrencode leptonica tesseract
104104
使用makefile编译,控制台运行,需要mac 13以及以上版本
105105
在控制台运行
106106

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#ifdef _MSC_BUILD
2+
#include <Windows.h>
3+
#include <tchar.h>
4+
#pragma comment(lib,"Ws2_32")
5+
#pragma comment(lib,"jsoncpp")
6+
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
7+
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
8+
#endif
9+
#include <stdio.h>
10+
#include <stdlib.h>
11+
#include <string.h>
12+
#include <inttypes.h>
13+
#include <json/json.h>
14+
#include <XEngine_Include/XEngine_CommHdr.h>
15+
#include <XEngine_Include/XEngine_ProtocolHdr.h>
16+
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
17+
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
18+
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
19+
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
20+
21+
//需要优先配置XEngine
22+
//WINDOWS支持VS2022 x64 debug 编译调试
23+
//g++ -std=c++17 -Wall -g APPClient_APIQueryExample.cpp -o APPClient_APIQueryExample.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_BaseLib -lXClient_APIHelp -ljsoncpp -Wl,-rpath=../../XEngine_Release
24+
25+
int main()
26+
{
27+
#ifdef _MSC_BUILD
28+
WSADATA st_WSAData;
29+
WSAStartup(MAKEWORD(2, 2), &st_WSAData);
30+
#endif
31+
int nLen = 0;
32+
int nCode = 0;
33+
XCHAR tszMsgBuffer[1024];
34+
LPCXSTR lpszTypeOne = _X("http://127.0.0.1:5501/api?function=ip&param=117.172.221.14");
35+
memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer));
36+
XCHAR* ptszMsgBuffer = NULL;
37+
if (!APIClient_Http_Request(_X("GET"), lpszTypeOne, NULL, &nCode, &ptszMsgBuffer, &nLen))
38+
{
39+
printf("发送投递失败!\n");
40+
return 0;
41+
}
42+
#ifdef _MSC_BUILD
43+
BaseLib_Charset_UTFToAnsi(ptszMsgBuffer, tszMsgBuffer, &nLen);
44+
printf("接受到数据,大小:%d,内容:%s\n", nLen, tszMsgBuffer);
45+
#else
46+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
47+
#endif
48+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
49+
//////////////////////////////////////////////////////////////////////////
50+
nLen = 0;
51+
nCode = 0;
52+
LPCXSTR lpszTypeZ = _X("http://127.0.0.1:5501/api?function=mac&param=00:00:0C");
53+
memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer));
54+
if (!APIClient_Http_Request(_X("GET"), lpszTypeZ, NULL, &nCode, &ptszMsgBuffer, &nLen))
55+
{
56+
printf("发送投递失败!\n");
57+
return 0;
58+
}
59+
#ifdef _MSC_BUILD
60+
BaseLib_Charset_UTFToAnsi(ptszMsgBuffer, tszMsgBuffer, &nLen);
61+
printf("接受到数据,大小:%d,内容:%s\n", nLen, tszMsgBuffer);
62+
#else
63+
printf("接受到数据,大小:%d,内容:%s\n", nLen, ptszMsgBuffer);
64+
#endif
65+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
66+
#ifdef _MSC_BUILD
67+
WSACleanup();
68+
#endif
69+
return 0;
70+
}

XEngine_APPClient/APPClient_LanguageExample/APPClient_LanguageExample.vcxproj renamed to XEngine_APPClient/APPClient_APIQueryExample/APPClient_APIQueryExample.vcxproj

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
</ProjectConfiguration>
2020
</ItemGroup>
2121
<PropertyGroup Label="Globals">
22-
<VCProjectVersion>16.0</VCProjectVersion>
22+
<VCProjectVersion>17.0</VCProjectVersion>
2323
<Keyword>Win32Proj</Keyword>
24-
<ProjectGuid>{1b028466-937d-4d6c-a7ed-a0bd5c312878}</ProjectGuid>
25-
<RootNamespace>APPClientLanguageExample</RootNamespace>
24+
<ProjectGuid>{58ebbc6b-e384-4f7a-ae1c-99f5fbfd63ac}</ProjectGuid>
25+
<RootNamespace>APPClientAPIQueryExample</RootNamespace>
2626
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -43,7 +43,7 @@
4343
<ConfigurationType>Application</ConfigurationType>
4444
<UseDebugLibraries>true</UseDebugLibraries>
4545
<PlatformToolset>v143</PlatformToolset>
46-
<CharacterSet>MultiByte</CharacterSet>
46+
<CharacterSet>Unicode</CharacterSet>
4747
</PropertyGroup>
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4949
<ConfigurationType>Application</ConfigurationType>
@@ -71,18 +71,12 @@
7171
</ImportGroup>
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74-
<LinkIncremental>true</LinkIncremental>
75-
</PropertyGroup>
76-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
77-
<LinkIncremental>false</LinkIncremental>
74+
<IncludePath>$(XEngine_Include);../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath)</IncludePath>
75+
<LibraryPath>$(XEngine_Lib32);../../XEngine_Source/Debug;$(LibraryPath)</LibraryPath>
7876
</PropertyGroup>
7977
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
80-
<LinkIncremental>true</LinkIncremental>
81-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
82-
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
83-
</PropertyGroup>
84-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
85-
<LinkIncremental>false</LinkIncremental>
78+
<IncludePath>$(XEngine_Include);../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp;$(IncludePath)</IncludePath>
79+
<LibraryPath>$(XEngine_Lib64);../../XEngine_Source/x64/Debug;$(LibraryPath)</LibraryPath>
8680
</PropertyGroup>
8781
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8882
<ClCompile>
@@ -141,7 +135,7 @@
141135
</Link>
142136
</ItemDefinitionGroup>
143137
<ItemGroup>
144-
<ClCompile Include="APPClient_LanguageExample.cpp" />
138+
<ClCompile Include="APPClient_APIQueryExample.cpp" />
145139
</ItemGroup>
146140
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
147141
<ImportGroup Label="ExtensionTargets">

0 commit comments

Comments
 (0)