-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE] refactor: 회원 추가로 인한 스키마 변경 (#1075)
* refactor: 리뷰 그룹에 memberId 추가 및 회원 종류에 따른 생성자 분리 * refactor: 회원 세션 유무에 따른 리뷰 그룹 생성 로직 분기처리 * refactor: 리뷰 그룹의 그룹액세스코드 null 처리 * refactor: 확정되지 않은 파라미터 주석처리 * test: 테스트 코드 수정 * refactor: 리뷰 그룹 서비스의 메서드 분리를 다시 병합 * refactor: 리뷰에 작성자id(memberId)추가 * test: 테스트 수정사항 반영 * refactor: 리뷰의 필드명 변경 (reviewerId -> memberId) * flyway: DB 스키마 변경 * refactor: 접근 제어자 수정 * flyway: 컬럼 데이터 타입 명시 * test: 테스트명 변경 * refactor: 테스트에서만 사용되는 생성자 제거 * test: 회원과 비회원의 리뷰 생성에 따른 리뷰 Fixture 생성 및 적용 * refactor: 컨트롤러의 파라미터로 임시 id가 아닌 null을 전달하도록 변경 * refactor: Review 생성자에 @nullable 표시 * test: api테스트에서 모킹 서비스 인자 전달 nullable로 변경 * chore: ci gradle 캐시 삭제 (임시) * chore: ci gradle 캐시 삭제 제거 * chore: junit-vintage-engine 제외 * chore: junit-vintage-engine 제외 -> 삭제 * chore: 런타임 열거형 오류 방지 의존성 추가 * test: assertAll 임시 분리 * chore: sql 문법 수정 * chore: mockito extension 제거 * chore: 런타임 열거형 오류 방지 의존성 추가 -> 삭제 * refactor: nullable 추가 * test: ReviewGroupServiceTest 삭제 (임시) * test: ReviewGroupServiceTest 삭제 (임시) -> 추가 * chore: 런타임 열거형 오류 방지 의존성 추가 --------- Co-authored-by: nayonsoso <[email protected]>
- Loading branch information
Showing
36 changed files
with
316 additions
and
132 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
11 changes: 11 additions & 0 deletions
11
...nd/src/main/java/reviewme/reviewgroup/service/exception/GroupAccessCodeNullException.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package reviewme.reviewgroup.service.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class GroupAccessCodeNullException extends NullPointerException{ | ||
public GroupAccessCodeNullException() { | ||
super("비회원 리뷰 그룹 생성은 그룹 액세스 코드를 필수로 입력해야 해요."); | ||
log.info("Non-member review group creation failed: Group access code is required"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
backend/src/main/resources/db/migration/V6__member_id_add.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- 리뷰 그룹에 memberId를 추가합니다. | ||
-- 리뷰 그룹의 group_access_code에 null을 허용합니다. | ||
|
||
ALTER TABLE review_group ADD COLUMN member_id BIGINT NULL; | ||
ALTER TABLE review_group MODIFY COLUMN group_access_code VARCHAR(255) NULL; | ||
|
||
-- 리뷰에 memberId를 추가합니다. | ||
ALTER TABLE review ADD COLUMN member_id BIGINT NULL; |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package reviewme.fixture; | ||
|
||
import java.util.List; | ||
import reviewme.review.domain.Answer; | ||
import reviewme.review.domain.Review; | ||
|
||
public class ReviewFixture { | ||
|
||
public static Review 비회원_작성_리뷰(long templateId, long reviewGroupId, List<Answer> answers) { | ||
return new Review(null, templateId, reviewGroupId, answers); | ||
} | ||
|
||
public static Review 회원_작성_리뷰(Long memberId, long templateId, long reviewGroupId, List<Answer> answers) { | ||
return new Review(memberId, templateId, reviewGroupId, answers); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.