后台:添加一下便于操作的内容

This commit is contained in:
luying
2021-12-31 16:26:59 +08:00
parent 4f9356c690
commit 096dad0185
7 changed files with 64 additions and 0 deletions
+7
View File
@@ -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 };
+23
View File
@@ -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;