Skip to content
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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

[feat] 당근 클론 코딩 #6

wants to merge 11 commits into from

Conversation

Parkjyun
Copy link
Contributor

@Parkjyun Parkjyun commented Apr 18, 2024

Related Issue 📌

Description ✔️

  • 주말 안에 추가 예정 ㅋ ㅋ

To Reviewers

  • 주말 안에 추가 예정 ㅋ ㅋ

Copy link

@Chan531 Chan531 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고수 ㄷㄷ

Copy link

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) {
Copy link

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) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null, "", " "를 모두 허용하지 않는 @notblank를 사용하는 것이 좋네요!
덕분에 저도 @NotNull, @notempty, @notblank의 차이를 다시 찾아보고 복기할 수 있었습니다!

https://sanghye.tistory.com/36


private final ProductRepository productRepository;
private final MemberRepository memberRepository;
public void createProduct(ProductCreateRequest request, Long memberId) {
Copy link

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)
Copy link

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의 경우는 좀 다른가요?? 답변 주시면 감사하겠습니다!

Copy link

@gardening-y gardening-y Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

냅다 예전 플젝 yml 올리는 그..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 2주차 당근마켓 클론 코딩
3 participants