Skip to content

ddd#80

Merged
c5ln merged 4 commits into
developfrom
refactor/diary-with-comment-and-remove-item
Aug 24, 2025
Merged

ddd#80
c5ln merged 4 commits into
developfrom
refactor/diary-with-comment-and-remove-item

Conversation

@lejuho
Copy link
Copy Markdown
Collaborator

@lejuho lejuho commented Aug 24, 2025

Summary by CodeRabbit

  • New Features
    • 피드 항목이 통합되어 다양한 게시물 유형을 한눈에 볼 수 있게 되었으며, 피드 조회에 페이지네이션(페이지/사이즈)을 지원합니다.
  • Bug Fixes
    • 프록시/로드밸런서 환경에서 전달된 헤더 처리를 개선하여 원본 도메인/프로토콜 기반의 리다이렉트 및 절대 URL 생성이 더 정확해졌습니다.
  • Style
    • Swagger UI의 프로덕션 서버 항목 포맷을 정리했습니다(동작 변화 없음).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

피드 관련 DTO(enum 포함)와 컨트롤러/서비스에 페이징 및 통합 FeedResponse가 도입되고, application.yml에 server.forward-headers-strategy: framework 설정이 추가되었습니다. (50단어 이내)

Changes

Cohort / File(s) Change Summary
설정: 프록시 헤더 전략
src/main/resources/application.yml
server.forward-headers-strategy: framework 추가. swagger-ui 프로덕션 서버 설명은 의미상 불변, 포맷만 조정.
피드 응답 DTO
src/main/java/com/example/cp_main_be/domain/social/feed/dto/response/FeedResponse.java, src/main/java/com/example/cp_main_be/domain/social/feed/dto/response/PostType.java
새 레코드 FeedResponse(postId, postType, imageUrl, @JsonIgnore createdAt) 추가 및 정적 팩토리 from(Diary)/from(AvatarPost) 제공. PostType enum(DIARY, AVATAR_POST) 추가.
컨트롤러: 페이징 반영
src/main/java/com/example/cp_main_be/domain/social/feed/presentation/FeedController.java
getFeed 시그니처가 page(default 0), size(default 20) 파라미터를 받아 반환 타입을 List<FeedResponse>로 변경하고 서비스 호출에 페이징 인자를 전달하도록 수정.
서비스: 통합/페이징 로직
src/main/java/com/example/cp_main_be/domain/social/feed/service/FeedService.java
getFeed(UUID,String,int,int)로 시그니처 변경, Diary/AvatarPost를 FeedResponse로 매핑한 스트림 병합 후 createdAt 기준 정렬, 최종 페이지 범위의 서브리스트를 반환하도록 페이징 로직 재구성(카운트 대신 후보(limit) 페이징 후 합병·정렬·슬라이스). 여러 컬렉션·스트림/Collections 사용으로 구현 변경.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant FeedController
    participant FeedService
    participant DiaryRepo
    participant AvatarRepo

    Client->>FeedController: GET /feed?filter=X&page=P&size=S
    FeedController->>FeedService: getFeed(currentUserUuid, filter, P, S)
    FeedService->>DiaryRepo: findDiaries(candidatePageable)
    FeedService->>AvatarRepo: findAvatarPosts(candidatePageable)
    DiaryRepo-->>FeedService: List<Diary>
    AvatarRepo-->>FeedService: List<AvatarPost>
    FeedService->>FeedService: map to FeedResponse streams\nconcat streams -> sort by createdAt desc
    FeedService->>FeedService: slice start=P*S, end=min(start+S, total)
    FeedService-->>FeedController: List<FeedResponse> (paged)
    FeedController-->>Client: 200 OK { data: [...] }
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

새벽 들판에 코드 한 줄, 깡총깡총 나는 토끼예요 🐇
Feed가 모이고 정렬되니 발자국도 반짝반짝.
페이지는 나눠 담아 배달해요, 한 줌씩 쏴쏴—
헤더는 framework께 맡기고, 배포선율에 깡총!

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 1bbd465 and 666775c.

📒 Files selected for processing (4)
  • src/main/java/com/example/cp_main_be/domain/social/feed/dto/response/FeedResponse.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/feed/dto/response/PostType.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/feed/presentation/FeedController.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/feed/service/FeedService.java (3 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 refactor/diary-with-comment-and-remove-item

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.

@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR 본문이 비어있습니다!

아래 템플릿을 복사하여 PR 내용을 작성해주세요.


📝 개요

이번 PR의 핵심 내용을 한 줄로 요약해 주세요.


💻 작업 내용

이번 PR에서 작업한 내용을 상세히 설명해 주세요.

  • 작업 내용 1
  • 작업 내용 2
  • ...

✅ PR 체크리스트

PR을 보내기 전에 아래 체크리스트를 확인해 주세요.

  • 커밋 메시지는 포맷에 맞게 작성했나요?
  • 스스로 코드를 다시 한번 검토했나요?
  • 관련 이슈를 연결했나요?
  • 빌드 및 테스트가 로컬에서 성공했나요?

🔗 관련 이슈

이번 PR과 관련된 이슈 번호를 기재해 주세요.
예: Closes #123


스크린샷 (선택)

UI 변경 사항이 있다면 스크린샷을 첨부해 주세요.

xoruddl and others added 3 commits August 24, 2025 22:40
* refactor: 피드 조회 api dto 수정

* spotless apply

* spotless apply

* spotless apply

* spotless apply
@c5ln c5ln merged commit 37861bd into develop Aug 24, 2025
Copy link
Copy Markdown

@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: 0

🧹 Nitpick comments (2)
src/main/resources/application.yml (2)

78-82: Swagger 서버 설명 변경은 무해. 다만 URL/설명을 환경 변수로 외부화 고려

description: Production Server 형식 변경은 의미상 문제 없습니다. 운영/스테이징/개발 환경 분리를 깔끔히 하려면 URL과 설명을 프로파일별 환경 변수로 외부화하면 유지보수성이 좋아집니다. 예: ${SWAGGER_SERVER_URL}, ${SWAGGER_SERVER_DESC}. 프록시 헤더 전략 변경으로 Swagger의 서버 URL/스킴이 프록시 기준으로 노출되는지 함께 점검하세요(절대 URL 생성 시 예상과 다른 스킴/호스트가 보이는지).

가능한 개선 예시:

springdoc:
  swagger-ui:
    servers:
      - url: ${SWAGGER_SERVER_URL:https://api.napulnapul.com}
        description: ${SWAGGER_SERVER_DESC:Production Server}

82-82: 파일 끝 개행(Newline at EOF) 추가 필요

lint 경고가 있으므로 파일 끝에 개행을 추가해 주세요.

적용 예시:

-        description: Production Server
+        description: Production Server
+
📜 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 6570c49 and 1bbd465.

📒 Files selected for processing (1)
  • src/main/resources/application.yml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
src/main/resources/application.yml

[error] 82-82: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
src/main/resources/application.yml (1)

1-3: server.forward-headers-strategy 설정 검증 요청

다음 사항을 확인하였습니다. 추가 검증 및 인프라 환경 점검이 필요합니다:

  • Spring Boot 버전 호환성
    • build.gradle에 선언된 org.springframework.boot 버전이 3.5.3으로, server.forward-headers-strategy: framework를 지원합니다.
  • 중복 헤더 처리기 등록 여부
    • 코드베이스 내에 ForwardedHeaderFilter 수동 등록이나 Tomcat RemoteIpValve 설정 (server.tomcat.remoteip)이 없습니다.
  • 프록시 헤더 세탁(sanitization) 및 재작성 규칙
    • 코드 외부의 인프라(Nginx, Ingress 등)에서 신뢰 가능한 프록시만 Forwarded/X-Forwarded-* 헤더를 허용하도록 구성되어 있는지 운영팀과 함께 확인해주세요.
  • 프로파일 적용 범위
    src/main/resources/application.yml(1–3행)의 설정이 모든 프로파일에 적용되므로, 로컬 개발 환경 영향이나 의도치 않은 URL 재작성 방지를 위해 프로덕션 전용 프로파일(prod)로 제한 적용을 권장합니다.

[src/main/resources/application.yml:1–3]

@lejuho lejuho deleted the refactor/diary-with-comment-and-remove-item branch August 25, 2025 08:11
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.

3 participants