Skip to content

Commit

Permalink
feat: Club 엔티티 owner 필드 추가, 이름 길이 검증 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
choi5798 committed Oct 25, 2023
1 parent 6316968 commit 98e356e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/spaceclub/club/domain/Club.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ public class Club extends BaseTimeEntity {
@Lob
private String info;

private String owner;

private boolean validateNameLength() {
return this.name.length() <= 12;
}

@Builder
public Club(Long id, String name, String image, String info) {
Assert.notNull(id, "클럽 ID는 null 값이 올 수 없습니다");
Assert.hasText(Long.toString(id), "클럽 ID는 빈 값이 올 수 없습니다");
public Club(String name, String image, String info, String owner) {
Assert.notNull(name, "이름에 null 값이 올 수 없습니다");
Assert.hasText(name, "이름이 빈 값일 수 없습니다");
Assert.isTrue(validateNameLength(), "이름의 길이는 12자를 넘을 수 없습니다");

this.id = id;
this.name = name;
this.image = image;
this.info = info;
this.owner = owner;
}

}

0 comments on commit 98e356e

Please sign in to comment.