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: Dto 설정, FeelingPostController 생성 -#10 #11

Closed
wants to merge 8 commits into from
Closed

Conversation

wimmings
Copy link
Member

@wimmings wimmings commented Mar 8, 2023

feat: Dto 설정, FeelingPostController 생성 -#10

변경 사항

  1. Service에서 Entity 대신 requestDto, responseDto 사용했습니다.
  2. FeelingPostController 쪽 생성했습니다.
  3. ClinicHeart 쪽에도 BaseTimeEntity 추가했습니다.

+ 이 PR 도중에 db 관련 답을 받았습니다..! 이 부분은 한꺼번에 수정하여 올리겠습니다

closed #10

@wimmings wimmings requested a review from grand7070 March 8, 2023 14:47

@GetMapping("/")
public String home() {
return "home";
Copy link
Collaborator

Choose a reason for hiding this comment

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

이건 왜 있는건가요? 저희는 REST API여서 이런 API는 사용하지 않습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

아하 넵 수정하겠습니다!

private ClinicPost clinicPost;

@Builder
public ClinicHeart() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

빈 생성자를 만드셨는데 ClinicHeart가 생성될때 user와 clinicpost 값을 받아야 하므로 두 필드를 받는 생성자를 만드셔야 합니다.

@builder
public ClinicHeart(User user, ClinicPost clinicPost) {
this.user = user;
this.clinicPost = clinicPost;
...
}

Copy link
Member Author

Choose a reason for hiding this comment

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

앗 넵!! 클리닉부분에 살짝 미스가 났습니다 바로 수정하겠습니다!


// 삭제 여부 T:삭제 F:삭제X
@Column(nullable = false)
private char delFlag;
Copy link
Collaborator

Choose a reason for hiding this comment

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

DB에서는 String으로 보여지는게 맞지만 어플리케이션 내 객체로는 boolean이 맞습니다. JPA가 DB에 종속적이지 않은 객체 중심 개발을 위해 만들어진 것이므로 Boolean으로 사용하시는게 좋을 것 같습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

넵! 슬랙에 올려주신 것 참고하여 수정했습니다 감사합니다 :)


// 3. FeelingPost : FeelingHeart = 1 : n
@OneToMany(mappedBy = "feelingPost")
private List<FeelingHeart> feelingHearts = new ArrayList<FeelingHeart>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

new ArrayList<>(); 로 <>안의 제네릭을 생략할 수 있습니다

Copy link
Member Author

@wimmings wimmings Mar 11, 2023

Choose a reason for hiding this comment

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

넵!! 바로 수정하여 pr 보내겠습니다

@wimmings wimmings closed this Mar 13, 2023
@wimmings wimmings self-assigned this Mar 13, 2023
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.

[FEATURE] Dto 설정, 감정글쓰기 쪽 Controller 생성
2 participants