Skip to content

Commit 5ceb2b5

Browse files
xengine-qytgitee-org
authored andcommitted
!2 第二个正式版本发布
Merge pull request !2 from dowflyon/develop
2 parents 2e32b50 + 1611d42 commit 5ceb2b5

File tree

64 files changed

+5486
-238
lines changed

Some content is hidden

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

64 files changed

+5486
-238
lines changed

APIList.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
只支持POST,业务处理端口
2+
3+
查询文件列表:/api/query/file
4+
5+
{
6+
"lpszTimeStart":"开始时间,可NULL",
7+
"lpszTimeEnd":"结束时间,可NULL",
8+
"lpszFileName":"文件名,可NULL",
9+
"lpszFileHash":"文件HASH,可NULL"
10+
}
11+
12+
NGINX上传代理接口:/api/event/upfile

README.en.md

Lines changed: 104 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,104 @@
1-
# XEngine_Storage
2-
3-
#### Description
4-
c c++ 存储服务
5-
c c++ storage service
6-
7-
#### Software Architecture
8-
Software architecture description
9-
10-
#### Installation
11-
12-
1. xxxx
13-
2. xxxx
14-
3. xxxx
15-
16-
#### Instructions
17-
18-
1. xxxx
19-
2. xxxx
20-
3. xxxx
21-
22-
#### Contribution
23-
24-
1. Fork the repository
25-
2. Create Feat_xxx branch
26-
3. Commit your code
27-
4. Create Pull Request
28-
29-
30-
#### Gitee Feature
31-
32-
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
33-
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
34-
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
35-
4. The most valuable open source project [GVP](https://gitee.com/gvp)
36-
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
37-
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
1+
# XEngine_Storage
2+
3+
## Introduction
4+
c c++ 存储服务 c c++ 文件存储服务
5+
c c++ file storage service
6+
This is an api gateway for uploading and downloading.
7+
The service is for users who have business needs for upload and download services (such as developers who need to upload and download servers).
8+
9+
## Software feature
10+
The purpose of development and implementation based on libXEngine is a cross-platform network storage service
11+
This repository has a development and master branch. If you want to use it, please use the master branch
12+
13+
feature list:
14+
1. support file http upload and download(use put and get method)
15+
2. support http api notify of event and management api interface(planning)
16+
3. support encrypt data transimission(planning)
17+
4. support mysql record infomation.
18+
5. support load banace(planning)
19+
6. supprot http and private auth(planning)
20+
7. support log and config
21+
8. supprot speeds contral
22+
9. supprot task start and end proxy forwarding(planning)
23+
10.support p2p,bt and many more(planning)
24+
11.support second pass
25+
12.support nginx download proxy_pass
26+
13.support nginx upload module proxy_pass
27+
28+
## install
29+
30+
#### Requirements
31+
support system above windows 7sp1 and linux(ubuntu20.04,centos8)
32+
XEngine need V7.13 or above
33+
vcpkg need 2021.05.11 or above
34+
35+
#### Windows
36+
use vs2019 x86 open and complie
37+
You need to configure the environment in the following way, otherwise you may need to set the library directory in the project yourself
38+
39+
##### install Dependent library
40+
vcpkg:https://github.com/microsoft/vcpkg
41+
vcpkg.exe install jsoncpp
42+
vcpkg integrate install
43+
you can not use vcpkg and config jsoncpp development for youself
44+
45+
##### XEngine
46+
XEngine can be download with mine repository,whe you downloaded xengine,you have to add value to you user environment
47+
- XEngine_Include header file path
48+
- XEngine_Library library file path
49+
50+
#### Linux
51+
Linux use Makefile to complie
52+
supproted ubuntu or centos
53+
54+
##### install Dependent library
55+
install jsoncpp to your system
56+
ubuntu20.04
57+
sudo apt install libjsoncpp-devel
58+
Centos8.x
59+
sudo dnf install jsoncpp-devel
60+
61+
##### XEngine Install
62+
you can install xengine env to your system by shell
63+
like this:sudo XEngine_RunEnv.sh -c 3
64+
##### complie
65+
execute command in XEngine_Source path
66+
make complie
67+
make FLAGS=InstallAll install
68+
make FLAGS=CleanAll clear
69+
70+
#### use
71+
72+
1. Switch to the MASTER branch
73+
2. download code
74+
3. complie
75+
4. install
76+
5. run
77+
6. use curl or postman test upload and download
78+
79+
## api list
80+
POST Method used as api server
81+
it is used as manage service.api format use to url,such as:POST /api/query/file
82+
The three-segment format is fixed,first api is a fixed,second api of query is a type,third api of file is a name
83+
support api list reference:apilist.txt
84+
85+
## second pass
86+
The Second pass is not realized by the server, it is by the client
87+
upload file second pass is first check the HASH file is on the server, if has file on the server, it will directly prompt the upload is successful.
88+
The realization of downloading second transmission is to first query the local file save path through HASH, and download it directly if it exists.
89+
90+
## directory struct
91+
- XEngine_Docment docment directory
92+
- XEngine_Release install directory
93+
- XEngine_Source code directory
94+
95+
## Participate in contribution
96+
97+
1. Fork this code
98+
2. Create new Feat_xxx branch
99+
3. Submit the code
100+
4. New Pull Request
101+
102+
## post issues
103+
104+
if you have eny quest.post issues...

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
# XEngine_Storage
22

33
## 介绍
4-
c c++ 存储服务 c c++ 文件存储服务
5-
c c++ file storage service
4+
c c++ 存储服务 c c++ 文件存储服务
5+
c c++ file storage service
6+
这是一个上传下载服务API网关,不是文件同步服务,也不是云存储.
7+
这个服务的主要目的是为了给有上传下载服务业务需求的用户使用(比如需要开发上传下载服务的开发人员).
68

79
## 软件特性
810
基于libXEngine开发并实现的一套简洁高性能跨平台网络存储服务
911
本仓库有开发和主分支,如果要使用,请使用master分支下的代码
1012
软件特性:
1113
1. 支持HTTP协议上传和下载(采用PUT和GET)
12-
2. 支持二进制私有协议传送数据(规划中)
14+
2. 支持HTTP API接口事件通知与管理(规划中)
1315
3. 支持加密传输(规划中)
1416
4. 采用MYSQL记录信息
1517
5. 支持分布式(规划中)
1618
6. 支持HTTP和私有验证(规划中)
1719
7. 支持详尽的日志和配置信息
1820
8. 支持传输速率控制
19-
9. 支持任务开始结束代理转发(规划中)
20-
10.支持P2P,BT,数据分发(规划中)
21+
9. 支持任务开始结束代理转发(规划中)
22+
10.支持P2P,BT,数据分发(规划中)
23+
11.支持秒传
24+
12.支持NGINX 下载透传代理(规划中)
25+
13.支持NGINX UPLOAD MODULE上传代理
2126

2227
## 安装教程
2328

@@ -27,7 +32,7 @@ XEngine版本需要V7.13或者以上版本
2732
vcpkg 需要2021.05.11以上版本
2833

2934
#### Windows
30-
使用VS2019 打开并且编译
35+
使用VS2019 x86打开并且编译
3136
你需要按照下面的方式配置环境,不然你可能需要自己在项目中设置库目录
3237
##### 三方库环境
3338
需要使用VCPKG安装环境.代码地址:https://github.com/microsoft/vcpkg
@@ -73,6 +78,17 @@ make FLAGS=CleanAll 清理编译
7378
- XEngine_Release 安装目录结构
7479
- XEngine_Source 源代目录结构
7580

81+
## API列表
82+
POST方法在本服务中用作于API.
83+
API用于管理服务器.API列表格式使用URL来识别,比如,POST /api/query/file
84+
三段格式是固定的,第一个api固定值,第二个query表示API类型,第三个file表示api名
85+
支持的API列表参考:apilist.txt
86+
87+
## 秒传实现
88+
秒传的实现不是靠服务器实现的,而是靠客户端实现的.
89+
上传秒传的实现是先通过HASH查询文件是否在服务器,如果存在就不上传直接提示客户端上传成功.
90+
下载秒传的实现是先通过HASH查询本地文件保存路径,如果存在就直接下载完成.
91+
7692
## 参与贡献
7793

7894
1. Fork 本仓库

XEngine_Docment/Docment_en.docx

193 KB
Binary file not shown.

XEngine_Docment/Docment_zh.docx

104 KB
Binary file not shown.

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"tszIPAddr": "127.0.0.1",
33
"bDeamon": 0,
4-
"nCenterPort": 5001,
5-
"nStorageDLPort": 5002,
6-
"nStorageUPPort": 5003,
4+
"nCenterPort": 5000,
5+
"nStorageDLPort": 5001,
6+
"nStorageUPPort": 5002,
77
"XMax": {
88
"MaxClient": 10000,
99
"MaxQueue": 10000,
@@ -13,7 +13,8 @@
1313
"nStorageDLThread": 2
1414
},
1515
"XTime": {
16-
"bHBTime": 1,
16+
"bHBTime": 0,
17+
"nDBMonth": 3,
1718
"nTimeCheck": 3,
1819
"nCenterTimeOut": 5,
1920
"nStorageTimeOut": 5
@@ -24,13 +25,15 @@
2425
"LogLeave": 32
2526
},
2627
"XSql": {
27-
"SQLAddr": "127.0.0.1",
28+
"SQLAddr": "192.168.1.9",
2829
"SQLPort": 3306,
2930
"SQLUser": "root",
30-
"SQLPass": "123123aa"
31+
"SQLPass": "123123Ruiyue"
3132
},
3233
"XStorage": {
3334
"nUseMode": 1,
35+
"nHashMode": 2,
36+
"bRename": 0,
3437
"tszHttpAddr": "http://192.168.1.4",
3538
"tszNginAddr": "http://192.168.1.4:5010",
3639
"tszFileDir": "./XEngine_File"
@@ -41,7 +44,9 @@
4144
},
4245
"XVer": {
4346
"StorageVersion": [
47+
"1.2.0.1001 Build20210618",
48+
"1.1.0.1001 Build20210611",
4449
"1.0.0.1001 Build20210501"
4550
]
4651
}
47-
}
52+
}

XEngine_SQLFile/XEngine.sql

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
Navicat Premium Data Transfer
3+
4+
Source Server : 192.168.1.9
5+
Source Server Type : MySQL
6+
Source Server Version : 80025
7+
Source Host : 192.168.1.9:3306
8+
Source Schema : XEngine
9+
10+
Target Server Type : MySQL
11+
Target Server Version : 80025
12+
File Encoding : 65001
13+
14+
Date: 17/06/2021 17:19:26
15+
*/
16+
17+
SET NAMES utf8mb4;
18+
SET FOREIGN_KEY_CHECKS = 0;
19+
20+
-- ----------------------------
21+
-- Table structure for XStorage_Count
22+
-- ----------------------------
23+
DROP TABLE IF EXISTS `XStorage_Count`;
24+
CREATE TABLE `XStorage_Count` (
25+
`ID` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
26+
`FileCount` bigint NULL DEFAULT NULL COMMENT '文件总个数',
27+
`FileSize` bigint NULL DEFAULT NULL COMMENT '文件总大小',
28+
PRIMARY KEY (`ID`) USING BTREE
29+
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
30+
31+
-- ----------------------------
32+
-- Table structure for XStorage_User
33+
-- ----------------------------
34+
DROP TABLE IF EXISTS `XStorage_User`;
35+
CREATE TABLE `XStorage_User` (
36+
`ID` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
37+
`UserName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
38+
`UserPass` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
39+
`FileCount` bigint NOT NULL COMMENT '文件个数',
40+
`FileSize` bigint NOT NULL COMMENT '占用大小',
41+
`PhoneNumber` bigint NOT NULL COMMENT '电话号码',
42+
`IDNumber` bigint NOT NULL COMMENT '身份证号码',
43+
`PermissionLeave` tinyint NOT NULL COMMENT '权限级别',
44+
`Status` tinyint NULL DEFAULT NULL COMMENT '状态',
45+
`xhToken` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户临时句柄',
46+
`EMailAddr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '电子邮件地址',
47+
`IPAddr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最后登录IP地址',
48+
`CreateTime` datetime NOT NULL COMMENT '创建时间',
49+
PRIMARY KEY (`ID`) USING BTREE
50+
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
51+
52+
SET FOREIGN_KEY_CHECKS = 1;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
Navicat Premium Data Transfer
3+
4+
Source Server : 192.168.1.9
5+
Source Server Type : MySQL
6+
Source Server Version : 80025
7+
Source Host : 192.168.1.9:3306
8+
Source Schema : XEngine_Storage
9+
10+
Target Server Type : MySQL
11+
Target Server Version : 80025
12+
File Encoding : 65001
13+
14+
Date: 17/06/2021 17:19:07
15+
*/
16+
17+
SET NAMES utf8mb4;
18+
SET FOREIGN_KEY_CHECKS = 0;
19+
20+
-- ----------------------------
21+
-- Table structure for XStorage_File
22+
-- ----------------------------
23+
DROP TABLE IF EXISTS `XStorage_File`;
24+
CREATE TABLE `XStorage_File` (
25+
`ID` int NOT NULL AUTO_INCREMENT COMMENT 'ID序号',
26+
`FilePath` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件路径',
27+
`FileName` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件名称',
28+
`FileHash` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件HASH',
29+
`FileUser` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件所属用户',
30+
`FileSize` bigint NOT NULL COMMENT '文件大小',
31+
`FileTime` datetime NOT NULL COMMENT '插入时间',
32+
PRIMARY KEY (`ID`) USING BTREE
33+
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
34+
35+
SET FOREIGN_KEY_CHECKS = 1;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
qyt create sql file
3+
*/
4+
5+
6+
CREATE DATABASE `XEngine` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;
7+
CREATE DATABASE `XEngine_Storage` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;

XEngine_Source/Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@ UNICODE = 0
33

44
FLAGS = RELEASE=$(RELEASE)
55

6+
COMPONENTS_SQL_PATH = ./XEngine_StorageComponents/XStorage_SQLPacket
7+
COMPONENTS_PROTOCOL_PATH = ./XEngine_StorageComponents/XStorage_Protocol
8+
69
BASE_CONFIG_PATH = ./StorageModule_Config
710
BASE_SESSION_PATH = ./StorageModule_Session
811

912
APPSERVICE_STORAGE_PATH = ./XEngine_StorageApp
1013

11-
NETENGINE_LIB = libStorageModule_Config.so libStorageModule_Session.so \
12-
XEngine_StorageApp.exe
14+
NETENGINE_LIB = libXStorage_SQLPacket.so libXStorage_Protocol.so \
15+
libStorageModule_Config.so libStorageModule_Session.so \
16+
XEngine_StorageApp.exe
1317

1418
.PHONY:MakeAll
1519
MakeAll:$(NETENGINE_LIB)
1620

21+
libXStorage_SQLPacket.so:
22+
make -C $(COMPONENTS_SQL_PATH) $(FLAGS)
23+
libXStorage_Protocol.so:
24+
make -C $(COMPONENTS_PROTOCOL_PATH) $(FLAGS)
25+
1726
libStorageModule_Config.so:
1827
make -C $(BASE_CONFIG_PATH) $(FLAGS)
1928
libStorageModule_Session.so:

0 commit comments

Comments
 (0)