From eea9e7cb8863908d6531a44d8ecc3dc1338638ef Mon Sep 17 00:00:00 2001 From: wlt233 <1486185683@qq.com> Date: Tue, 13 Aug 2024 10:07:51 +0800 Subject: [PATCH] implement sif unit --- sif/misc.py | 3 +++ sif/unit.py | 43 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/sif/misc.py b/sif/misc.py index 8f5c49b..f2ee932 100644 --- a/sif/misc.py +++ b/sif/misc.py @@ -25,6 +25,9 @@ async def gdpr_get(request: Request): @bp_sif_misc.route("/lbonus/execute", methods=["POST"]) @common_api async def lbonus_execute(request: Request): + + ### TODO - PLACEHOLDER ### + lbdays = { "day": 0, "day_of_the_week": 1, diff --git a/sif/unit.py b/sif/unit.py index b3cc37f..6368af7 100644 --- a/sif/unit.py +++ b/sif/unit.py @@ -19,8 +19,8 @@ async def unitAll(request: Request): active = [] for i in range(9): active.append({ - "unit_owning_user_id": 38383+i, - "unit_id": i+1, + "unit_owning_user_id": i, + "unit_id": i, "exp": 8000, "next_exp": 0, "level": 40, @@ -49,4 +49,43 @@ async def unitAll(request: Request): "active": active, "waiting": [] } + return resp + + + +@bp_sif_unit.route("deckInfo", methods=["POST"]) +@common_api +async def deckInfo(request: Request): + + ### TODO - PLACEHOLDER ### + + resp = [ + { + "unit_deck_id": 1, + "main_flag": True, + "deck_name": "队伍A", + "unit_owning_user_ids": [ + { "position": 1, "unit_owning_user_id": 0 }, + { "position": 2, "unit_owning_user_id": 1 }, + { "position": 3, "unit_owning_user_id": 2 }, + { "position": 4, "unit_owning_user_id": 3 }, + { "position": 5, "unit_owning_user_id": 4 }, + { "position": 6, "unit_owning_user_id": 5 }, + { "position": 7, "unit_owning_user_id": 6 }, + { "position": 8, "unit_owning_user_id": 7 }, + { "position": 9, "unit_owning_user_id": 8 } + ] + } + ] + return resp + + + +@bp_sif_unit.route("supporterAll", methods=["POST"]) +@common_api +async def supporterAll(request: Request): + + ### TODO - PLACEHOLDER ### + + resp = { "unit_support_list": [] } return resp \ No newline at end of file