Skip to content

Commit

Permalink
feat: Club 엔티티 생성자에 Builder 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
choi5798 committed Oct 25, 2023
1 parent 693dce9 commit 96d4e33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/spaceclub/club/domain/Club.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.NoArgsConstructor;
import org.springframework.util.Assert;

Expand All @@ -28,7 +29,8 @@ public class Club extends BaseTimeEntity {
@Lob
private String info;

protected Club(Long id, String name, String image, String info) {
@Builder
public Club(Long id, String name, String image, String info) {
Assert.notNull(id, "클럽 ID는 null 값이 올 수 없습니다");
Assert.hasText(Long.toString(id), "클럽 ID는 빈 값이 올 수 없습니다");
Assert.notNull(name, "이름에 null 값이 올 수 없습니다");
Expand Down

0 comments on commit 96d4e33

Please sign in to comment.