cgserver 6.1.4 → 6.1.7

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.
@@ -100,7 +100,7 @@ class MongoManager {
100
100
  return 0 + 1;
101
101
  }
102
102
  catch (e) {
103
- Log_1.GLog.error(e);
103
+ Log_1.GLog.error(e.stack);
104
104
  }
105
105
  return -1;
106
106
  }
@@ -141,7 +141,7 @@ class MongoManager {
141
141
  }
142
142
  }
143
143
  catch (e) {
144
- Log_1.GLog.error(e);
144
+ Log_1.GLog.error(e.stack);
145
145
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
146
146
  }
147
147
  rs.one = one;
@@ -170,7 +170,7 @@ class MongoManager {
170
170
  list = await cursor.toArray();
171
171
  }
172
172
  catch (e) {
173
- Log_1.GLog.error(e);
173
+ Log_1.GLog.error(e.stack);
174
174
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
175
175
  }
176
176
  rs.list = list;
@@ -189,7 +189,7 @@ class MongoManager {
189
189
  count = await col.countDocuments(where || {}, options);
190
190
  }
191
191
  catch (e) {
192
- Log_1.GLog.error(e);
192
+ Log_1.GLog.error(e.stack);
193
193
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
194
194
  }
195
195
  rs.count = count;
@@ -208,7 +208,7 @@ class MongoManager {
208
208
  del_rs = await col.deleteOne(where || {});
209
209
  }
210
210
  catch (e) {
211
- Log_1.GLog.error(e);
211
+ Log_1.GLog.error(e.stack);
212
212
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
213
213
  }
214
214
  if (del_rs) {
@@ -229,7 +229,7 @@ class MongoManager {
229
229
  del_rs = await col.deleteMany(where || {});
230
230
  }
231
231
  catch (e) {
232
- Log_1.GLog.error(e);
232
+ Log_1.GLog.error(e.stack);
233
233
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
234
234
  }
235
235
  if (del_rs) {
@@ -254,7 +254,7 @@ class MongoManager {
254
254
  in_rs = await col.insertOne(data);
255
255
  }
256
256
  catch (e) {
257
- Log_1.GLog.error(e);
257
+ Log_1.GLog.error(e.stack);
258
258
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
259
259
  }
260
260
  rs.rs = in_rs;
@@ -272,7 +272,7 @@ class MongoManager {
272
272
  in_rs = await col.insertMany(data);
273
273
  }
274
274
  catch (e) {
275
- Log_1.GLog.error(e);
275
+ Log_1.GLog.error(e.stack);
276
276
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
277
277
  }
278
278
  rs.rs = in_rs;
@@ -292,19 +292,11 @@ class MongoManager {
292
292
  }
293
293
  let up_rs = null;
294
294
  try {
295
- let updateModel = null;
296
- let firstKey = Object.keys(model)[0];
297
- if (!firstKey.startsWith("$")) {
298
- updateModel = { $set: model };
299
- }
300
- else {
301
- updateModel = model;
302
- }
303
295
  let col = this._mongo.collection(collection);
304
- up_rs = await col.updateOne(where, updateModel, { upsert: upsert });
296
+ up_rs = await col.updateOne(where, model, { upsert: upsert });
305
297
  }
306
298
  catch (e) {
307
- Log_1.GLog.error(e);
299
+ Log_1.GLog.error(e.stack);
308
300
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
309
301
  }
310
302
  rs.rs = up_rs;
@@ -334,7 +326,7 @@ class MongoManager {
334
326
  up_rs = await col.updateMany(where, updateModel, { upsert: upsert });
335
327
  }
336
328
  catch (e) {
337
- Log_1.GLog.error(e);
329
+ Log_1.GLog.error(e.stack);
338
330
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
339
331
  }
340
332
  rs.rs = up_rs;
@@ -352,7 +344,7 @@ class MongoManager {
352
344
  i_rs = await col.createIndex(index, callback);
353
345
  }
354
346
  catch (e) {
355
- Log_1.GLog.error(e);
347
+ Log_1.GLog.error(e.stack);
356
348
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
357
349
  }
358
350
  rs.rs = i_rs;
@@ -383,7 +375,7 @@ class MongoManager {
383
375
  }
384
376
  }
385
377
  catch (e) {
386
- Log_1.GLog.error(e);
378
+ Log_1.GLog.error(e.stack);
387
379
  rs.errcode = _error_1.EErrorCode.Mongo_Error;
388
380
  }
389
381
  rs.list = list;
@@ -8,9 +8,7 @@ declare class ControllerManager {
8
8
  };
9
9
  protected _ctr_cls: {
10
10
  [module_name: string]: {
11
- [ctrname: string]: {
12
- new (): BaseController;
13
- };
11
+ [ctrname: string]: any;
14
12
  };
15
13
  };
16
14
  protected _cache_action_names: {
@@ -20,9 +18,7 @@ declare class ControllerManager {
20
18
  };
21
19
  };
22
20
  };
23
- registerController(module_name: string, ctr_name: string, cls: {
24
- new (): BaseController;
25
- }): void;
21
+ registerController(module_name: string, ctr_name: string, cls: any): void;
26
22
  protected _cacheActionName(module_name: string, ctr_name: string, cls: Function): void;
27
23
  getActionName(module_name: string, ctr_name: string, action_name: string): string;
28
24
  /**
@@ -34,6 +30,6 @@ declare class ControllerManager {
34
30
  registerStaticController(module_name: string, ctr_name: string, obj: BaseController): void;
35
31
  protected _cacheActionNameForStatic(module_name: string, ctr_name: string, obj: BaseController): void;
36
32
  getStaticCtr(module_name: string, controller_name: string): BaseController;
37
- getClass(module_name: string, controller_name: string): new () => BaseController;
33
+ getClass(module_name: string, controller_name: string): any;
38
34
  }
39
35
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "6.1.4",
3
+ "version": "6.1.7",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",