后台:大区列表

This commit is contained in:
luying
2021-12-04 18:47:01 +08:00
parent b8fff7cc83
commit 9e15773055
11 changed files with 282 additions and 227 deletions

View File

@@ -1,5 +1,7 @@
import { GM_MAIL_TYPE, MAIL_TIME_TYPE } from "../../consts";
import { GM_MAIL_TYPE, MAIL_TIME_TYPE, SERVER_TIMER } from "../../consts";
import { isArray } from 'underscore';
import GMMail from "../../db/GMMail";
import ServerStategy from "../../db/ServerStategy";
export class UpdateMailParams {
hasGoods: boolean = false; // 是否有道具
@@ -62,4 +64,41 @@ export class UpdateMailParams {
}
return true;
}
}
export class UpdateRegionParams {
id: number|'new' = 0; // 大区id
name: string = ''; // 大区名
prefix: string = ''; // 区名前缀
remark: string = '';
maxPlayerCnt: number = 0;
timers: SERVER_TIMER[] = [];
activityGroupId: number[] = [];
openMail?: GMMail;
circleMail?: GMMail;
stopRegisterTime: number = 0;
constructor(obj: UpdateRegionParams) {
for(let key in obj) {
this[key] = obj[key];
}
}
checkParams() {
if(!this.id || !this.name || !this.prefix || !this.maxPlayerCnt || !isArray(this.timers) || this.timers.length <= 0 || !isArray(this.activityGroupId) || this.activityGroupId.length <= 0 ) {
return false
}
return true;
}
getUpdateParam() {
let stategy = new ServerStategy(this);
return {
name: this.name,
prefix: this.prefix,
remark: this.remark,
stategy
}
}
}