-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE/#17] Feat : 도메인 클래스 생성 (Comment, Assignee)
DB의 테이블과 같은 구성을 가진 도메인 클래스 생성 - Comment - Assignee (다대다 관계 테이블, 불 필요시 추후 삭제할 수 있다.)
- Loading branch information
Showing
2 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Assignee.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.codesquad.issuetracker.ragdoll.domain; | ||
|
||
public class Assignee { | ||
|
||
private Integer id; | ||
|
||
private Long issueId; | ||
|
||
private Long userId; | ||
|
||
public Assignee() {} | ||
|
||
private Assignee(Integer id, Long issueId, Long userId) { | ||
this.id = id; | ||
this.issueId = issueId; | ||
this.userId = userId; | ||
} | ||
|
||
public static Assignee create(Integer id, Long issueId, Long userId) { | ||
return new Assignee(id, issueId, userId); | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public Long getIssueId() { | ||
return issueId; | ||
} | ||
|
||
public void setIssueId(Long issueId) { | ||
this.issueId = issueId; | ||
} | ||
|
||
public Long getUserId() { | ||
return userId; | ||
} | ||
|
||
public void setUserId(Long userId) { | ||
this.userId = userId; | ||
} | ||
} |
109 changes: 109 additions & 0 deletions
109
BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Comment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
package com.codesquad.issuetracker.ragdoll.domain; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public class Comment { | ||
|
||
private Long id; | ||
|
||
private String description; | ||
|
||
private LocalDateTime createdDateTime; | ||
|
||
private Long issueId; | ||
|
||
private Long userId; | ||
|
||
public Comment() {} | ||
|
||
private Comment(Long id, String description, LocalDateTime createdDateTime, Long issueId, Long userId) { | ||
this.id = id; | ||
this.description = description; | ||
this.createdDateTime = createdDateTime; | ||
this.issueId = issueId; | ||
this.userId = userId; | ||
} | ||
|
||
public static Comment create(Long id, String description, LocalDateTime createdDateTime, Long issueId, Long userId) { | ||
return new Comment(id, description, createdDateTime, issueId, userId); | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public LocalDateTime getCreatedDateTime() { | ||
return createdDateTime; | ||
} | ||
|
||
public void setCreatedDateTime(LocalDateTime createdDateTime) { | ||
this.createdDateTime = createdDateTime; | ||
} | ||
|
||
public Long getIssueId() { | ||
return issueId; | ||
} | ||
|
||
public void setIssueId(Long issueId) { | ||
this.issueId = issueId; | ||
} | ||
|
||
public Long getUserId() { | ||
return userId; | ||
} | ||
|
||
public void setUserId(Long userId) { | ||
this.userId = userId; | ||
} | ||
|
||
public static class Builder { | ||
private Long id; | ||
private String description; | ||
private LocalDateTime createdDateTime; | ||
private Long issueId; | ||
private Long userId; | ||
|
||
public Builder() {} | ||
|
||
public Builder id(Long id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public Builder description(String description) { | ||
this.description = description; | ||
return this; | ||
} | ||
|
||
public Builder createdDateTime(LocalDateTime createdDateTime) { | ||
this.createdDateTime = createdDateTime; | ||
return this; | ||
} | ||
|
||
public Builder issuId(Long issueId) { | ||
this.issueId = issueId; | ||
return this; | ||
} | ||
|
||
public Builder userId(Long userId) { | ||
this.userId = userId; | ||
return this; | ||
} | ||
|
||
public Comment build() { | ||
return new Comment(id, description, createdDateTime, issueId, userId); | ||
} | ||
} | ||
} |