cgserver 7.12.2113 → 7.14.2504
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/debug.log +8 -0
- package/dist/lib/Framework/Database/MongoBaseService.js +4 -1
- package/dist/lib/Framework/Database/MongoManager.js +11 -3
- package/dist/lib/Framework/index.js +3 -1
- package/dist/types/Framework/Database/MongoBaseService.d.ts +1 -1
- package/dist/types/Framework/Database/MongoManager.d.ts +5 -0
- package/dist/types/Framework/index.d.ts +1 -0
- package/package.json +1 -1
package/debug.log
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
[0704/133635.639:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
2
|
+
[0704/133639.210:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
3
|
+
[0704/133639.327:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
4
|
+
[0705/134804.446:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
5
|
+
[0705/134805.911:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
6
|
+
[0705/134805.944:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
7
|
+
[0705/155200.976:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
8
|
+
[0705/155201.034:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
@@ -19,7 +19,10 @@ class MongoBaseService {
|
|
|
19
19
|
this._t_type = type;
|
|
20
20
|
this._table = table;
|
|
21
21
|
}
|
|
22
|
-
async getNextId() {
|
|
22
|
+
async getNextId(key) {
|
|
23
|
+
if (!key) {
|
|
24
|
+
key = this._table;
|
|
25
|
+
}
|
|
23
26
|
let id = await MongoManager_1.GMongoMgr.getAutoIds(this._table);
|
|
24
27
|
return id;
|
|
25
28
|
}
|
|
@@ -98,6 +98,11 @@ class MongoManager {
|
|
|
98
98
|
Log_1.GLog.info("mongo try reconnect");
|
|
99
99
|
this.init(this._mongocfg);
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* 获取自增长id
|
|
103
|
+
* @param key
|
|
104
|
+
* @returns 小于等于0为异常
|
|
105
|
+
*/
|
|
101
106
|
async getAutoIds(key) {
|
|
102
107
|
if (!this._mongo) {
|
|
103
108
|
return -1;
|
|
@@ -108,14 +113,17 @@ class MongoManager {
|
|
|
108
113
|
let where = this._convertWhere({ _id: key });
|
|
109
114
|
let rs = await Core_1.core.safeCall(col.findOneAndUpdate, col, where, { $inc: { id: 1 } }, { upsert: true });
|
|
110
115
|
if (rs.ok) {
|
|
111
|
-
|
|
116
|
+
if (rs.value) {
|
|
117
|
+
return rs.value.id + 1;
|
|
118
|
+
}
|
|
119
|
+
return 0 + 1;
|
|
112
120
|
}
|
|
113
|
-
return
|
|
121
|
+
return -1;
|
|
114
122
|
}
|
|
115
123
|
catch (e) {
|
|
116
124
|
Log_1.GLog.error(e.stack);
|
|
117
125
|
}
|
|
118
|
-
return -
|
|
126
|
+
return -2;
|
|
119
127
|
}
|
|
120
128
|
_convertWhere(where) {
|
|
121
129
|
if (!where || !where._id) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MongoUserModel = exports.MysqlUserModel = exports.MongoUserService = exports.MysqlUserService = exports.GMongoAccountSer = exports.MongoAccountService = exports.GMysqlAccountSer = exports.MysqlAccountService = exports.EAccountFrom = exports.EUserState = exports.ERoleGroup = exports.GLog = exports.GHttpTool = exports.GCacheTool = exports.RedisManager = exports.GRedisMgr = exports.SqlReturns = exports.SqlReturn = exports.SqlResult = exports.GMysqlMgr = exports.MysqlBaseService = exports.GMSSqlMgr = exports.GMongoMgr = 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.GProtoFactory = exports.GCgServer = void 0;
|
|
4
|
-
exports.SyncCallServer = exports.SyncCall = exports.IRpcClientWebSocket = exports.IRpcServerWebSocket = exports.CgMqConfig = exports.CgMq = exports.RpcConfig = 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.BaseUserController = exports.BaseController = exports.IWebServer = exports.GWechatTool = exports.GWechatOATool = exports.GQQTool = exports.GQiniuTool = exports.GOpenSocial = exports.GEmailTool = exports.GAppleTool = exports.GSmsTool = exports.GAlipayTool = exports.BaseMsg = exports.IWebSocket = exports.ISocketServer = exports.IClientWebSocket = exports.IServerWebSocket = exports.JsonProtoFilter = exports.GoogleProtoFilter = exports.MongoCacheModel = exports.GMongoCacheSer = void 0;
|
|
4
|
+
exports.SyncCallServer = exports.SyncCall = exports.IRpcClientWebSocket = exports.IRpcServerWebSocket = exports.CgMqConfig = exports.CgMq = exports.RpcConfig = 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.BaseUserController = exports.BaseController = exports.IWebServer = exports.GWechatTool = exports.GWechatOATool = exports.GQQTool = exports.GQiniuTool = exports.GOpenSocial = exports.GEmailTool = exports.GAppleTool = exports.GSmsTool = exports.GAlipayTool = exports.BaseMsg = exports.IWebSocket = exports.ISocketServer = exports.IClientWebSocket = exports.IServerWebSocket = exports.JsonProtoFilter = exports.GoogleProtoFilter = exports.EProtoType = exports.MongoCacheModel = exports.GMongoCacheSer = void 0;
|
|
5
5
|
var cgserver_1 = require("./cgserver");
|
|
6
6
|
Object.defineProperty(exports, "GCgServer", { enumerable: true, get: function () { return cgserver_1.GCgServer; } });
|
|
7
7
|
var ProtoFactory_1 = require("./SocketServer/ProtoFilter/ProtoFactory");
|
|
@@ -95,6 +95,8 @@ Object.defineProperty(exports, "MongoUserModel", { enumerable: true, get: functi
|
|
|
95
95
|
var MongoCacheService_1 = require("./Service/MongoCacheService");
|
|
96
96
|
Object.defineProperty(exports, "GMongoCacheSer", { enumerable: true, get: function () { return MongoCacheService_1.GMongoCacheSer; } });
|
|
97
97
|
Object.defineProperty(exports, "MongoCacheModel", { enumerable: true, get: function () { return MongoCacheService_1.MongoCacheModel; } });
|
|
98
|
+
var IProtoFilter_1 = require("./SocketServer/ProtoFilter/IProtoFilter");
|
|
99
|
+
Object.defineProperty(exports, "EProtoType", { enumerable: true, get: function () { return IProtoFilter_1.EProtoType; } });
|
|
98
100
|
var GoogleProtoFilter_1 = require("./SocketServer/ProtoFilter/GoogleProtoFilter");
|
|
99
101
|
Object.defineProperty(exports, "GoogleProtoFilter", { enumerable: true, get: function () { return GoogleProtoFilter_1.GoogleProtoFilter; } });
|
|
100
102
|
var JsonProtoFilter_1 = require("./SocketServer/ProtoFilter/JsonProtoFilter");
|
|
@@ -50,6 +50,11 @@ declare class MongoManager {
|
|
|
50
50
|
onConnect(): void;
|
|
51
51
|
onEnd(): void;
|
|
52
52
|
onError(err: any): void;
|
|
53
|
+
/**
|
|
54
|
+
* 获取自增长id
|
|
55
|
+
* @param key
|
|
56
|
+
* @returns 小于等于0为异常
|
|
57
|
+
*/
|
|
53
58
|
getAutoIds(key: string): Promise<any>;
|
|
54
59
|
protected _convertWhere(where?: any): any;
|
|
55
60
|
/**
|
|
@@ -39,6 +39,7 @@ export { UserService as MongoUserService } from './Service/MongoUserService';
|
|
|
39
39
|
export { UserModel as MysqlUserModel } from './Service/UserService';
|
|
40
40
|
export { UserModel as MongoUserModel } from './Service/MongoUserService';
|
|
41
41
|
export { GMongoCacheSer, MongoCacheModel } from './Service/MongoCacheService';
|
|
42
|
+
export { EProtoType } from './SocketServer/ProtoFilter/IProtoFilter';
|
|
42
43
|
export { GoogleProtoFilter } from './SocketServer/ProtoFilter/GoogleProtoFilter';
|
|
43
44
|
export { IProtoFilter } from './SocketServer/ProtoFilter/IProtoFilter';
|
|
44
45
|
export { JsonProtoFilter } from './SocketServer/ProtoFilter/JsonProtoFilter';
|