Skip to content

Conversation

@Kimminu7
Copy link
Collaborator

@Kimminu7 Kimminu7 commented Jul 1, 2025

작업 내용

  • 파일 크기 제한 검사로직 추가 ( 이미지 업로드 )
  • 문제 수정, 삭제 시 DB내 데이터 존재하지 않게 로직 추가.

변경 사항


트러블 슈팅


해결해야 할 문제


참고 사항

postman크기제한
postman 내에서 자체적으로 파일 크기를 5MB 크기 제한을 함.


코드 리뷰 전 확인 체크리스트

  • 불필요한 콘솔 로그, 주석 제거
  • 커밋 메시지 컨벤션 준수 (type : )
  • 기능 정상 동작 확인

Summary by CodeRabbit

  • 신규 기능

    • 이미지 파일 업로드 시 5MB 용량 제한이 적용됩니다. 제한을 초과할 경우 업로드가 차단되고 안내 메시지가 표시됩니다.
    • 문제 정보를 저장하는 새로운 기능이 추가되었습니다.
  • 버그 수정

    • 문제 삭제 및 이미지 변경 시, 연관된 이미지 정보가 데이터베이스에서 확실히 제거되어 저장소와 데이터베이스 상태가 일치하도록 개선되었습니다.
  • 설정

    • 파일 업로드 최대 크기 및 요청 크기 제한이 5MB로 설정되었습니다.

Kimminu7 added 2 commits July 1, 2025 20:21
properties와 S3Uploader 클래스내에서 모두다 5MB 크기 제한

* PostMan에서는 자체적으로 크기제한을 걸어줌.
@Kimminu7 Kimminu7 self-assigned this Jul 1, 2025
@Kimminu7 Kimminu7 added the documentation Improvements or additions to documentation label Jul 1, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 1, 2025

"""

Walkthrough

이 변경사항은 S3에서 이미지 파일을 삭제한 후, Problem 엔티티의 imageUrl 컬렉션을 명시적으로 비우고 데이터베이스에 저장하여 상태를 일치시키도록 ProblemService를 수정합니다. 또한 파일 업로드 크기 제한(5MB) 검증 및 관련 예외 처리가 추가되었습니다.

Changes

파일/경로 요약 변경 내용 요약
src/main/java/org/ezcode/codetest/application/problem/service/ProblemService.java S3 이미지 삭제 후 imageUrl 컬렉션을 비우고 엔티티를 저장하도록 로직 추가
src/main/java/org/ezcode/codetest/domain/problem/service/ProblemDomainService.java saveProblem(Problem problem) 메서드 신규 추가
src/main/java/org/ezcode/codetest/infrastructure/s3/S3Uploader.java 업로드 파일 크기(5MB) 제한 및 초과 시 예외 처리, 내부 파라미터명 변경
src/main/java/org/ezcode/codetest/infrastructure/s3/exception/code/S3ExceptionCode.java 파일 크기 초과 예외 코드(S3_FILE_TOO_LARGE) 추가
src/main/resources/application.properties 멀티파트 파일 업로드 최대 크기 5MB로 설정하는 프로퍼티 신규 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ProblemService
    participant S3Uploader
    participant ProblemDomainService
    participant DB

    Client->>ProblemService: removeProblem(problemId)
    ProblemService->>S3Uploader: delete images from S3
    S3Uploader-->>ProblemService: deletion result
    ProblemService->>Problem: clear imageUrl collection
    ProblemService->>ProblemDomainService: saveProblem(problem)
    ProblemDomainService->>DB: save(problem)
    DB-->>ProblemDomainService: persisted
    ProblemDomainService-->>ProblemService: done
    ProblemService-->>Client: 완료 응답
Loading

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • minjee2758
  • NCookies
  • pokerbearkr
  • chat26666
  • thezz9

Poem

🐰
S3에 저장된 이미지를 쏙,
삭제 후 imageUrl도 싹!
5MB 넘는 파일은 안 돼요,
예외로 딱 잡아내요.
깔끔한 데이터, 토끼도 좋아해요!
🖼️✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 887a588 and 0add311.

📒 Files selected for processing (1)
  • src/main/resources/application.properties (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/resources/application.properties
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Kimminu7 Kimminu7 merged commit ed5ccb1 into dev Jul 1, 2025
2 checks passed
@Kimminu7 Kimminu7 deleted the refactor/problemS3 branch July 1, 2025 12:51
@coderabbitai coderabbitai bot mentioned this pull request Jul 2, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants