Merged
Conversation
b2495ed to
3c14ecc
Compare
db93094 to
ca12b14
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds full CRUD support for problem-related file management, including creating, retrieving, listing, deleting, and updating both file contents and filenames. It also introduces end-to-end Tokio-based handler tests and updates routing and dependencies.
- Implemented
file_managermodule with models, handlers, and error types - Updated
build_routerinlib.rsto mount new CRUD routes under/problems - Added comprehensive Tokio tests in
tests/file_manager/handlers.rs - Updated
Cargo.tomlwith new dependencies (anyhow,uuid,serde, etc.)
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/mod.rs | Registers the new file_manager test module |
| tests/file_manager/handlers.rs | Adds full async tests for upload/get/list/delete/update |
| src/lib.rs | Nests /problems routes and includes new handlers |
| src/file_manager/models.rs | Defines FileMetadata, request types, and Language enum |
| src/file_manager/handlers.rs | Implements all file CRUD handlers |
| src/errors/language_error.rs | Defines LanguageError used in language parsing |
| Cargo.toml | Adds dependencies: anyhow, uuid, serde, etc. |
Comments suppressed due to low confidence (1)
src/file_manager/handlers.rs:244
- By default, Axum's Json extractor returns 400 Bad Request when required fields are missing, but the test
update_file_missing_contentexpects a 422 Unprocessable Entity. Consider adding a custom rejection handler or mapping the Json extractor error to return StatusCode::UNPROCESSABLE_ENTITY for missingcontent.
pub async fn update_file_content(
reddevilmidzy
commented
Jul 8, 2025
Co-authored-by: Chris Ohk <utilForever@gmail.com>
0711dd6 to
5187ea1
Compare
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.
파일 생성, 조회, 변경, 삭제를 구현하였습니다.
API 명세를 프론트엔드와 먼저 상의하진 않았었고 임의로 일단 구현했습니다. 프론트엔드에서 변경 요청이 있다면 수정하겠습니다.
파일 생성: POST
/problems/{problem_id}/{category}/"multipart/form-data"단일 파일 조회: GET
/problems/{problem_id}/{category}/{filename}/카테고리로 파일 조회: GET
/problems/{problem_id}/{category}/파일 삭제: DELETE
problems/{problem_id}/{category}/{filename}/파일 컨텐츠 변경: PUT
/problems/{problem_id}/{category}/{filename}/{ "content" : "" }파일 제목 변경: PUT
/problems/{problem_id}/{category}/{"old_filename": "", "new_filename": ""}revision 기능과 같이 PR을 올리면 파일변경이 너무 많아지고 또 리뷰하기 힘들 것 같아 나눴습니다.
close: #36