Skip to content

Commit

Permalink
[refactor] 클래스 명 및 로직 변경
Browse files Browse the repository at this point in the history
좀 더 직관적인 메서드 네이밍 사용
  • Loading branch information
BaeJunho committed Oct 9, 2024
1 parent 8a25158 commit 53237e9
Showing 1 changed file with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package team7.inplace.favorite.domain;
package team7.inplace.userFavoriteInfluencer.domain;

import jakarta.persistence.*;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import team7.inplace.influencer.domain.Influencer;
import team7.inplace.user.domain.User;

Expand All @@ -12,7 +15,7 @@
@RequiredArgsConstructor
@NoArgsConstructor(access = PROTECTED)
@Entity
public class Favorite {
public class UserFavoriteInfluencer {
@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;
Expand All @@ -27,7 +30,19 @@ public class Favorite {
@Column
private boolean like = false;

public void like(boolean tf){
this.like = tf;
public void check(boolean check) {
if (check) {
like();
return;
}
dislike();
}

private void like() {
this.like = true;
}

private void dislike() {
this.like = false;
}
}

0 comments on commit 53237e9

Please sign in to comment.