后台:添加一下便于操作的内容
This commit is contained in:
@@ -31,6 +31,13 @@ export default class Activity_GroupType extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async createDefaultActivityGroupType(uid = 1) {
|
||||
let result: ActivityGroupTypeInter = await ActivityGroupTypeModel.findOneAndUpdate({ groupType: 0 }, {
|
||||
$setOnInsert: { groupTypeName: "常规类型", activityTypes: [], createdBy: uid }, $set: { updatedBy: uid }
|
||||
}, { new: true, upsert: true }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async createActivityGroupType(groupTypeName: string, types: number[], uid = 1) {
|
||||
let activityTypes = types.map((value, index) => {
|
||||
return { index: index + 1, activityType: value };
|
||||
|
||||
@@ -118,6 +118,29 @@ export class UpdateRegionParams {
|
||||
}
|
||||
}
|
||||
|
||||
export class CreateRegionParam {
|
||||
name: string = ''; // 大区名
|
||||
prefix: string = ''; // 区名前缀
|
||||
remark: string = '';
|
||||
env: string = ''; // 环境变量
|
||||
gmLink: string; // 对应后台链接
|
||||
gameHost: string; // 长链接
|
||||
gmPort: number; // 后台使用的connector端口
|
||||
|
||||
constructor(obj: any) {
|
||||
for(let key in obj) {
|
||||
this[key] = obj[key];
|
||||
}
|
||||
}
|
||||
|
||||
checkParams() {
|
||||
if(!this.name || !this.prefix || !this.env || !this.gmLink || !this.gameHost || !this.gmPort || !isNumber(this.gmPort) ) {
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export class CreateServerParam {
|
||||
env: string = '';
|
||||
openTime: number = 0;
|
||||
|
||||
Reference in New Issue
Block a user