Add DTO that contains decision from bot as well as the previous DTO (hard-coded bot decision for now)
This commit is contained in:
13
app.py
13
app.py
@ -5,6 +5,7 @@ from flask_cors import cross_origin
|
||||
|
||||
import config
|
||||
from dto.requests import GameStartRequestDTO, GameDecisionRequestDTO
|
||||
from dto.responses import GameStartResponseWithBotDecisionDTO
|
||||
from services.julius_baer_api_client import JuliusBaerApiClient
|
||||
|
||||
app = Flask(__name__)
|
||||
@ -18,7 +19,17 @@ def new_game():
|
||||
game_start_request = GameStartRequestDTO(player_name=config.API_TEAM)
|
||||
res = jb_client.start_game(game_start_request)
|
||||
|
||||
return res.model_dump_json()
|
||||
res_with_bot_decision = GameStartResponseWithBotDecisionDTO(
|
||||
message=res.message,
|
||||
session_id=res.session_id,
|
||||
player_id=res.player_id,
|
||||
client_id=res.client_id,
|
||||
client_data=res.client_data,
|
||||
score=res.score,
|
||||
bot_decision="Accept" # TODO: Get decision from bot
|
||||
)
|
||||
|
||||
return res_with_bot_decision.model_dump_json()
|
||||
|
||||
|
||||
@app.route('/next', methods=['POST'])
|
||||
|
Reference in New Issue
Block a user