✨ feat(礼包码): 礼包码类型区分
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user