Skip to content

Conversation

@reddevilmidzy
Copy link
Member

파일 생성, 조회, 변경, 삭제를 구현하였습니다.
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

@reddevilmidzy reddevilmidzy self-assigned this Jun 29, 2025

This comment was marked as outdated.

@reddevilmidzy reddevilmidzy requested a review from Copilot June 29, 2025 09:57

This comment was marked as outdated.

This comment was marked as outdated.

w8385
w8385 previously approved these changes Jun 30, 2025
Copy link
Member

@w8385 w8385 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRUD👍

Copy link
Member

@utilForever utilForever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우선 1차로 확인했습니다.

Copy link

Copilot AI left a 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_manager module with models, handlers, and error types
  • Updated build_router in lib.rs to mount new CRUD routes under /problems
  • Added comprehensive Tokio tests in tests/file_manager/handlers.rs
  • Updated Cargo.toml with 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_content expects a 422 Unprocessable Entity. Consider adding a custom rejection handler or mapping the Json extractor error to return StatusCode::UNPROCESSABLE_ENTITY for missing content.
pub async fn update_file_content(

Copy link
Member

@utilForever utilForever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 리뷰 대응하느라 고생하셨습니다.

Copy link
Member

@w8385 w8385 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRUD 구현 수고 많으셨습니다 !!!

@reddevilmidzy reddevilmidzy merged commit adefc69 into main Jul 9, 2025
4 checks passed
@reddevilmidzy reddevilmidzy deleted the 36-file-manager branch July 9, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

파일 CRUD 구현

4 participants