Skip to content

πŸ”¨ Fix - PDF μ—…λ‘œλ“œ presigned url 처리#801

Merged
GiHwan2 merged 1 commit into
devfrom
Fix/#796
Sep 1, 2025
Merged

πŸ”¨ Fix - PDF μ—…λ‘œλ“œ presigned url 처리#801
GiHwan2 merged 1 commit into
devfrom
Fix/#796

Conversation

@GiHwan2

@GiHwan2 GiHwan2 commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Related issue πŸ› 

closed #796

μ–΄λ–€ 변경사항이 μžˆμ—ˆλ‚˜μš”?

  • πŸ”¨ Fix: Feature change or bug fix

CheckPoint βœ…

PR이 λ‹€μŒ μš”κ΅¬ 사항을 μΆ©μ‘±ν•˜λŠ”μ§€ ν™•μΈν•˜μ„Έμš”.

  • PR μ»¨λ²€μ…˜μ— 맞게 μž‘μ„±ν–ˆμŠ΅λ‹ˆλ‹€. (ν•„μˆ˜)
  • μ½”λ“œκ°€ μ •μƒμ μœΌλ‘œ λ™μž‘ν•©λ‹ˆλ‹€. (ν•„μˆ˜)
  • μ½”λ“œ λ¦¬λ·°μ–΄μ—κ²Œ 리뷰λ₯Ό μš”μ²­ν–ˆμŠ΅λ‹ˆλ‹€. (ν•„μˆ˜)

Work Description ✏️

κ΄€λ¦¬μžκ°€ PDF νŒŒμΌμ„ μ—…λ‘œλ“œν•  λ•Œ presigned url을 μ‚¬μš©ν•˜μ—¬ ν΄λΌμ΄μ–ΈνŠΈμ—μ„œ 직접 S3에 μ—…λ‘œλ“œν•  수 μžˆλ„λ‘ μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€.

μ£Όμš” 변경사항

  • μƒˆλ‘œμš΄ API μΆ”κ°€: /v1/admins/orders/{orderId}/documents/pdf-presigned-url

    • κ΄€λ¦¬μžκ°€ PDF μ—…λ‘œλ“œλ₯Ό μœ„ν•œ presigned url을 μš”μ²­ν•  수 μžˆλŠ” μ—”λ“œν¬μΈνŠΈ μΆ”κ°€
    • μš”μ²­: λ¬Έμ„œ λͺ©λ‘κ³Ό μ—…λ‘œλ“œν•  PDF 정보
    • 응닡: S3 presigned url λͺ©λ‘κ³Ό μ—…λ‘œλ“œ μƒνƒœ 좔적을 μœ„ν•œ 정보
  • PDF μ—…λ‘œλ“œ μƒνƒœ 쑰회 API μΆ”κ°€: /v1/admins/orders/{orderId}/pdf-upload-status

    • κ΄€λ¦¬μžκ°€ PDF μ—…λ‘œλ“œ μ§„ν–‰ μƒνƒœλ₯Ό μ‹€μ‹œκ°„μœΌλ‘œ 확인할 수 μžˆλŠ” 쑰회 API
    • EPdfUploadStatus enum을 ν†΅ν•œ μƒνƒœ 관리 (IN_PROGRESS, WATERMARKING, COMPLETED, FAILED)
  • 도메인 λͺ¨λΈ κ°œμ„ :

    • DocumentService와 PdfServiceμ—μ„œ presigned url 생성 및 관리 둜직 κ΅¬ν˜„
  • S3 μœ ν‹Έλ¦¬ν‹° κ°œμ„ :

    • S3Util에 presigned url 생성 κΈ°λŠ₯ μΆ”κ°€
    • AWS μ„€μ • μ΅œμ ν™” 및 λ³΄μ•ˆ κ°•ν™”

Uncompleted Tasks πŸ˜…

N/A

To Reviewers πŸ“’

  • presigned url 생성 μ‹œ λ³΄μ•ˆ 정책이 μ˜¬λ°”λ₯΄κ²Œ μ μš©λ˜μ—ˆλŠ”μ§€ ν™•μΈν•΄μ£Όμ„Έμš”
  • PDF μ—…λ‘œλ“œ μƒνƒœ 좔적 둜직이 μ˜ˆμƒλŒ€λ‘œ λ™μž‘ν•˜λŠ”μ§€ κ²€ν† ν•΄μ£Όμ„Έμš”
  • S3 κΆŒν•œ 섀정이 μ μ ˆν•œμ§€ ν™•μΈν•΄μ£Όμ„Έμš”

@GiHwan2 GiHwan2 linked an issue Aug 28, 2025 that may be closed by this pull request
1 task
@coderabbitai

coderabbitai Bot commented Aug 28, 2025

Copy link
Copy Markdown

Walkthrough

κ΄€λ¦¬μžμš© PDF μ—…λ‘œλ“œμ— μ‚¬μ „μ„œλͺ… URL(put) 흐름을 μΆ”κ°€ν•˜κ³ , μ—…λ‘œλ“œ μƒνƒœ 쑰회 APIλ₯Ό λ„μž…ν–ˆλ‹€. AWS ꡬ성에 S3Presigner λΉˆμ„ λ“±λ‘ν•˜κ³  S3Util에 presign 생성 및 CloudFront μ„œλͺ… ν‚€ λ‘œλ”©μ„ μΆ”κ°€ν–ˆλ‹€. 컨트둀러 μ—”λ“œν¬μΈνŠΈμ™€ DTO, μœ μŠ€μΌ€μ΄μŠ€/μ„œλΉ„μŠ€, μ—…λ‘œλ“œ μƒνƒœ enum을 ν™•μž₯ν–ˆλ‹€.

Changes

Cohort / File(s) Change Summary
AWS ꡬ성 & S3 μœ ν‹Έ ν™•μž₯
src/main/java/com/tookscan/tookscan/core/config/AwsConfig.java, src/main/java/com/tookscan/tookscan/core/utility/S3Util.java
S3Presigner 빈 μΆ”κ°€. S3Util에 presigned PUT URL 생성 λ©”μ„œλ“œμ™€ PresignedUpload μΆ”κ°€, μƒμ„±μžμ— S3Presigner μ£Όμž…. CloudFront PEM κ°œμΈν‚€ λ‘œλ”© 헬퍼 λ„μž… 및 μ„œλͺ… 둜직 정리. S3 ν‚€ μ‚¬μš© 일관화.
μœ μŠ€μΌ€μ΄μŠ€/μ„œλΉ„μŠ€: presign μ—…λ‘œλ“œ
.../order/application/usecase/UploadAdminDocumentsPdfWithPresignedUrlUseCase.java, .../order/application/service/UploadAdminDocumentsPdfWithPresignedUrlService.java
μ‚¬μ „μ„œλͺ… URL 기반 μ—…λ‘œλ“œ μœ μŠ€μΌ€μ΄μŠ€/μ„œλΉ„μŠ€ μ‹ μ„€. 파일λͺ… 검증, 쀑볡 검사, Pdf μ—”ν‹°ν‹° 생성/배치 μ €μž₯, 15λΆ„ 만료 presign 생성, 응닡 λ§€ν•‘.
μœ μŠ€μΌ€μ΄μŠ€/μ„œλΉ„μŠ€: μ—…λ‘œλ“œ μƒνƒœ 쑰회
.../order/application/usecase/ReadAdminPdfUploadStatusUseCase.java, .../order/application/service/ReadAdminPdfUploadStatusService.java
μ—…λ‘œλ“œ μƒνƒœ 단건 쑰회 μœ μŠ€μΌ€μ΄μŠ€/μ„œλΉ„μŠ€ μΆ”κ°€. 리포지토리 쑰회 ν›„ DTO λ³€ν™˜ λ°˜ν™˜.
컨트둀러
.../order/presentation/controller/command/OrderAdminCommandV1Controller.java, .../order/presentation/controller/query/OrderAdminQueryV1Controller.java
Presign λ°œκΈ‰ POST /documents/{documentId}/pdfs μΆ”κ°€. κΈ°μ‘΄ λ©€ν‹°νŒŒνŠΈ μ—…λ‘œλ“œ 경둜λ₯Ό /documents/{documentId}/pdfs/upload둜 λ³€κ²½. μ—…λ‘œλ“œ μƒνƒœ 쑰회 GET /orders/documents/pdfs/{pdfId}/upload-status μΆ”κ°€.
DTO
.../presentation/dto/request/UploadAdminDocumentsPdfWithPresignedUrlRequestDto.java, .../presentation/dto/response/UploadAdminDocumentsPdfWithPresignedUrlResponseDto.java, .../presentation/dto/response/ReadAdminPdfUploadStatusResponseDto.java
μš”μ²­ DTO(record)둜 파일λͺ… 리슀트 μˆ˜μ‹ . 응닡 DTO에 μ—…λ‘œλ“œ ν•­λͺ©(Url, Headers 포함) ꡬ쑰 μΆ”κ°€. μƒνƒœ 쑰회 DTO μΆ”κ°€(μ™„λ£Œ μ‹œμ—λ§Œ κ΄€λ¦¬μžμš© URL 포함).
도메인 νƒ€μž…
.../order/domain/type/EPdfUploadStatus.java
μ—…λ‘œλ“œ μƒνƒœμ— WATERMARKING μΆ”κ°€ 및 fromString λ§€ν•‘ ν™•μž₯.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Admin as Admin
  participant CmdCtrl as OrderAdminCommandV1Controller
  participant UseCase as UploadAdminDocumentsPdfWithPresignedUrlService
  participant Repo as PdfRepository
  participant S3U as S3Util
  participant Presigner as S3Presigner

  Admin->>CmdCtrl: POST /documents/{documentId}/pdfs (파일λͺ… 리슀트)
  CmdCtrl->>UseCase: execute(documentId, requestDto)
  UseCase->>UseCase: 파일λͺ… μœ νš¨μ„±/쀑볡 검사
  UseCase->>Repo: Pdf μ—”ν‹°ν‹° 생성(μƒνƒœ=IN_PROGRESS) 배치 μ €μž₯
  loop 각 파일
    UseCase->>S3U: getPresignedPutUrlForPdf(document, storedFileName, originalName, 15m)
    S3U->>Presigner: Presign PUT(Object)
    Presigner-->>S3U: Presigned URL + Headers
    S3U-->>UseCase: URL, Headers
  end
  UseCase-->>CmdCtrl: μ—…λ‘œλ“œ 정보 리슀트 응닡
  CmdCtrl-->>Admin: 200 OK (pdfId, url, headers)
Loading
sequenceDiagram
  autonumber
  actor Admin as Admin
  participant QryCtrl as OrderAdminQueryV1Controller
  participant UC as ReadAdminPdfUploadStatusService
  participant Repo as PdfRepository

  Admin->>QryCtrl: GET /orders/documents/pdfs/{pdfId}/upload-status
  QryCtrl->>UC: execute(pdfId)
  UC->>Repo: findByIdOrElseThrow(pdfId)
  Repo-->>UC: Pdf
  UC-->>QryCtrl: ReadAdminPdfUploadStatusResponseDto
  QryCtrl-->>Admin: 200 OK (upload_status, pdf_url_for_admin?, name)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

κ·€ μ«‘κΈ‹, 깑총! μƒˆ 링크가 μ†Ÿμ•˜λ„€β€”
λ°”λžŒ 같은 presign, 15λΆ„ λΉ›λ‚˜λ„€.
μ—…λ‘œλ“œ λ›°κ³ , μ›Œν„°λ§ˆν‚Ή μΆ€μΆ”κ³ , μ™„μ£Όν•˜λ©΄ 링크 번쩍!
컨트둀러 λ‘λ“œλ € 띡동-μƒνƒœλ„ 확인 OK.
μ˜€λŠ˜λ„ λ‹Ήκ·Ό ν•œ μž…, λ°°ν¬λŠ” κΉ”λ”ν•˜κ²Œ. πŸ₯•βœ¨

Tip

πŸ”Œ Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


πŸ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

πŸ’‘ Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between ef8afc0 and b49ff0f.

πŸ“’ Files selected for processing (12)
  • src/main/java/com/tookscan/tookscan/core/config/AwsConfig.java (2 hunks)
  • src/main/java/com/tookscan/tookscan/core/utility/S3Util.java (5 hunks)
  • src/main/java/com/tookscan/tookscan/order/application/service/ReadAdminPdfUploadStatusService.java (1 hunks)
  • src/main/java/com/tookscan/tookscan/order/application/service/UploadAdminDocumentsPdfWithPresignedUrlService.java (1 hunks)
  • src/main/java/com/tookscan/tookscan/order/application/usecase/ReadAdminPdfUploadStatusUseCase.java (1 hunks)
  • src/main/java/com/tookscan/tookscan/order/application/usecase/UploadAdminDocumentsPdfWithPresignedUrlUseCase.java (1 hunks)
  • src/main/java/com/tookscan/tookscan/order/domain/type/EPdfUploadStatus.java (2 hunks)
  • src/main/java/com/tookscan/tookscan/order/presentation/controller/command/OrderAdminCommandV1Controller.java (4 hunks)
  • src/main/java/com/tookscan/tookscan/order/presentation/controller/query/OrderAdminQueryV1Controller.java (4 hunks)
  • src/main/java/com/tookscan/tookscan/order/presentation/dto/request/UploadAdminDocumentsPdfWithPresignedUrlRequestDto.java (1 hunks)
  • src/main/java/com/tookscan/tookscan/order/presentation/dto/response/ReadAdminPdfUploadStatusResponseDto.java (1 hunks)
  • src/main/java/com/tookscan/tookscan/order/presentation/dto/response/UploadAdminDocumentsPdfWithPresignedUrlResponseDto.java (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

πŸͺ§ 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.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@GiHwan2 GiHwan2 self-assigned this Aug 28, 2025
@GiHwan2 GiHwan2 added the πŸ”¨ Fix κΈ°λŠ₯ λ³€κ²½ or 버그 ν•΄κ²° label Aug 28, 2025
@GiHwan2 GiHwan2 merged commit a990e1f into dev Sep 1, 2025
3 checks passed
@GiHwan2 GiHwan2 deleted the Fix/#796 branch September 1, 2025 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

πŸ”¨ Fix κΈ°λŠ₯ λ³€κ²½ or 버그 ν•΄κ²°

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ”¨ Fix - PDF μ—…λ‘œλ“œ presigned url 처리

1 participant