后台:独立数据库,路径转发
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { COUNTER } from './../consts';
|
||||
import { CounterModel } from './Counter';
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import { index, getModelForClass, prop, DocumentType, mongoose } from '@typegoose/typegoose';
|
||||
const bcrypt = require('bcrypt');
|
||||
const SALT_WORK_FACTOR = 5
|
||||
|
||||
@@ -85,6 +85,11 @@ export default class GMUser extends BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
export const GMUserModel = getModelForClass(GMUser);
|
||||
export let GMUserModel;
|
||||
export function loadGMUserModel(connect: mongoose.Connection) {
|
||||
GMUserModel = getModelForClass(GMUser, {
|
||||
existingConnection: connect
|
||||
});
|
||||
}
|
||||
|
||||
export interface GMUserType extends Pick<DocumentType<GMUser>, keyof GMUser> { };
|
||||
|
||||
6
shared/db/index.ts
Normal file
6
shared/db/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { mongoose } from "@typegoose/typegoose";
|
||||
import { loadGMUserModel } from './GMUser'
|
||||
|
||||
export function loadGmDb(connect: mongoose.Connection) {
|
||||
loadGMUserModel(connect);
|
||||
}
|
||||
@@ -854,7 +854,7 @@ function parseDicParam() {
|
||||
* group为如果两个任务,除了condition以外的其他所有taskParam都是一样的,他们的group相同
|
||||
*/
|
||||
function treatTaskGroup() {
|
||||
console.log('****** treatTaskGroup')
|
||||
// console.log('****** treatTaskGroup')
|
||||
let taskType2Desc = new Map<number, DicTaskType>();
|
||||
for(let obj of gameData.taskTypeDesc) {
|
||||
taskType2Desc.set(obj.id, obj);
|
||||
@@ -883,7 +883,7 @@ function treatTaskGroup() {
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('****** taskByGroup', JSON.stringify([...taskByGroup]))
|
||||
// console.log('****** taskByGroup', JSON.stringify([...taskByGroup]))
|
||||
|
||||
for(let [taskType, arr] of taskByGroup) {
|
||||
let tasks = gameData.taskType.get(taskType);
|
||||
|
||||
Reference in New Issue
Block a user