TUK-3oon / hello-tarot-BE

hello-tarot project BackEnd
0 stars 1 forks source link

Custom Game API #33

Open hellojunho opened 1 month ago

hellojunho commented 1 month ago

This issue is for the API in Custom Game.

Below is the API Statement, if you have any issues or questions, please let me know about it.

POST: custom-game/rule/

Request

{
    "game_type_name":"health"
}

Response

{
    "data": {
        "game_type_id": "afcc644d-ff29-4ea6-9224-43ff867982db",
        "game_type_name": "health",
        "game_info": {
            "allCardNum": 78,
            "selectCardNum": 3,
            "fanCardNum": 1
        }
    }
}

POST: custom-game/start/

Request

{
    "game_type_id": "afcc644d-ff29-4ea6-9224-43ff867982db"
}   

Response

{
    "data": {
        "custom_game_id": "6e2259c3-8faf-4268-8be8-8ff41fefa293",
        "custom_game_primary_quest_from_server": "가장 고르고싶은 카드를 선택해주세요."
    }
}

POST: custom-game/question/

Request

{
    "custom_game_id": "6e2259c3-8faf-4268-8be8-8ff41fefa293",
    "custom_game_primary_quest_from_server": "가장 고르고싶은 카드를 선택해주세요.",
    "custom_game_primary_answer_from_user": "요즘 몸이 너무 안좋아. 앞으로 몸 상태가 어떻게 될까?"
}

Response

{
    "data": {
        "task_id": "bc93c3ab-c34c-4ffb-80fa-33a4c1bbdaa4"
    }
}

POST: custom-game/status/

Request

{
    "custom_game_id": "6e2259c3-8faf-4268-8be8-8ff41fefa293"
}

Response

{
    "data": {
        "success": "FINISHED"
    }
}

POST: custom-game/end/

Request

{
    "custom_game_id": "6e2259c3-8faf-4268-8be8-8ff41fefa293",
    "primary_select_card_id": "fed3926d-f346-414d-86c5-2a509a79818f",
    "secondary_select_card_id": "95a94cc4-a11b-4b34-b21e-58c1e9c3a39b",
    "tertiary_select_card_id": "8950a906-57a2-4471-8c7d-da10285236a3"
}

Response

{
    "data": {
        "task_id": "d56c799c-05ac-4980-b238-a27f26d7f896"
    }
}

POST: custom-game/status/

Request

{
    "custom_game_id": "6e2259c3-8faf-4268-8be8-8ff41fefa293"
}

Response

{
    "data": {
        "success": "STARTED"
    }
}

POST: game/answer/

Request

{
    "custom_game_id": "fe5ec6a1-1867-4595-9bfa-f837e9a6c69a"
}

Response

{
    "data": {
        "answer": "~~~~~~"
    }
}
hellojunho commented 1 month ago

In the Request in POST: custom-game/question/, "custom_game_primary_answer_from_user" is the client's input value.

hellojunho commented 1 month ago

This is a simple flowchart of the game.

스크린샷 2024-08-05 오전 12 33 07