-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor: 댓글 삭제 로직 변경 #694
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,10 +55,10 @@ public class User extends BaseEntity { | |
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL) | ||
private List<Like> likes = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "author", cascade = CascadeType.ALL, orphanRemoval = true) | ||
@OneToMany(mappedBy = "author", cascade = CascadeType.REMOVE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 이제 자식과의 관계를 끊어서 삭제하는 로직이 없으니 현재로써는 orphanRemoval 설정이 불필요하군요 !!!
코멘트를 읽다가 찰리의 이 말도 꽤 인상 깊었습니다 ㅎㅎ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요것도 반영했습니다~ |
||
private List<Comment> comments = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "user", cascade = CascadeType.REMOVE, orphanRemoval = true) | ||
@OneToMany(mappedBy = "user", cascade = CascadeType.REMOVE) | ||
private List<CommentLike> commentLikes = new ArrayList<>(); | ||
|
||
public User(String socialId, SocialType socialType, String nickName, String imageUrl) { | ||
|
@@ -153,10 +153,6 @@ public void addComment(Comment comment) { | |
this.comments.add(comment); | ||
} | ||
|
||
public void deleteComment(Comment comment) { | ||
this.comments.remove(comment); | ||
} | ||
|
||
public void validateAdmin() { | ||
if (!this.isAdmin()) { | ||
throw new UnauthorizedException(ErrorType.ADMIN_ONLY); | ||
|
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.
User.deleteComment()
해당 메서드는 이제 사용하는 곳이 없으니 제거되면 좋겠네요 !! ㅎㅎ(전반적으로 User 안에 쓰이지 않고 있는 메서드는 제거되어도 좋을 것 같아요 ㅎㅎㅎ)
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.
아아 User 클래스 안에는 남아있귈랭!! ㅎㅎ
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.
반영했습니다~