-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
카테고리 우선순위 저장 기능을 구현한다. #65
Conversation
Co-authored-by: tsulocalize <[email protected]>
…iority-api # Conflicts: # backend/bang-ggood/src/main/java/com/bang_ggood/category/domain/Category.java
Co-authored-by: tsulocalize <[email protected]>
@@ -18,6 +20,11 @@ public enum Category { | |||
this.description = description; | |||
} | |||
|
|||
public static boolean contains(Integer id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int대신 Integer를 쓰신 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int로 바꿨습니다! 타입이 int가 되려면 이전에 null check가 선행되어야 될 것 같은데
지금 당장 구현하기 힘들어서 TODO로 남겨두었어요.
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JpaRepository를 사용하면 자동으로 빈등록 되서 어노테이션 없어도 될것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와우 굿 😊
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 확인해주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
간단한 코멘트 남깁니다!
완료 후 슬랙에 다시 태그 부탁드려요 ㅎㅎ
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "category_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
column 이름 설정의 규칙성을 모르겠어요!
코드를 작성하며 세운 이름 설정 규칙이 있다면 공유 가능할까요? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 코드 필요없는 부분이어서 삭제했습니다. 이름 설정 규칙은 기본 규칙 그대로 적용하고 있어요.
private Long id; | ||
|
||
@Column(name = "category_id") | ||
private Integer categoryId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 왜 Integer가 되었나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int타입이면 null값으로 들어왔을 때 0으로 저장되는데 이를 막고자 Integer타입으로 지정했습니다.
그리고 Entity에서는 래퍼타입으로 설정하기로 했었던 것 같아요!
@@ -0,0 +1,19 @@ | |||
CREATE TABLE users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema.sql을 따로 작성해서 로딩 시 검증하는 방식으로 가는 건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저희가 작성한 스키마 타입으로 생성하는게 더 안전하다고 생각해서 schema 파일 추가했습니다.
Co-authored-by: tsulocalize <[email protected]>
Co-authored-by: tsulocalize <[email protected]>
Co-authored-by: tsulocalize <[email protected]>
코멘트 반영완료했습니다 확인해주세요 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다!
고생하셨어요😃
❗ Issue
✨ 구현한 기능
📢 논의하고 싶은 내용
🎸 기타