issue26 問題詳細取得APIを追加 - #112
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #26
概要
現在のユーザーのactive runに紐づく問題詳細を取得する
GET /api/rooms/{room_id}/problems/{problem_id}を実装しました。変更内容
find_active_runで取得ProblemResponseとして返却PROBLEM_LOCKED(409)を返却RUN_NOT_FOUND(404)を返却Responseへ公開する情報
ResponseはOpenAPIの
ProblemResponseに明示されている次の情報だけを構築します。judge_config、正解操作、解答候補、hint本文、依存関係、is_requiredはrepositoryのSELECT対象およびresponseに含めていません。
Asset URL resolver
assetの
object_keyを公開URLへ変換するためのAssetUrlResolverinterfaceと、AppStateへの注入箇所を追加しました。本PRでは実際の公開base URL設定や具体的なresolver実装は行わず、#109へ残しています。
resolverやDBのエラーにはobject keyなどの内部情報を含めません。
テスト
PROBLEM_LOCKEDになること検証
mise run server-checkTEST_DATABASE_URL=<disposable MariaDB URL> mise run test-integrationgit diff --check