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: Setter 제거, BaseTimeEntity 추가, FeelingPostService 생성 -#7 #8

Closed
wants to merge 8 commits into from

Conversation

wimmings
Copy link
Member

@wimmings wimmings commented Mar 5, 2023

feat: Setter 제거, BaseTimeEntity 추가, FeelingPostService 생성 -#7

변경 사항

-저는 감정글쓰기, 대나무 숲을 맡았고, 감정 글쓰기(FeelingPost) 부분 처리중입니다!

  1. 편의함수에서 setter 제거하고 다 쪽에서 생성자를 이용했습니다.
  2. BaseTimeEntity 생성하여 FeelingPost가 상속받도록 했습니다.
  3. FeelingPostService 에서 save, update, findById, delete 기능 만들었습니다.

참고 사항

이 레포지토리에 develop 브랜치 만들어서 이 곳에 푸시했습니다


closed #7

@wimmings wimmings self-assigned this Mar 5, 2023

@Getter
@Entity
public class ClinicHeart {
Copy link
Collaborator

Choose a reason for hiding this comment

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

BaseTimeEntity 만드셨으니 사용하시면 좋을 것 같습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

네! Clinic 부분 민기님께 전달하겠습니다

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.

기본 생성자를 만드셔서 해당 Entity에 필요한 필드값 (User, ClinicPost)들이 들어갈 수 없습니다
@NoArgsConstructor@AllArgsConstructor를 알아보시면 될 것 같습니다

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 User user;

// 3. ClinicPost : ClinicHeart = 1 : n
@OneToMany(mappedBy = "clinicPost")
Copy link
Collaborator

Choose a reason for hiding this comment

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

1대다 양방향과 1대다 단방향에 대해 좀 더 알아보시면 좋을 것 같습니다. 이건 구현 방식 차이여서 옳고 그른 건 없습니다

Copy link
Member Author

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.

네, 감사합니다


// 삭제 여부 1:삭제 0:삭제X
@Column(nullable = false)
private boolean 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에 1과 0으로 되어 있으면 알아보기 어렵습니다. True, False로 나타내는게 더 직관적입니다. 1과 0으로 저장되지 않고 True와 False로 저장되게 하는 방법이 있으므로 알아보시면 좋을 것 같습니다

Copy link
Member Author

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.

T/F로 저장되도록 수정하겠습니다. 감사합니다

public class FeelingPostService {
private final FeelingPostRepository feelingPostRepository;

public FeelingPostService(FeelingPostRepository feelingPostRepository) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@requiredargsconstructor 알아보시면 좋을 것 같습니다

Copy link
Member Author

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.

네, 감사합니다

@wimmings wimmings closed this Mar 8, 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] Setter 제거, BaseTimeEntity 추가, FeelingPostService 생성
3 participants