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

3주차 과제 #6

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

3주차 과제 #6

wants to merge 10 commits into from

Conversation

sjk4618
Copy link
Collaborator

@sjk4618 sjk4618 commented Nov 3, 2024

No description provided.

@sjk4618 sjk4618 self-assigned this Nov 3, 2024
Copy link

@jjuny-won jjuny-won left a comment

Choose a reason for hiding this comment

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

좋아여! 깔끔해여! dto 에서 정적 팩토리 메서드 사용 배우고 갑니당..

@@ -11,6 +12,7 @@
@EntityListeners(AuditingEntityListener.class) //해당 어노테이션은 엔티티의 변화를 감지하여 엔티티와 매핑된 테이블의 데이터를 조작

Choose a reason for hiding this comment

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

자동으로 시간을 넣어주기 위해서 넣은걸까용

@PostMapping("/diary")
ResponseEntity<Void> postDiary(@RequestHeader("userId") final Long userId,
@RequestBody final DiaryPostReq diaryPostReq) {
ValidatorUtil.validStringLength(diaryPostReq.content(), Constants.MAX_CONTENT_LENGTH);

Choose a reason for hiding this comment

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

검증을 이렇게 하니까 더 가독성이 좋아보여요

};
}

//빈 List 검증

Choose a reason for hiding this comment

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

이것두 다른 메서드처럼 분리해도 좋을 것같은데!


//개인 일기 목록 조회 API
@GetMapping("/diaries/my")
ResponseEntity<DiaryMyListRes> getMyDiaryList(@RequestHeader("userId") final Long userId,

Choose a reason for hiding this comment

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

만약에 userId가 null 이 들어오면 어떻게 처리가 되나요...? 컨트롤러단에서 처리를 해줘야하지 않나해서..

private Long id;

@JoinColumn(name = "user_id")
@ManyToOne(fetch = FetchType.LAZY)

Choose a reason for hiding this comment

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

연관 안맺는게 좋다구 들었던거같은데... 혹시 연관 관계 맺으신 이유가 따로있을까여?

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

Successfully merging this pull request may close these issues.

2 participants