Skip to content

Fix/ai 요청 api url 출력으로 변경#159

Merged
c5ln merged 5 commits into
developfrom
fix/ai-요청-api-바이너리-리퀘스트로-변경
Aug 27, 2025

Hidden character warning

The head ref may contain hidden characters: "fix/ai-\uc694\uccad-api-\ubc14\uc774\ub108\ub9ac-\ub9ac\ud018\uc2a4\ud2b8\ub85c-\ubcc0\uacbd"
Merged

Fix/ai 요청 api url 출력으로 변경#159
c5ln merged 5 commits into
developfrom
fix/ai-요청-api-바이너리-리퀘스트로-변경

Conversation

@c5ln
Copy link
Copy Markdown
Member

@c5ln c5ln commented Aug 27, 2025

Fix/ai 요청 api 스트링 출력으로 변경

Summary by CodeRabbit

• Refactor
• AI 이미지 처리 결과를 바이트 전송·스토리지 업로드 대신 AI 서버의 최종 이미지 URL로 직접 반환하도록 전환해 결과 접근성을 높이고 응답 흐름을 단순화했습니다.
• 원본 파일명과 콘텐츠 타입을 보존해 전송 신뢰성을 개선했습니다.
• URL 기반 응답 검증으로 오류 메시지와 로그 가독성을 개선했습니다.
• 이미지 생성 후 결과 링크 수신이 더 일관되고 빠르게 제공됩니다.
• 기존 기능과 호환성을 유지했습니다.

@c5ln c5ln self-assigned this Aug 27, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

AI 서버 응답을 바이트 배열에서 URL DTO(AiResponseDTO)로 전환했다. WebClient 요청 본문을 MultipartBodyBuilder로 재구성하고, 응답 파이프라인을 DTO 기반으로 수정했다. 스토리지 업로드 단계는 제거되었으며, 새 DTO 클래스 AiResponseDTO가 추가되었다.

Changes

Cohort / File(s) Summary
DTO 추가
src/main/java/.../avatar/image/AiResponseDTO.java
새 공개 DTO AiResponseDTO 추가. 필드: imageUrl(String). Lombok @Getter로 접근자 생성.
이미지 처리 서비스 리팩터링
src/main/java/.../avatar/image/service/ImageProcessingService.java
multipart 구성 방식을 MultipartBodyBuilder + ByteArrayResource로 교체. WebClient에서 BodyInserters.fromMultipartData(...) 사용 및 Content-Type: multipart/form-data 설정. 응답을 byte[]AiResponseDTO로 변경하고 imageUrl 검증/반환. 스토리지 업로드 로직 제거. 로깅 문구와 예외 처리 경로를 URL 기반으로 조정. 보조 메서드 동작은 유지.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Client as Caller
    participant Svc as ImageProcessingService
    participant AI as AI Server

    Client->>Svc: processImageWithAi(imageBytes, filename, contentType)
    Note right of Svc: MultipartBodyBuilder로<br/>ByteArrayResource 생성
    Svc->>AI: POST /process (multipart/form-data)
    AI-->>Svc: 200 OK + AiResponseDTO{imageUrl}
    alt imageUrl 유효
        Svc-->>Client: imageUrl 반환
    else 누락/에러
        Svc-->>Client: fallback 처리/에러
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

깡충, 깡충, 코드는 춤을 춘다
바이트 꾸러미 내려놓고 URL만 쥔다
토끼는 수신 확인, DTO에 미소 번진다
멀티파트 다듬고, 응답 길만 따른다
오늘의 한 입: imageUrl—달처럼 반짝인다 🌕🐇

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: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8f99098 and 45f365d.

📒 Files selected for processing (2)
  • src/main/java/com/example/cp_main_be/domain/avatar/image/AiResponseDTO.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/avatar/image/service/ImageProcessingService.java (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ai-요청-api-바이너리-리퀘스트로-변경

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

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

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

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.

@c5ln c5ln changed the title Fix/ai 요청 api 바이너리 리퀘스트로 변경 Fix/ai 요청 api url 출력으로 변경 Aug 27, 2025
@c5ln c5ln merged commit 715198b into develop Aug 27, 2025
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.

1 participant