Skip to content

Conversation

@kbt82883
Copy link
Collaborator

📣 Related Issue

📝 Summary

  • FastAPI로 호출한 로직에 사용된 ImageUploadResponseDTO에 clipScore 추가
  • createGenerateImage 정적메서드에 clipScore 추가하여 저장

🙏 Question & PR point

📬 Postman

@kbt82883 kbt82883 linked an issue Jul 18, 2025 that may be closed by this pull request
2 tasks
@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

📝 Walkthrough

Summary by CodeRabbit

  • 신규 기능

    • 이미지 생성 관련 항목에 clipScore(유사도 점수) 값이 추가되었습니다.
  • 테스트

    • clipScore 값에 대한 테스트 검증이 추가되고, 관련 테스트 데이터가 업데이트되었습니다.
    • 일부 테스트의 표시 이름에서 이모지가 제거되었습니다.

Walkthrough

clipScore 필드가 GenerateImage 엔티티 및 관련 DTO에 새롭게 추가되었습니다. 이 필드는 DB 컬럼으로도 반영되었으며, 생성/테스트 로직과 DTO에도 반영되어 값의 저장과 검증이 가능하도록 수정되었습니다. 테스트 코드 역시 clipScore 처리를 포함하도록 업데이트되었습니다.

Changes

파일/경로 요약 변경 내용 요약
src/main/java/or/sopt/houme/domain/generateImage/entity/GenerateImage.java clipScore 필드 및 DB 컬럼 추가, 팩토리 메서드에서 clipScore 설정 로직 반영
src/main/java/or/sopt/houme/global/dto/ImageUploadResponseDTO.java clipScore 필드 및 Setter 추가
src/test/java/or/sopt/houme/domain/generateImage/repository/...,
src/test/java/or/sopt/houme/domain/house/repository/...,
src/test/java/or/sopt/houme/domain/taste/repository/...,
src/test/java/or/sopt/houme/domain/user/repository/...
각 테스트 setUp에서 GenerateImageclipScore 값 세팅 추가
src/test/java/or/sopt/houme/domain/generateImage/service/GenerateImageServiceImplTest.java ImageUploadResponseDTOclipScore 값 포함, 관련 테스트에서 clipScore 값 검증 로직 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Service
    participant DTO
    participant Entity
    participant DB

    Client->>Service: 이미지 업로드 요청 (ImageUploadResponseDTO)
    Service->>DTO: DTO에 clipScore 포함
    Service->>Entity: GenerateImage.createGenerateImage(DTO, House)
    Entity->>DB: clipScore 포함하여 저장
    DB-->>Entity: 저장된 GenerateImage 반환
    Entity-->>Service: GenerateImage 반환
    Service-->>Client: 결과 응답 (clipScore 포함)
Loading

Suggested reviewers

  • gdbs1107
  • PBEM22

📜 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 4069827 and d025b5e.

📒 Files selected for processing (1)
  • src/test/java/or/sopt/houme/domain/generateImage/service/GenerateImageServiceImplTest.java (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/java/or/sopt/houme/domain/generateImage/service/GenerateImageServiceImplTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

@kbt82883 kbt82883 requested review from PBEM22 and gdbs1107 July 18, 2025 11:10
@kbt82883 kbt82883 self-assigned this Jul 18, 2025
@kbt82883 kbt82883 added ✨ feat 기능구현 ✊ 본탁 본탁 labels Jul 18, 2025
@coderabbitai coderabbitai bot added 🔢 chore 빌드 업무 수정, 패키지 매니저 수정, 자잘한 수정, 파일&디렉토리 수정,삭제 ✊ 재연 재연 labels Jul 18, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1a168d0 and 2ceb145.

📒 Files selected for processing (8)
  • src/main/java/or/sopt/houme/domain/generateImage/entity/GenerateImage.java (2 hunks)
  • src/main/java/or/sopt/houme/global/dto/ImageUploadResponseDTO.java (1 hunks)
  • src/test/java/or/sopt/houme/domain/generateImage/facade/GenerateImageFacadeTest.java (1 hunks)
  • src/test/java/or/sopt/houme/domain/generateImage/repository/GenerateImageRepositoryImplTest.java (1 hunks)
  • src/test/java/or/sopt/houme/domain/generateImage/service/GenerateImageServiceImplTest.java (4 hunks)
  • src/test/java/or/sopt/houme/domain/house/repository/HouseCustomRepositoryImplTest.java (3 hunks)
  • src/test/java/or/sopt/houme/domain/taste/repository/TagRepositoryImplTest.java (1 hunks)
  • src/test/java/or/sopt/houme/domain/user/repository/UserRepositoryImplTest.java (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
src/test/java/or/sopt/houme/domain/house/repository/HouseCustomRepositoryImplTest.java (1)
Learnt from: gdbs1107
PR: TEAM-HOUME/HOUME-SERVER#181
File: src/main/java/or/sopt/houme/domain/user/service/UserLandingServiceImpl.java:0-0
Timestamp: 2025-07-16T15:00:04.016Z
Learning: HOUME-SERVER 프로젝트에서 UserLandingServiceImpl의 getHasGeneratedImage API는 리프레시 토큰 유효성 검증이 목적이 아니라 사용자의 이미지 생성 여부를 확인하는 API임. 리프레시 토큰 검증은 별도의 refresh rotate 로직에서 처리하며, 이 API는 토큰이 없거나 유효하지 않은 경우 단순히 true를 반환하는 것이 의도된 동작임.
src/test/java/or/sopt/houme/domain/generateImage/service/GenerateImageServiceImplTest.java (2)
Learnt from: gdbs1107
PR: TEAM-HOUME/HOUME-SERVER#181
File: src/main/java/or/sopt/houme/domain/user/service/UserLandingServiceImpl.java:0-0
Timestamp: 2025-07-16T15:00:04.016Z
Learning: HOUME-SERVER 프로젝트에서 UserLandingServiceImpl의 getHasGeneratedImage API는 리프레시 토큰 유효성 검증이 목적이 아니라 사용자의 이미지 생성 여부를 확인하는 API임. 리프레시 토큰 검증은 별도의 refresh rotate 로직에서 처리하며, 이 API는 토큰이 없거나 유효하지 않은 경우 단순히 true를 반환하는 것이 의도된 동작임.
Learnt from: PBEM22
PR: TEAM-HOUME/HOUME-SERVER#120
File: src/main/java/or/sopt/houme/domain/generateImage/entity/GenerateImage.java:37-46
Timestamp: 2025-07-11T18:45:34.816Z
Learning: HOUME-SERVER 프로젝트에서 OpenAI 이미지 생성 API와 연동할 때, ImageUploadResponseDTO의 contentType 필드는 일반적인 MIME 타입(예: "image/jpeg")이 아닌 실제 파일 확장자(예: "jpg", "png")를 포함한다.
🔇 Additional comments (12)
src/test/java/or/sopt/houme/domain/generateImage/facade/GenerateImageFacadeTest.java (2)

230-230: 파일 끝 줄바꿈 추가 승인

파일 끝에 줄바꿈을 추가하는 것은 좋은 관례입니다.


116-118: 테스트에서 clipScore 필드 누락 확인 필요

새로 추가된 clipScore 필드가 ImageUploadResponseDTO에 포함되었지만, 이 테스트에서는 해당 필드를 설정하지 않고 있습니다. 다른 테스트 파일들과의 일관성을 위해 clipScore 값을 설정하는 것을 고려해보세요.

Also applies to: 201-203

src/test/java/or/sopt/houme/domain/taste/repository/TagRepositoryImplTest.java (1)

81-81: clipScore 필드 추가 승인

새로 추가된 clipScore 필드를 테스트 데이터에 적절히 설정했습니다. 테스트값 0.1234F는 적절합니다.

src/test/java/or/sopt/houme/domain/user/repository/UserRepositoryImplTest.java (1)

85-85: clipScore 필드 추가 승인

테스트 데이터 초기화에서 clipScore 필드를 올바르게 설정했습니다. 다른 테스트 파일들과 일관성을 유지하고 있습니다.

src/test/java/or/sopt/houme/domain/generateImage/repository/GenerateImageRepositoryImplTest.java (1)

68-68: clipScore 필드 추가 승인

테스트 데이터에서 clipScore 필드를 적절히 설정했습니다. 다른 테스트 파일들과 동일한 값을 사용하여 일관성을 유지하고 있습니다.

src/main/java/or/sopt/houme/global/dto/ImageUploadResponseDTO.java (1)

16-17: clipScore 필드 추가 승인

새로운 clipScore 필드가 적절히 추가되었습니다. nullable Float 타입과 @Setter 어노테이션을 사용하여 pullPrompt와 동일한 패턴을 따르고 있습니다.

src/test/java/or/sopt/houme/domain/house/repository/HouseCustomRepositoryImplTest.java (2)

72-72: clipScore 필드 추가가 적절합니다.

테스트 데이터 설정에서 clipScore 필드를 0.1234F로 설정한 것이 올바릅니다. 이는 새롭게 추가된 필드에 대한 테스트 데이터 일관성을 보장합니다.


82-82: 테스트 DisplayName에서 이모지 제거가 좋은 개선입니다.

테스트 메서드의 DisplayName에서 이모지를 제거한 것은 테스트 리포트의 가독성과 일관성을 향상시키는 좋은 변경입니다.

Also applies to: 94-94

src/main/java/or/sopt/houme/domain/generateImage/entity/GenerateImage.java (2)

33-34: clipScore 필드 정의가 올바릅니다.

새로운 clipScore 필드가 적절하게 정의되었습니다. Float 타입과 nullable = false 설정이 CLIP 점수 데이터의 특성에 맞습니다.


47-47: 정적 팩토리 메서드 업데이트가 적절합니다.

createGenerateImage 메서드에서 ImageUploadResponseDTO로부터 clipScore를 설정하는 로직이 올바르게 추가되었습니다.

src/test/java/or/sopt/houme/domain/generateImage/service/GenerateImageServiceImplTest.java (2)

46-46: 테스트 데이터 설정 개선이 좋습니다.

responseDTO를 인스턴스 변수로 추출하고 setUp() 메서드에서 초기화하는 것은 테스트 코드의 일관성과 재사용성을 향상시킵니다.

Also applies to: 74-80


88-88: 테스트 로직 업데이트가 올바릅니다.

createGenerateImage 테스트에서 사전 초기화된 responseDTO를 사용하고 clipScore에 대한 검증을 추가한 것이 적절합니다.

Also applies to: 92-95

…into feat/#197/clip-score

# Conflicts:
#	src/test/java/or/sopt/houme/domain/user/repository/UserRepositoryImplTest.java
@PBEM22
Copy link
Collaborator

PBEM22 commented Jul 18, 2025

📝 Code Coverage

Overall Project 70.87% 🍏
Files changed 100% 🍏

File Coverage
GenerateImage.java 88.28% 🍏

@github-actions
Copy link

github-actions bot commented Jul 18, 2025

Test Results

131 tests   131 ✅  8s ⏱️
 44 suites    0 💤
 44 files      0 ❌

Results for commit d025b5e.

♻️ This comment has been updated with latest results.

@gdbs1107 gdbs1107 moved this to In Progress in HOUME_SERVER Jul 18, 2025
@kbt82883 kbt82883 moved this from In Progress to In Hold in HOUME_SERVER Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✊ 본탁 본탁 ✊ 재연 재연 ✨ feat 기능구현 🔢 chore 빌드 업무 수정, 패키지 매니저 수정, 자잘한 수정, 파일&디렉토리 수정,삭제

Projects

Status: In Hold

Development

Successfully merging this pull request may close these issues.

[FEATURE] CLIP_SCORE 추가

3 participants