-
Notifications
You must be signed in to change notification settings - Fork 0
Implement file CRUD #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b2495ed to
3c14ecc
Compare
w8385
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CRUD👍
utilForever
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우선 1차로 확인했습니다.
db93094 to
ca12b14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(
Co-authored-by: Chris Ohk <[email protected]>
0711dd6 to
5187ea1
Compare
utilForever
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰 대응하느라 고생하셨습니다.
w8385
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CRUD 구현 수고 많으셨습니다 !!!
파일 생성, 조회, 변경, 삭제를 구현하였습니다.
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