feat(礼包码): 礼包码类型区分

This commit is contained in:
luying
2023-06-14 20:19:25 +08:00
parent 0ed836abe7
commit 662429f7dc
6 changed files with 15 additions and 4 deletions

View File

@@ -275,6 +275,7 @@ export class UpdateGiftCode {
endTime: number; // 结束时间
codeLen: number; // 礼包码位数
remark: string = ''; // 备注
type: number; // 类型 0-游戏内 1-外链调用
constructor(id: number, obj: any) {
this.id = id;
@@ -284,6 +285,7 @@ export class UpdateGiftCode {
this.endTime = obj.endTime;
this.codeLen = obj.codeLen;
this.remark = obj.remark;
this.type = obj.type;
}
checkParams() {
@@ -295,6 +297,7 @@ export class UpdateGiftCode {
}
if(!isTimestamp(this.beginTime) || !isTimestamp(this.endTime)) return false;
if(!isNumber(this.codeLen) || this.codeLen <= 0) return false;
if(this.type != 0 && this.type != 1) return false;
return true;
}
}