Skip to content

Feat/#6#25

Closed
Hgyeol wants to merge 10 commits intodevelopfrom
feat/#6
Closed

Feat/#6#25
Hgyeol wants to merge 10 commits intodevelopfrom
feat/#6

Conversation

@Hgyeol
Copy link
Member

@Hgyeol Hgyeol commented Jul 9, 2025

📌 [feat#6] 수업 API


📑 개요

수업실 API


✅ 작업 내용

  • 수업 만들기
  • 수업 들어가기
  • 내 수업 다 보기

📌 체크리스트

  • 코드 컨벤션을 지켰나요?
  • 커밋 메시지 컨벤션을 지켰나요?
  • 테스트를 완료했나요?

👨‍💻 리뷰어에게 하고 싶은 말

Summary by CodeRabbit

  • 신규 기능

    • 교실(클래스룸) 생성, 조회, 관리 기능이 추가되었습니다. 교사 역할의 사용자는 새로운 교실을 생성할 수 있으며, 사용자는 자신이 속한 교실 목록을 확인할 수 있습니다.
  • 버그 수정

    • JWT 토큰에 사용자 ID가 포함되어 인증 및 토큰 재발급 과정에서 더욱 정확한 사용자 식별이 가능합니다.
  • 환경 설정

    • 데이터베이스 연결 주소가 변경되었습니다.
    • 불필요한 외부 API 설정이 제거되었습니다.
  • 기타

    • 내부 로그 및 디버그 메시지가 정리되었습니다.

Hgyeol added 10 commits June 17, 2025 23:58
# Conflicts:
#	postgres-data/base/1/pg_internal.init
#	postgres-data/base/16384/pg_internal.init
#	postgres-data/base/5/pg_internal.init
#	postgres-data/global/pg_control
#	postgres-data/global/pg_internal.init
#	postgres-data/pg_stat/pgstat.stat
#	postgres-data/pg_wal/000000010000000000000001
#	src/main/java/hello/cluebackend/domain/user/domain/UserEntity.java
@coderabbitai
Copy link

coderabbitai bot commented Jul 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

이번 변경 사항은 클래스룸(교실) 도메인 기능의 도입 및 JWT 토큰에 userId 정보를 포함하는 구조적 확장을 중심으로 이루어졌습니다. 새로운 엔티티, DTO, 서비스, 컨트롤러, 리포지토리가 추가되었으며, 기존 유저 도메인 및 JWT 처리 로직도 이에 맞게 수정되었습니다.

Changes

파일/경로 요약 변경 요약
src/main/java/hello/cluebackend/domain/classroom/domain/ClassRoom.java
src/main/java/hello/cluebackend/domain/classroomuser/domain/ClassRoomUser.java
src/main/java/hello/cluebackend/domain/classroom/presentation/dto/ClassRoomDTO.java
클래스룸 및 클래스룸-유저 매핑을 위한 JPA 엔티티, DTO 신규 추가
src/main/java/hello/cluebackend/domain/classroom/domain/repository/ClassRoomRepository.java
src/main/java/hello/cluebackend/domain/classroomuser/domain/repository/ClassRoomUserRepository.java
클래스룸 및 클래스룸유저용 Spring Data JPA 리포지토리 신규 추가
src/main/java/hello/cluebackend/domain/classroom/presentation/ClassRoomController.java 클래스룸 REST 컨트롤러 신규 추가 (생성, 조회, 내 교실 목록)
src/main/java/hello/cluebackend/domain/classroom/service/ClassRoomService.java 클래스룸 서비스 신규 추가 (생성, 조회, 내 교실 목록)
src/main/java/hello/cluebackend/domain/user/domain/UserEntity.java 테이블명 변경, 클래스룸유저 연관관계 추가, 생성일 자동 설정, DTO 변환 시 userId 포함
src/main/java/hello/cluebackend/domain/user/presentation/dto/UserDTO.java userId 필드 및 생성자 파라미터 추가
src/main/java/hello/cluebackend/domain/user/presentation/dto/CustomOAuth2User.java getUserId, getStudentId 메서드 추가
src/main/java/hello/cluebackend/global/config/JWTUtil.java JWT 생성 시 userId 포함, userId 추출 메서드 추가
src/main/java/hello/cluebackend/global/config/CustomSuccessHandler.java
src/main/java/hello/cluebackend/global/security/jwt/RefreshTokenService.java
JWT 생성 시 userId 포함하도록 내부 로직 수정 및 일부 디버깅 코드 제거
src/main/resources/application.yaml DB 호스트 변경, spring.neis.api 설정 삭제
docker-compose.yaml redis 서비스 포트 매핑 뒤에 공백 줄 추가 (기능 영향 없음)

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ClassRoomController
    participant ClassRoomService
    participant ClassRoomRepository
    participant ClassRoomUserRepository
    participant UserRepository

    Client->>ClassRoomController: POST /api/class/create-room (JWT 포함)
    ClassRoomController->>ClassRoomService: createClassRoom(classRoomDTO, userId)
    ClassRoomService->>ClassRoomDTO: generateCode()
    ClassRoomService->>ClassRoomRepository: save(classRoom)
    ClassRoomService->>UserRepository: findById(userId)
    ClassRoomService->>ClassRoomUserRepository: save(classRoomUser)
    ClassRoomService-->>ClassRoomController: 생성 결과 반환
    ClassRoomController-->>Client: HTTP 201/400/403 응답
Loading
sequenceDiagram
    participant Client
    participant ClassRoomController
    participant ClassRoomService
    participant ClassRoomUserRepository

    Client->>ClassRoomController: GET /api/class/request (JWT 포함)
    ClassRoomController->>ClassRoomService: findMyClassRoomById(userId)
    ClassRoomService->>ClassRoomUserRepository: findByUser_UserId(userId)
    ClassRoomService-->>ClassRoomController: ClassRoomDTO 리스트 반환
    ClassRoomController-->>Client: 교실 목록 응답
Loading

Poem

🐇
새로운 교실이 열렸어요,
토큰에 유저 ID도 담았지요.
선생님만 교실을 만들고,
학생들은 쉽게 들어오죠.
토끼는 깡총깡총 기뻐하며,
새로운 기능에 귀를 쫑긋!
모두 함께 공부해요!
🏫✨


📜 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 eb1fc55 and 304076e.

⛔ Files ignored due to path filters (1)
  • .DS_Store is excluded by !**/.DS_Store
📒 Files selected for processing (15)
  • docker-compose.yaml (1 hunks)
  • src/main/java/hello/cluebackend/domain/classroom/domain/ClassRoom.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/classroom/domain/repository/ClassRoomRepository.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/classroom/presentation/ClassRoomController.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/classroom/presentation/dto/ClassRoomDTO.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/classroom/service/ClassRoomService.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/classroomuser/domain/ClassRoomUser.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/classroomuser/domain/repository/ClassRoomUserRepository.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/user/domain/UserEntity.java (4 hunks)
  • src/main/java/hello/cluebackend/domain/user/presentation/dto/CustomOAuth2User.java (1 hunks)
  • src/main/java/hello/cluebackend/domain/user/presentation/dto/UserDTO.java (1 hunks)
  • src/main/java/hello/cluebackend/global/config/CustomSuccessHandler.java (1 hunks)
  • src/main/java/hello/cluebackend/global/config/JWTUtil.java (2 hunks)
  • src/main/java/hello/cluebackend/global/security/jwt/RefreshTokenService.java (2 hunks)
  • src/main/resources/application.yaml (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.

@Hgyeol Hgyeol closed this Jul 9, 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