Feature/#148 교직원 회원가입 로직 분리#150
Open
JJimini wants to merge 5 commits into
Hidden character warning
The head ref may contain hidden characters: "Feature/#148-\uad50\uc9c1\uc6d0_\ud68c\uc6d0\uac00\uc785_\ub85c\uc9c1_\ubd84\ub9ac"
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
회원가입 요청에 memberType(STUDENT/STAFF)를 추가해 학생/교직원 가입 흐름을 분리하고, 교직원은 사전 등록된 StaffInfo(이름+이메일)와 매칭되는 권한으로 가입되도록 확장한 PR입니다.
Changes:
SignUpRequest에memberType추가 및 문서/RestDocs 테스트 케이스 확장StaffInfo도메인/리포지토리 추가 및MemberCommandService.signUp()학생/교직원 분기 처리- DB 초기 스키마(
schema.sql)에staff_info테이블 추가 및 예외 타입 확장
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/opus/opus/modules/member/application/MemberCommandService.java | memberType 기반 학생/교직원 가입 로직 분리 및 StaffInfo 매칭 가입 추가 |
| src/main/java/com/opus/opus/modules/member/application/dto/request/SignUpRequest.java | memberType 필드 및 검증(@NotNull/@pattern) 추가 |
| src/main/java/com/opus/opus/modules/member/domain/StaffInfo.java | StaffInfo 엔티티 신규 추가 |
| src/main/java/com/opus/opus/modules/member/domain/dao/StaffInfoRepository.java | StaffInfo 조회 리포지토리(findByEmailAndName) 추가 |
| src/main/java/com/opus/opus/modules/member/exception/MemberExceptionType.java | NOT_FOUND_STAFF_INFO 예외 타입 추가 |
| src/main/resources/schema.sql | staff_info 테이블 DDL 추가 |
| src/main/java/com/opus/opus/docs/asciidoc/member.adoc | 학생/교직원 회원가입 문서 분리 및 실패 케이스 추가 |
| src/test/java/com/opus/opus/restdocs/docs/MemberApiDocsTest.java | 학생/교직원 회원가입 RestDocs 스니펫 및 실패 케이스 추가 |
| src/test/java/com/opus/opus/member/StaffInfoFixture.java | StaffInfo 테스트 픽스처 신규 추가 |
| src/test/java/com/opus/opus/member/application/MemberCommandServiceTest.java | 학생/교직원 가입 동작 및 권한 검증 테스트 추가/정리 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+212
to
+226
| private void signUpStaff(final SignUpRequest request, final String encodingPassword) { | ||
| final StaffInfo staffInfo = staffInfoRepository.findByEmailAndName(request.email(), request.name()) | ||
| .orElseThrow(() -> new MemberException(NOT_FOUND_STAFF_INFO)); | ||
|
|
||
| memberConvenience.checkIsDuplicateEmail(request.email()); | ||
| memberConvenience.checkIsDuplicateStudentId(request.studentId()); | ||
|
|
||
| memberRepository.save(Member.generalMember() | ||
| .name(request.name()) | ||
| .studentId(request.studentId()) | ||
| .email(request.email()) | ||
| .password(encodingPassword) | ||
| .roles(Set.of(staffInfo.getRole())) | ||
| .build()); | ||
| } |
Comment on lines
+144
to
+150
| CREATE TABLE `staff_info` ( | ||
| `id` bigint NOT NULL AUTO_INCREMENT, | ||
| `name` varchar(255) NOT NULL, | ||
| `email` varchar(255) NOT NULL, | ||
| `role` enum('ROLE_학생','ROLE_관리자','ROLE_교수','ROLE_직원','ROLE_외부멘토') NOT NULL, | ||
| PRIMARY KEY (`id`) | ||
| ); |
pykido
approved these changes
Jun 8, 2026
Contributor
pykido
left a comment
There was a problem hiding this comment.
수고하셨습니다!
가짜 회원 여부 로직 분기 처리가 깔끔하게 잘되어있네요!!! 👍👍👍👍👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔥 연관된 이슈
close: #148
📜 작업 내용
StaffInfo엔티티 신규 생성 (id, name, email, role)MemberRoleType재사용 (교수/직원 대상)StaffInfoRepository추가 (findByEmailAndName)SignUpRequest에 memberType 필드 추가 (String)STUDENT|STAFF") → 두 값 외 입력 시 400 반환MemberCommandService.signUp)STUDENT: 기존 흐름 유지 (가짜회원 전환 / 팀리더 정보 업데이트 / 신규가입ROLE_학생)
STAFF: StaffInfo를 이메일+이름으로 대조💬 리뷰 요구사항
✨ 기타