Skip to content

Conversation

@kimsh1017
Copy link
Member

@kimsh1017 kimsh1017 commented Nov 30, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

[문제 상황]

  • 행사 신청 화면을 위해 비회원도 이벤트 단건 조회가 가능해야 함
  • 현재는 단건 조회 API로 /common/events/{eventId} 를 사용해 SecurityFilter에서 토큰이 없는 비회원은 401 반환

[해결안]

  • 이벤트 조회 API를 참가자용 API (/participant/events)와 어드민용 API 로 분리
  • 참가자용 API는 기존에도 토큰 없이 조회가 가능 (permitAll()로 설정)
  • 동일한 응답을 하는 API를 두 개로 분리하는 것이 별로이긴 하지만, 역할이 다르므로 분리하는 것이 맞다고 판단
    향후에 두 API의 응답 필드가 달라질 가능성도 충분해 보임

📝 참고사항

스크린샷 2025-11-30 오후 9 22 04

📚 기타

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 관리자 영역에서 이벤트 조회 기능이 추가되었습니다.
    • 참여자 영역에서 이벤트 조회 기능이 추가되었습니다.
  • 개선

    • 이벤트 API 엔드포인트가 재구성되었습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@kimsh1017 kimsh1017 requested a review from a team as a code owner November 30, 2025 12:25
@coderabbitai
Copy link

coderabbitai bot commented Nov 30, 2025

📝 Walkthrough

Walkthrough

CommonEventController가 제거되고, 그 기능이 AdminEventController와 ParticipantEventController에 새로운 GET 엔드포인트로 분산됩니다. 각 컨트롤러에 /admin/events/{eventId}/participant/events/{eventId} 엔드포인트가 추가되어 EventService를 통해 이벤트 조회를 처리합니다.

Changes

Cohort / File(s) Summary
Admin 컨트롤러 확장
src/main/java/com/gdschongik/gdsc/domain/event/api/AdminEventController.java
GET /admin/events/{eventId} 엔드포인트 추가; eventService.getEvent(eventId) 호출하여 ResponseEntity<EventDto> 반환
Participant 컨트롤러 확장
src/main/java/com/gdschongik/gdsc/domain/event/api/ParticipantEventController.java
GET /participant/events/{eventId} 엔드포인트 추가; EventService 의존성 주입 및 getEvent(Long eventId) 메서드 구현
Common 컨트롤러 제거
src/main/java/com/gdschongik/gdsc/domain/event/api/CommonEventController.java
CommonEventController 클래스 전체 삭제; 이전 /common/events/{eventId} GET 엔드포인트 제거

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • 주의 사항:
    • CommonEventController 제거로 인한 기존 클라이언트 호출 경로 변경 확인 필요
    • AdminEventController와 ParticipantEventController의 동일한 메서드 구현으로 향후 코드 중복 가능성 검토
    • EventService.getEvent() 메서드의 권한 검사 또는 필터링 로직이 두 엔드포인트에서 동일하게 작동하는지 확인

Possibly related PRs

Poem

🐰 CommonController가 작별을 고하고
Admin과 Participant에 새 길을 내어주네
getEvent 메서드들 반짝반짝
이벤트 조회 경로 이제 더 명확하게
좋은 변화에 당근을 들고 축하합니다! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 공용 API를 어드민용과 참가자용으로 분리하는 주요 변경사항을 정확하게 요약하고 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/1280-event-api-seperate

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot changed the title refactor: 이벤트 조회 API 어드민용, 참가자용 분리 refactor: 이벤트 조회 공용 API를 어드민용 API와 참가자용 API로 분리 Nov 30, 2025
Copy link
Member

@kckc0608 kckc0608 left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions
Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

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 25bf4e0 and c33e63e.

📒 Files selected for processing (3)
  • src/main/java/com/gdschongik/gdsc/domain/event/api/AdminEventController.java (2 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/event/api/CommonEventController.java (0 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/event/api/ParticipantEventController.java (1 hunks)
💤 Files with no reviewable changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/event/api/CommonEventController.java
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-03T16:49:19.668Z
Learnt from: kckc0608
Repo: gdg-hongik-univ/gdsc-server PR: 1180
File: src/main/java/com/gdschongik/gdsc/domain/event/dto/request/AfterPartyUpdateTarget.java:3-7
Timestamp: 2025-09-03T16:49:19.668Z
Learning: AfterPartyUpdateTarget enum은 서비스 계층에서도 사용되므로 dto.request 패키지가 아닌 도메인 패키지에 위치해야 한다는 아키텍처 관점이 있다.

Applied to files:

  • src/main/java/com/gdschongik/gdsc/domain/event/api/AdminEventController.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: build-test
🔇 Additional comments (1)
src/main/java/com/gdschongik/gdsc/domain/event/api/ParticipantEventController.java (1)

3-27: EventDto import path is correct—no changes needed

The import path com.gdschongik.gdsc.domain.event.dto.dto.EventDto is the actual, legitimate package structure in the codebase. The nested dto.dto path reflects the directory structure at src/main/java/com/gdschongik/gdsc/domain/event/dto/dto/EventDto.java.

EventDto fields (eventId, name, venue, startAt, description, applicationPeriod, status flags, and capacity counts) contain no sensitive or admin-only information, making it safe for the public-facing participant endpoint.

SecurityConfig correctly restricts /admin/events to ADMIN role while allowing /participant/** as public access.

package com.gdschongik.gdsc.domain.event.api;

import com.gdschongik.gdsc.domain.event.application.EventService;
import com.gdschongik.gdsc.domain.event.dto.dto.EventDto;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

EventDto import 패키지 경로 오타로 인한 컴파일 오류 가능성

EventDto import가 현재 다음과 같이 되어 있습니다.

import com.gdschongik.gdsc.domain.event.dto.dto.EventDto;

패키지 계층을 보면 dto.dto 처럼 dto가 두 번 반복되는 구조는 비정상일 가능성이 높습니다. 실제 EventDto 클래스 위치를 한 번 확인하시고, 아래처럼 수정이 필요해 보입니다.

-import com.gdschongik.gdsc.domain.event.dto.dto.EventDto;
+import com.gdschongik.gdsc.domain.event.dto.EventDto;

단건 조회 메서드 자체(getEvent)는 eventService.getEvent(eventId)에 위임하고 200 OK로 감싸는 패턴이라, import만 올바르면 정상 동작할 것 같습니다.

Also applies to: 28-33

🤖 Prompt for AI Agents
In src/main/java/com/gdschongik/gdsc/domain/event/api/AdminEventController.java
around lines 4 and 28-33, the EventDto import path is incorrect (contains
duplicate dto segment) causing compile errors; open the file, verify the actual
package of EventDto (likely com.gdschongik.gdsc.domain.event.dto.EventDto),
replace the erroneous import com.gdschongik.gdsc.domain.event.dto.dto.EventDto
with the correct package, then recompile to ensure the getEvent method and other
references resolve correctly.

Copy link
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

rnt

@kimsh1017 kimsh1017 merged commit fa30d2e into develop Dec 2, 2025
4 checks passed
@kimsh1017 kimsh1017 deleted the refactor/1280-event-api-seperate branch December 2, 2025 12:18
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.

♻️ 이벤트 조회 공용 API를 어드민용 API와 참가자용 API로 분리

5 participants