-
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.
* feat: 깃허브 아이디 원시값 포장 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 회원 `GithubId` 사용 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * refactor: 키워드 내 컬럼 수정 (content) Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * refactor: 일급 컬렉션 이름 변경 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 질문 엔티티 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * refactor: 답변 구조 변경, 길이 검증 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * refactor: 키워드 연관관계 없이 참조하도록 설정 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * test: 답변 길이 테스트 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 리뷰 생성 시 키워드 받아서 생성 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * test: 리뷰어와 리뷰이 같은 경우의 예외 테스트 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * chore: 리뷰-키워드 매핑 테이블 삭제 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * fix: Fixture 사용해 컴파일 에러 해결 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * refactor: 일대다 편의 메소드 작성, Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 깃허브 아이디 그룹, 리뷰어 연관관계 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 리뷰그룹 - 리뷰 일대다 단방향 연관관계 적용 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 리뷰그룹 - 리뷰 일대다 양방향 연관관계 적용 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 리뷰어 그룹 깃허브 아이디 검증 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 셀프리뷰 검증 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * chore: 사용하지 않는 파일 삭제 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 리뷰 추가 검증 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * fix: 순환 참조 NPE 해결 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * chore: 사용하지 않는 import 제거 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * chore: Github ID 패키지 이동 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * feat: 리뷰 - 리뷰 답변 연관관계 설정 Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]> * chore: 사용하지 않는 코드 제거 * refactor: 내가 받은 리뷰 상세 보기 구현 --------- Co-authored-by: nayonsoso <[email protected]> Co-authored-by: Kimprodp <[email protected]> Co-authored-by: hyeonjilee <[email protected]>
- Loading branch information
1 parent
aa7589a
commit 5d0b953
Showing
41 changed files
with
502 additions
and
526 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
backend/src/main/java/reviewme/keyword/contoller/KeywordApi.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
backend/src/main/java/reviewme/keyword/contoller/KeywordController.java
This file was deleted.
Oops, something went wrong.
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
50 changes: 50 additions & 0 deletions
50
backend/src/main/java/reviewme/keyword/domain/Keywords.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,50 @@ | ||
package reviewme.keyword.domain; | ||
|
||
import jakarta.persistence.CollectionTable; | ||
import jakarta.persistence.ElementCollection; | ||
import jakarta.persistence.Embeddable; | ||
import jakarta.persistence.JoinColumn; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import reviewme.keyword.domain.exception.DuplicateKeywordException; | ||
import reviewme.keyword.domain.exception.KeywordLimitExceedException; | ||
|
||
@Embeddable | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
public class Keywords { | ||
|
||
private static final int MAX_KEYWORD_COUNT = 5; | ||
|
||
@ElementCollection | ||
@CollectionTable(name = "review_keyword", joinColumns = @JoinColumn(name = "review_id")) | ||
private Set<Long> keywordIds; | ||
|
||
public Keywords(List<Keyword> selectedKeywords) { | ||
if (selectedKeywords.size() > MAX_KEYWORD_COUNT) { | ||
throw new KeywordLimitExceedException(MAX_KEYWORD_COUNT); | ||
} | ||
if (hasDuplicateKeywords(selectedKeywords)) { | ||
throw new DuplicateKeywordException(); | ||
} | ||
this.keywordIds = selectedKeywords.stream() | ||
.map(Keyword::getId) | ||
.collect(Collectors.toSet()); | ||
} | ||
|
||
private boolean hasDuplicateKeywords(List<Keyword> selectedKeywords) { | ||
long distinctKeywordCount = selectedKeywords.stream() | ||
.distinct() | ||
.count(); | ||
return selectedKeywords.size() != distinctKeywordCount; | ||
} | ||
|
||
public Set<Long> getKeywordIds() { | ||
return Collections.unmodifiableSet(keywordIds); | ||
} | ||
} |
34 changes: 0 additions & 34 deletions
34
backend/src/main/java/reviewme/keyword/domain/SelectedKeywords.java
This file was deleted.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
backend/src/main/java/reviewme/member/domain/GithubId.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,20 @@ | ||
package reviewme.member.domain; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Embeddable | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
public class GithubId { | ||
|
||
@Column(name = "github_id", nullable = false) | ||
private long id; | ||
|
||
public GithubId(long id) { | ||
this.id = id; | ||
} | ||
} |
14 changes: 5 additions & 9 deletions
14
...me/member/domain/GithubReviewerGroup.java → .../member/domain/GithubIdReviewerGroup.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
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
Oops, something went wrong.