From 134f9aebb8e02365bdbd00f2a8ce640ac5797287 Mon Sep 17 00:00:00 2001 From: qiaoxin Date: Wed, 21 Apr 2021 14:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8A=BD=E5=8D=A1=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/domain/activityField/gachaField.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 shared/domain/activityField/gachaField.ts diff --git a/shared/domain/activityField/gachaField.ts b/shared/domain/activityField/gachaField.ts new file mode 100644 index 000000000..cfd2005c8 --- /dev/null +++ b/shared/domain/activityField/gachaField.ts @@ -0,0 +1,23 @@ +import { prop } from '@typegoose/typegoose'; +import { ActivityModelType } from '../../db/Activity'; +import { ActivityBase } from './activityField'; + + +// 抽卡数据 +export class GachaData extends ActivityBase { + @prop({ required: true }) + gachaId: number = 0; + @prop({ required: true }) + heroes: Array = []; + + + public initData(data: string) { + let obj = JSON.parse(data); + this.gachaId = obj.gachaId; + this.heroes = obj.heroes; + } + + constructor(activityData: ActivityModelType) { + super(activityData) + } +} \ No newline at end of file