cgserver 9.1.22 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/lib/Framework/Database/Decorator/DBCache.js +1 -0
- package/dist/lib/Framework/Database/MysqlBaseService.js +4 -4
- package/dist/lib/Framework/Database/MysqlManager.js +57 -127
- package/dist/lib/Framework/Logic/Log.js +3 -3
- package/dist/lib/Framework/Service/MysqlAccountService.js +4 -4
- package/dist/lib/Framework/Service/MysqlUserService.js +3 -3
- package/dist/lib/Framework/index.js +3 -4
- package/dist/types/Framework/Database/MysqlManager.d.ts +9 -32
- package/dist/types/Framework/index.d.ts +1 -1
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -132,10 +132,10 @@ class MysqlBaseService {
|
|
|
132
132
|
async getById(id) {
|
|
133
133
|
let tm = null;
|
|
134
134
|
let sr = await MysqlManager_1.GMysqlMgr.query("select * from " + this._table + " where id=? limit 1", [id]);
|
|
135
|
-
if (sr.error || sr.
|
|
135
|
+
if (sr.error || sr.queryResult.length <= 0) {
|
|
136
136
|
return tm;
|
|
137
137
|
}
|
|
138
|
-
tm = sr.
|
|
138
|
+
tm = sr.result[0];
|
|
139
139
|
return tm;
|
|
140
140
|
}
|
|
141
141
|
async get(proterty, where, args) {
|
|
@@ -185,10 +185,10 @@ class MysqlBaseService {
|
|
|
185
185
|
sql += " where " + where;
|
|
186
186
|
}
|
|
187
187
|
let sr = await MysqlManager_1.GMysqlMgr.query(sql, args);
|
|
188
|
-
if (sr.error || sr.
|
|
188
|
+
if (sr.error || sr.queryResult.length <= 0) {
|
|
189
189
|
return 0;
|
|
190
190
|
}
|
|
191
|
-
return sr.
|
|
191
|
+
return sr.result[0]["num"] || 0;
|
|
192
192
|
}
|
|
193
193
|
async getRandoms(num, proterty, where, args) {
|
|
194
194
|
num = num || 5;
|
|
@@ -1,46 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GMysqlMgr = exports.SqlReturns = exports.SqlReturn = exports.
|
|
3
|
+
exports.GMysqlMgr = exports.SqlReturns = exports.SqlReturn = exports.MysqlConfig = void 0;
|
|
4
4
|
const _error_1 = require("./../Config/_error_");
|
|
5
5
|
const Log_1 = require("../Logic/Log");
|
|
6
|
-
const
|
|
6
|
+
const mysql2 = require("mysql2/promise");
|
|
7
7
|
class MysqlConfig {
|
|
8
8
|
open = false;
|
|
9
9
|
auto = false;
|
|
10
|
-
|
|
11
|
-
port = 3306;
|
|
12
|
-
user = 'root';
|
|
13
|
-
password = 'root';
|
|
14
|
-
database = 'gameall';
|
|
15
|
-
charset = 'utf8mb4';
|
|
16
|
-
supportBigNumbers = true;
|
|
17
|
-
connectionLimit = 100;
|
|
10
|
+
poolcfg = null;
|
|
18
11
|
}
|
|
19
12
|
exports.MysqlConfig = MysqlConfig;
|
|
20
|
-
class SqlResult {
|
|
21
|
-
/**
|
|
22
|
-
* select 的数据量
|
|
23
|
-
*/
|
|
24
|
-
length = 0;
|
|
25
|
-
/**
|
|
26
|
-
* 插入数据的自增id
|
|
27
|
-
*/
|
|
28
|
-
insertId = null;
|
|
29
|
-
/**
|
|
30
|
-
* update 更新数据的影响条数
|
|
31
|
-
*/
|
|
32
|
-
changedRows = null;
|
|
33
|
-
/**
|
|
34
|
-
* 插入或删除数据的影响条数
|
|
35
|
-
*/
|
|
36
|
-
affectedRows = null;
|
|
37
|
-
}
|
|
38
|
-
exports.SqlResult = SqlResult;
|
|
39
13
|
class SqlReturn {
|
|
40
14
|
error = null;
|
|
41
|
-
|
|
15
|
+
result = null;
|
|
42
16
|
fields = null;
|
|
43
17
|
list = null;
|
|
18
|
+
get queryResult() {
|
|
19
|
+
return this.result;
|
|
20
|
+
}
|
|
21
|
+
get execResult() {
|
|
22
|
+
return this.result;
|
|
23
|
+
}
|
|
44
24
|
}
|
|
45
25
|
exports.SqlReturn = SqlReturn;
|
|
46
26
|
class SqlReturns {
|
|
@@ -63,10 +43,12 @@ class MysqlManager {
|
|
|
63
43
|
|| !cfg.open) {
|
|
64
44
|
return;
|
|
65
45
|
}
|
|
66
|
-
this._pool =
|
|
46
|
+
this._pool = mysql2.createPool(cfg.poolcfg);
|
|
67
47
|
console.log("mysql config=" + JSON.stringify(cfg));
|
|
68
48
|
//这个的初始化位置不能变,必须位于cbs前,pool后
|
|
69
|
-
|
|
49
|
+
if (cfg.auto) {
|
|
50
|
+
await DBCache_1.GDBCache.init();
|
|
51
|
+
}
|
|
70
52
|
for (let i = 0; i < this._init_cbs.length; ++i) {
|
|
71
53
|
this._init_cbs[i]();
|
|
72
54
|
}
|
|
@@ -74,104 +56,52 @@ class MysqlManager {
|
|
|
74
56
|
registerInitCb(cb) {
|
|
75
57
|
this._init_cbs.push(cb);
|
|
76
58
|
}
|
|
77
|
-
query(sqlStr, values
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
59
|
+
async query(sqlStr, values) {
|
|
60
|
+
let sr = new SqlReturn();
|
|
61
|
+
if (!this._pool) {
|
|
62
|
+
//表示没有开通数据库,不用记录错误日志
|
|
63
|
+
sr.error = _error_1.EErrorCode.No_Mysql;
|
|
64
|
+
Log_1.GLog.error(sr.error);
|
|
65
|
+
return sr;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const [result, fields] = await this._pool.query(sqlStr, values);
|
|
69
|
+
sr.result = result;
|
|
70
|
+
let rs = result;
|
|
71
|
+
if (rs && rs.length) {
|
|
72
|
+
sr.list = [];
|
|
73
|
+
for (let i = 0; i < rs.length; ++i) {
|
|
74
|
+
sr.list.push(rs[i]);
|
|
93
75
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
sr.fields = fields;
|
|
104
|
-
conn.release();
|
|
105
|
-
if (error && !no_err_log) {
|
|
106
|
-
Log_1.GLog.error(error);
|
|
107
|
-
}
|
|
108
|
-
resolve(sr);
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
});
|
|
76
|
+
}
|
|
77
|
+
sr.fields = fields;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
sr.error = _error_1.EErrorCode.No_Mysql;
|
|
81
|
+
Log_1.GLog.error(sr.error);
|
|
82
|
+
return sr;
|
|
83
|
+
}
|
|
84
|
+
return sr;
|
|
112
85
|
}
|
|
113
|
-
transaction(sqls) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this._pool.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
86
|
+
async transaction(sqls) {
|
|
87
|
+
let srs = new SqlReturns();
|
|
88
|
+
try {
|
|
89
|
+
await this._pool.beginTransaction();
|
|
90
|
+
for (let i = 0; i < sqls.length; ++i) {
|
|
91
|
+
let sql = sqls[i];
|
|
92
|
+
let sr = await this.query(sql.sql, sql.values);
|
|
93
|
+
if (sr.error) {
|
|
94
|
+
srs.error = sr.error;
|
|
95
|
+
await this._pool.rollback();
|
|
96
|
+
return srs;
|
|
122
97
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
let funcs = [];
|
|
132
|
-
for (let i = 0; i < sqls.length; ++i) {
|
|
133
|
-
let sql = sqls[i];
|
|
134
|
-
funcs.push(() => {
|
|
135
|
-
conn.query(sql.sql, sql.values, (error, results, fields) => {
|
|
136
|
-
srs.srs.push(results);
|
|
137
|
-
if (error) {
|
|
138
|
-
return conn.rollback(() => {
|
|
139
|
-
Log_1.GLog.error(error);
|
|
140
|
-
srs.error = error;
|
|
141
|
-
conn.release();
|
|
142
|
-
resolve(srs);
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
if (funcs.length > 0) {
|
|
147
|
-
let f = funcs.shift();
|
|
148
|
-
f();
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
conn.commit((error) => {
|
|
152
|
-
if (error) {
|
|
153
|
-
return conn.rollback(() => {
|
|
154
|
-
srs.error = error;
|
|
155
|
-
Log_1.GLog.error(error);
|
|
156
|
-
conn.release();
|
|
157
|
-
resolve(srs);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
conn.release();
|
|
162
|
-
resolve(srs);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
let f = funcs.shift();
|
|
171
|
-
f();
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
});
|
|
98
|
+
}
|
|
99
|
+
await this._pool.commit();
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
srs.error = err;
|
|
103
|
+
Log_1.GLog.error(err);
|
|
104
|
+
}
|
|
175
105
|
}
|
|
176
106
|
}
|
|
177
107
|
exports.GMysqlMgr = new MysqlManager();
|
|
@@ -40,8 +40,8 @@ class Log {
|
|
|
40
40
|
colors.enable();
|
|
41
41
|
log4js.configure(cfg);
|
|
42
42
|
this._logger = log4js.getLogger(cfg.categories.default.appenders[0] || "log_date");
|
|
43
|
-
this._client_logger = log4js.getLogger(cfg.categories.
|
|
44
|
-
this._errorLogger = log4js.getLogger(cfg.categories.
|
|
43
|
+
this._client_logger = log4js.getLogger(cfg.categories.client_log_file.appenders[0] || "client_log_file");
|
|
44
|
+
this._errorLogger = log4js.getLogger(cfg.categories.error_log_file.appenders[0] || "error_log_file");
|
|
45
45
|
this._console_level = console_level;
|
|
46
46
|
}
|
|
47
47
|
_convertMsg(message) {
|
|
@@ -76,7 +76,7 @@ class Log {
|
|
|
76
76
|
this._errorLogger?.warn(message);
|
|
77
77
|
if (this._console_level >= 0) {
|
|
78
78
|
let time_str = this._getTimeStr();
|
|
79
|
-
console.
|
|
79
|
+
console.warn(time_str + " " + message);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
record(message) {
|
|
@@ -150,10 +150,10 @@ class MysqlAccountService extends MysqlBaseService_1.MysqlBaseService {
|
|
|
150
150
|
delete account.id;
|
|
151
151
|
let sr = await this.insert(account);
|
|
152
152
|
if (sr.error
|
|
153
|
-
|| !sr.
|
|
153
|
+
|| !sr.execResult.insertId) {
|
|
154
154
|
return null;
|
|
155
155
|
}
|
|
156
|
-
account.id = sr.
|
|
156
|
+
account.id = sr.execResult.insertId;
|
|
157
157
|
return account;
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
@@ -388,8 +388,8 @@ class MysqlAccountService extends MysqlBaseService_1.MysqlBaseService {
|
|
|
388
388
|
am.login_time = Date.now();
|
|
389
389
|
am.login_ip = ip;
|
|
390
390
|
let sr = await this.insert(am);
|
|
391
|
-
if (sr.
|
|
392
|
-
am.id = sr.
|
|
391
|
+
if (sr.execResult.insertId) {
|
|
392
|
+
am.id = sr.execResult.insertId;
|
|
393
393
|
}
|
|
394
394
|
else {
|
|
395
395
|
am = null;
|
|
@@ -143,7 +143,7 @@ class MysqlUserService extends MysqlBaseService_1.MysqlBaseService {
|
|
|
143
143
|
}
|
|
144
144
|
async updateBaseInfoByAccount(account_id, nickname, sex, logo) {
|
|
145
145
|
let sr = await this.updateProperty("nickname=?,sex=?,logo=?", "account_id=?", [nickname, sex, logo, account_id]);
|
|
146
|
-
if (sr.error && sr.
|
|
146
|
+
if (sr.error && sr.execResult.affectedRows <= 0) {
|
|
147
147
|
return "更新失败";
|
|
148
148
|
}
|
|
149
149
|
return;
|
|
@@ -151,14 +151,14 @@ class MysqlUserService extends MysqlBaseService_1.MysqlBaseService {
|
|
|
151
151
|
async add(account_id, nickname, sex, logo, group) {
|
|
152
152
|
let um = await this._createNewUser(account_id, nickname, sex, logo, group);
|
|
153
153
|
let sr = await this.insert(um);
|
|
154
|
-
if (sr.error || sr.
|
|
154
|
+
if (sr.error || sr.queryResult.length <= 0) {
|
|
155
155
|
return null;
|
|
156
156
|
}
|
|
157
157
|
return um;
|
|
158
158
|
}
|
|
159
159
|
async updateRoleGroup(user_id, role_group) {
|
|
160
160
|
let sr = await this.updateProperty("role_group=?", "id=?", [role_group, user_id]);
|
|
161
|
-
if (sr.error && sr.
|
|
161
|
+
if (sr.error && sr.execResult.affectedRows <= 0) {
|
|
162
162
|
return "更新失败";
|
|
163
163
|
}
|
|
164
164
|
return;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GMongoCacheSer = exports.MongoUserModel = exports.MysqlUserModel = exports.MongoUserService = exports.MysqlUserService = exports.MongoAccountService = exports.MysqlAccountService = exports.EAccountFrom = exports.EUserState = exports.ERoleGroup = exports.GLog = exports.GHttpTool = exports.GCacheTool = exports.RedisManager = exports.GRedisMgr = exports.SqlReturns = exports.SqlReturn = exports.
|
|
4
|
-
exports.RpcConfig = exports.CgMq = exports.Rpc = exports.RpcBaseMsg = exports.EAccountState = exports.GEventTool = exports.GSyncQueueTool = exports.WebServerConfig = exports.Response = exports.Request = exports.RazorJs = exports.Engine = exports.GCtrMgr = exports.JsonCreatorValidate = exports.JsonAuthorityValidate = exports.JsonAdminValidate = exports.CreatorValidate = exports.AuthorityValidate = exports.AdminValidate = exports.MongoAccountModel = exports.MysqlAccountModel = exports.MongoBaseUserController = exports.MysqlBaseUserController = exports.BaseController = exports.IWebServer = exports.GWechatTool = exports.GWechatOATool = exports.GQQTool = exports.GQiniuTool = exports.GEmailTool = exports.GAppleTool = exports.GSmsTool = exports.AlipayCallBack = exports.AlipayResult = exports.GAlipayTool = exports.BaseMsg = exports.IWebSocket = exports.ISocketServer = exports.IClientWebSocket = exports.IServerWebSocket = exports.JsonProtoFilter = exports.GoogleProtoFilter = exports.EProtoType = exports.GProtoFactory = exports.RedisConfig = exports.MysqlConfig = exports.MongoConfig = exports.MSSqlConfig = exports.DbConfig =
|
|
5
|
-
exports.GByteTool = exports.SyncCallServer2 = exports.SyncCallServer = exports.SyncCall2 = exports.SyncCall = exports.IRpcClientWebSocket =
|
|
3
|
+
exports.MongoCacheModel = exports.GMongoCacheSer = exports.MongoUserModel = exports.MysqlUserModel = exports.MongoUserService = exports.MysqlUserService = exports.MongoAccountService = exports.MysqlAccountService = exports.EAccountFrom = exports.EUserState = exports.ERoleGroup = exports.GLog = exports.GHttpTool = exports.GCacheTool = exports.RedisManager = exports.GRedisMgr = exports.SqlReturns = exports.SqlReturn = exports.GMysqlMgr = exports.MysqlBaseService = exports.GMSSqlMgr = exports.GMongoMgr = exports.MongoExt = exports.MongoManager = exports.MongoBaseModel = exports.MysqlBaseModel = exports.MongoBaseService = exports.EPropertyType = exports.Type = exports.Table = exports.Property = exports.PrimaryKey = exports.NotNull = exports.AutoIncrement = exports.Timer = exports.core = exports.GServerCfg = exports.IServerConfig = exports.FrameworkConfig = exports.Config = exports.FrameworkErrorCode = exports.GTriggerMgr = exports.Trigger = exports.Point = exports.Entity = exports.BehaviorAI = exports.AStar = exports.AiObject = exports.GDBCache = exports.GCgServer = void 0;
|
|
4
|
+
exports.IRpcServerWebSocket = exports.RpcConfig = exports.CgMq = exports.Rpc = exports.RpcBaseMsg = exports.EAccountState = exports.GEventTool = exports.GSyncQueueTool = exports.WebServerConfig = exports.Response = exports.Request = exports.RazorJs = exports.Engine = exports.GCtrMgr = exports.JsonCreatorValidate = exports.JsonAuthorityValidate = exports.JsonAdminValidate = exports.CreatorValidate = exports.AuthorityValidate = exports.AdminValidate = exports.MongoAccountModel = exports.MysqlAccountModel = exports.MongoBaseUserController = exports.MysqlBaseUserController = exports.BaseController = exports.IWebServer = exports.GWechatTool = exports.GWechatOATool = exports.GQQTool = exports.GQiniuTool = exports.GEmailTool = exports.GAppleTool = exports.GSmsTool = exports.AlipayCallBack = exports.AlipayResult = exports.GAlipayTool = exports.BaseMsg = exports.IWebSocket = exports.ISocketServer = exports.IClientWebSocket = exports.IServerWebSocket = exports.JsonProtoFilter = exports.GoogleProtoFilter = exports.EProtoType = exports.GProtoFactory = exports.RedisConfig = exports.MysqlConfig = exports.MongoConfig = exports.MSSqlConfig = exports.DbConfig = void 0;
|
|
5
|
+
exports.GByteTool = exports.SyncCallServer2 = exports.SyncCallServer = exports.SyncCall2 = exports.SyncCall = exports.IRpcClientWebSocket = void 0;
|
|
6
6
|
var cgserver_1 = require("./cgserver");
|
|
7
7
|
Object.defineProperty(exports, "GCgServer", { enumerable: true, get: function () { return cgserver_1.GCgServer; } });
|
|
8
8
|
var DBCache_1 = require("./Database/Decorator/DBCache");
|
|
@@ -64,7 +64,6 @@ var MysqlBaseService_2 = require("./Database/MysqlBaseService");
|
|
|
64
64
|
Object.defineProperty(exports, "MysqlBaseService", { enumerable: true, get: function () { return MysqlBaseService_2.MysqlBaseService; } });
|
|
65
65
|
var MysqlManager_1 = require("./Database/MysqlManager");
|
|
66
66
|
Object.defineProperty(exports, "GMysqlMgr", { enumerable: true, get: function () { return MysqlManager_1.GMysqlMgr; } });
|
|
67
|
-
Object.defineProperty(exports, "SqlResult", { enumerable: true, get: function () { return MysqlManager_1.SqlResult; } });
|
|
68
67
|
Object.defineProperty(exports, "SqlReturn", { enumerable: true, get: function () { return MysqlManager_1.SqlReturn; } });
|
|
69
68
|
Object.defineProperty(exports, "SqlReturns", { enumerable: true, get: function () { return MysqlManager_1.SqlReturns; } });
|
|
70
69
|
var RedisManager_1 = require("./Database/RedisManager");
|
|
@@ -1,53 +1,30 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as mysql2 from 'mysql2/promise';
|
|
2
2
|
export declare class MysqlConfig {
|
|
3
3
|
open: boolean;
|
|
4
4
|
auto: boolean;
|
|
5
|
-
|
|
6
|
-
port: number;
|
|
7
|
-
user: string;
|
|
8
|
-
password: string;
|
|
9
|
-
database: string;
|
|
10
|
-
charset: string;
|
|
11
|
-
supportBigNumbers: boolean;
|
|
12
|
-
connectionLimit: number;
|
|
13
|
-
}
|
|
14
|
-
export declare class SqlResult {
|
|
15
|
-
/**
|
|
16
|
-
* select 的数据量
|
|
17
|
-
*/
|
|
18
|
-
length: number;
|
|
19
|
-
/**
|
|
20
|
-
* 插入数据的自增id
|
|
21
|
-
*/
|
|
22
|
-
insertId: number;
|
|
23
|
-
/**
|
|
24
|
-
* update 更新数据的影响条数
|
|
25
|
-
*/
|
|
26
|
-
changedRows: number;
|
|
27
|
-
/**
|
|
28
|
-
* 插入或删除数据的影响条数
|
|
29
|
-
*/
|
|
30
|
-
affectedRows: number;
|
|
5
|
+
poolcfg: mysql2.PoolOptions;
|
|
31
6
|
}
|
|
32
7
|
export declare class SqlReturn {
|
|
33
8
|
error: any;
|
|
34
|
-
|
|
9
|
+
result: mysql2.QueryResult;
|
|
35
10
|
fields: any;
|
|
36
11
|
list: Array<any>;
|
|
12
|
+
get queryResult(): mysql2.RowDataPacket[];
|
|
13
|
+
get execResult(): mysql2.ResultSetHeader;
|
|
37
14
|
}
|
|
38
15
|
export declare class SqlReturns {
|
|
39
16
|
error: any;
|
|
40
|
-
srs: Array<
|
|
17
|
+
srs: Array<mysql2.QueryResult>;
|
|
41
18
|
}
|
|
42
19
|
export declare let GMysqlMgr: MysqlManager;
|
|
43
20
|
declare class MysqlManager {
|
|
44
21
|
protected _init_cbs: any[];
|
|
45
|
-
protected _pool:
|
|
22
|
+
protected _pool: mysql2.Pool;
|
|
46
23
|
get isValid(): boolean;
|
|
47
24
|
constructor();
|
|
48
25
|
init(cfg: MysqlConfig): Promise<void>;
|
|
49
26
|
registerInitCb(cb: Function): void;
|
|
50
|
-
query(sqlStr: any, values?: any
|
|
51
|
-
transaction(sqls: any): Promise<SqlReturns>;
|
|
27
|
+
query(sqlStr: any, values?: any): Promise<SqlReturn>;
|
|
28
|
+
transaction(sqls: any[]): Promise<SqlReturns>;
|
|
52
29
|
}
|
|
53
30
|
export {};
|
|
@@ -25,7 +25,7 @@ export { MongoBaseModel, MongoManager, MongoExt } from './Database/MongoManager'
|
|
|
25
25
|
export { GMongoMgr } from './Database/MongoManager';
|
|
26
26
|
export { GMSSqlMgr } from './Database/MSSqlManager';
|
|
27
27
|
export { MysqlBaseService } from './Database/MysqlBaseService';
|
|
28
|
-
export { GMysqlMgr,
|
|
28
|
+
export { GMysqlMgr, SqlReturn, SqlReturns } from './Database/MysqlManager';
|
|
29
29
|
export { GRedisMgr, RedisManager } from './Database/RedisManager';
|
|
30
30
|
export { GCacheTool } from './Logic/CacheTool';
|
|
31
31
|
export { GHttpTool } from './Logic/HttpTool';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cgserver",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"author": "trojan",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "free for all.Websocket or Http",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"@types/formidable": "^3.4.5",
|
|
39
39
|
"@types/mime": "^3.0.4",
|
|
40
40
|
"@types/mssql": "^9.1.5",
|
|
41
|
-
"@types/mysql": "^2.15.25",
|
|
42
41
|
"@types/node": "^20.11.20",
|
|
43
42
|
"@types/nodemailer": "^6.4.14",
|
|
44
43
|
"@types/redis": "^4.0.10",
|
|
@@ -65,7 +64,7 @@
|
|
|
65
64
|
"mime": "^3.0.0",
|
|
66
65
|
"mongodb": "^6.7.0",
|
|
67
66
|
"mssql": "^11.0.0",
|
|
68
|
-
"
|
|
67
|
+
"mysql2": "^3.10.2",
|
|
69
68
|
"nodemailer": "^6.9.10",
|
|
70
69
|
"process": "^0.11.10",
|
|
71
70
|
"protobufjs": "^7.2.6",
|