From 2d114e2533b34048959bc26b6dfbe5652e54d6f7 Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 21 Apr 2021 14:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=8D=A1=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8A=BD=E5=8D=A1=E6=95=B0=E6=8D=AE=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/gachaService.ts | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 game-server/app/services/gachaService.ts diff --git a/game-server/app/services/gachaService.ts b/game-server/app/services/gachaService.ts new file mode 100644 index 000000000..a3b1338b6 --- /dev/null +++ b/game-server/app/services/gachaService.ts @@ -0,0 +1,30 @@ +import { GachaData } from "../domain/activityField/gachaField";; +import { ActivityModelType, ActivityModel } from "../db/Activity"; + +/** + * 获取活动页签里的限时卡池 + * + * @param aid 活动id + */ +export async function getLimitGacha(activityId: number) { + + let activityData: ActivityModelType = await ActivityModel.findActivity(activityId, true); + if(!activityData) return false; + + let gachaData = new GachaData(activityData); + + let { heroes, gachaId } = gachaData; + + return { + gachaId, + heroes, + pickHero: 0, + freeCount: 0, + refFreeTime: 0, + count: 0, + floor: [{ + id: 3, + count: 0 + }] + } +} \ No newline at end of file