-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feat] 당근 클론 코딩 #6
base: develop
Are you sure you want to change the base?
Conversation
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.
SuccessCode와 FailureCode의 구성이 같은데 이를 분리하신 이유가 궁금합니다!
|
||
@PostMapping | ||
public CarrotResponse<?> createProduct(@RequestBody @Valid ProductCreateRequest request, | ||
@RequestHeader(CustomHeaders.MEMBER_ID) Long memberId) { |
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.
이렇게 memberId를 받는 건 처음 보는데 @PathVariable과는 다르게 어떤 특징이 있는지 공유해주실 수 있나요?!
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record MemberCreateRequest(@NotBlank String nickname) { |
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 final ProductRepository productRepository; | ||
private final MemberRepository memberRepository; | ||
public void createProduct(ProductCreateRequest request, Long memberId) { |
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 String title; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "trade_type", nullable = false) |
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마다 name을 지정해주는 이유가 혹시 있을까요??
mysql 같은 경우는 jpa를 통해 table을 자동으로 생성할 때 이런 카멜 케이스를 설정하신 name처럼 자동으로 변환해주는 걸로 알고 있어서요!
h2의 경우는 좀 다른가요?? 답변 주시면 감사하겠습니다!
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.
냅다 예전 플젝 yml 올리는 그..
Related Issue 📌
Description ✔️
To Reviewers