Skip to content

Conversation

@coehgns
Copy link
Contributor

@coehgns coehgns commented Jul 28, 2025

Summary by CodeRabbit

  • 신규 기능
    • 일정 정보를 gRPC를 통해 조회할 수 있는 기능이 추가되었습니다.
    • 일정 타입과 날짜 정보를 포함하는 응답 포맷이 도입되었습니다.
    • 내부 일정 데이터와 gRPC 메시지 간 변환이 자동으로 처리됩니다.

@coehgns coehgns self-assigned this Jul 28, 2025
@coehgns coehgns added the Setup label Jul 28, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 28, 2025

Walkthrough

gRPC 서버 구현을 위한 새로운 클래스와 내부 응답 DTO, 그리고 도메인과 gRPC 메시지 간 변환을 담당하는 매퍼가 추가되었습니다. 이 변경으로 일정 타입별 조회 gRPC 서비스가 구현되었습니다.

Changes

Cohort / File(s) Change Summary
gRPC 서버 및 서비스 구현
.../infrastructure/grpc/server/ScheduleGrpcService.kt
gRPC 서버 서비스 클래스 ScheduleGrpcService 추가. 일정 타입별 조회 메서드와 의존성 주입 구현.
내부 응답 DTO 추가
.../infrastructure/grpc/server/dto/response/InternalScheduleResponse.kt
일정 타입과 날짜를 담는 내부 응답 데이터 클래스 InternalScheduleResponse 추가.
gRPC 매퍼 추가
.../infrastructure/grpc/server/mapper/ScheduleGrpcMapper.kt
도메인과 gRPC 메시지 간 변환을 담당하는 매퍼 클래스 ScheduleGrpcMapper 및 변환 메서드 추가.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ScheduleGrpcService
    participant QueryScheduleByTypeUseCase
    participant ScheduleGrpcMapper

    Client->>ScheduleGrpcService: getScheduleByType(TypeRequest)
    ScheduleGrpcService->>QueryScheduleByTypeUseCase: invoke(type)
    QueryScheduleByTypeUseCase-->>ScheduleGrpcService: InternalScheduleResponse
    ScheduleGrpcService->>ScheduleGrpcMapper: toGetScheduleByTypeResponse(InternalScheduleResponse)
    ScheduleGrpcMapper-->>ScheduleGrpcService: GetScheduleResponse
    ScheduleGrpcService-->>Client: GetScheduleResponse
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰
새로운 서버 hop, hop, hop!
일정 타입 물어보면 응답이 똑똑!
매퍼가 척척, 타입도 척척,
내부 DTO도 토실토실 귀엽게 등장!
gRPC 길 따라 당근 한 입,
코드의 숲에서 토끼는 또 뜁니다!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/13-gRPC

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate unit tests to generate unit tests for 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.

@coehgns coehgns changed the title Feature/13 g rpc Feature/13 gRPC Jul 29, 2025
* @param request 빈 요청 메시지 (Empty)
* @return ScheduleProto.SchedulesResponse 조회된 스케줄 목록이 포함된 응답
*/
@Transactional(readOnly = true)
Copy link

Choose a reason for hiding this comment

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

이거 try catch로 싸매야 하지 않나요? @coehgns

@coehgns coehgns closed this Jul 31, 2025
@coehgns coehgns reopened this Jul 31, 2025
@coehgns
Copy link
Contributor Author

coehgns commented Aug 2, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Aug 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coehgns
Copy link
Contributor Author

coehgns commented Aug 2, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Aug 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

♻️ Duplicate comments (1)
casper-schedule/src/main/kotlin/hs/kr/entrydsm/schedule/infrastructure/grpc/server/ScheduleGrpcService.kt (1)

30-37: 예외 처리 필요 (이전 리뷰 의견 반영)

이전 리뷰에서 언급된 대로 try-catch 블록으로 예외 처리를 해야 합니다. 또한 request.type.toString()로 타입 변환하는 방식이 적절한지 검토가 필요합니다.

 override suspend fun getScheduleByType(request: ScheduleServiceProto.TypeRequest): ScheduleServiceProto.GetScheduleResponse {
-    val schedule = queryScheduleByTypeUseCase.execute(request.type.toString())
-    val internalScheduleResponse = InternalScheduleResponse(
-        type = schedule.type,
-        date = schedule.date.toString()
-    )
-    return scheduleGrpcMapper.toGetScheduleByTypeResponse(internalScheduleResponse)
+    return try {
+        val schedule = queryScheduleByTypeUseCase.execute(request.type.name)
+        val internalScheduleResponse = InternalScheduleResponse(
+            type = schedule.type,
+            date = schedule.date.toString()
+        )
+        scheduleGrpcMapper.toGetScheduleByTypeResponse(internalScheduleResponse)
+    } catch (e: Exception) {
+        throw Status.NOT_FOUND
+            .withDescription("해당 타입의 스케줄을 찾을 수 없습니다: ${request.type}")
+            .withCause(e)
+            .asRuntimeException()
+    }

추가로 gRPC Status import가 필요합니다:

import io.grpc.Status
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 28262a1 and 073e26d.

📒 Files selected for processing (3)
  • casper-schedule/src/main/kotlin/hs/kr/entrydsm/schedule/infrastructure/grpc/server/ScheduleGrpcService.kt (1 hunks)
  • casper-schedule/src/main/kotlin/hs/kr/entrydsm/schedule/infrastructure/grpc/server/dto/response/InternalScheduleResponse.kt (1 hunks)
  • casper-schedule/src/main/kotlin/hs/kr/entrydsm/schedule/infrastructure/grpc/server/mapper/ScheduleGrpcMapper.kt (1 hunks)
🔇 Additional comments (5)
casper-schedule/src/main/kotlin/hs/kr/entrydsm/schedule/infrastructure/grpc/server/dto/response/InternalScheduleResponse.kt (2)

1-1: 패키지 경로 불일치 확인 필요

AI 요약에서는 이 파일이 hs.kr.entrydsm.schedule.infrastructure.grpc.server.dto.response 패키지에 있다고 했지만, 실제 코드에서는 hs.kr.entrydsm.schedule.infrastructure.grpc.dto.response 패키지로 선언되어 있습니다. 올바른 패키지 구조를 확인해 주세요.

Likely an incorrect or invalid review comment.


5-15: 깔끔한 DTO 구현입니다.

한국어 문서화와 함께 명확한 데이터 클래스 구조를 가지고 있습니다. 도메인과 인프라 계층 간의 데이터 전달 목적이 잘 드러납니다.

casper-schedule/src/main/kotlin/hs/kr/entrydsm/schedule/infrastructure/grpc/server/mapper/ScheduleGrpcMapper.kt (2)

5-5: Import 경로 불일치

Import문에서 hs.kr.entrydsm.schedule.infrastructure.grpc.dto.response.InternalScheduleResponse를 참조하고 있지만, 실제 파일에서는 hs.kr.entrydsm.schedule.infrastructure.grpc.server.dto.response 패키지 구조가 언급되었습니다. 일관된 패키지 구조를 확인해 주세요.

Likely an incorrect or invalid review comment.


19-26: 타입 매핑 구현이 깔끔합니다.

도메인 타입과 gRPC 프로토 타입 간의 매핑이 명확하고 유지보수하기 쉽게 구현되어 있습니다.

casper-schedule/src/main/kotlin/hs/kr/entrydsm/schedule/infrastructure/grpc/server/ScheduleGrpcService.kt (1)

17-21: 의존성 주입과 클래스 구조가 잘 설계되었습니다.

gRPC 서비스 어노테이션과 함께 필요한 의존성들이 명확하게 주입되어 있고, 상속 구조도 적절합니다.

@coehgns coehgns merged commit 5e9831b into main Aug 15, 2025
1 check passed
@coehgns coehgns deleted the feature/13-gRPC branch August 15, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants