From 3bc1de7763985780e602d384a99065c2275c7eeb Mon Sep 17 00:00:00 2001 From: ragdoll Date: Fri, 12 Jun 2020 05:46:53 +0900 Subject: [PATCH] =?UTF-8?q?[BE/#17]=20Feat=20:=20=EB=8F=84=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?(Comment,=20Assignee)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DB의 테이블과 같은 구성을 가진 도메인 클래스 생성 - Comment - Assignee (다대다 관계 테이블, 불 필요시 추후 삭제할 수 있다.) --- .../issuetracker/ragdoll/domain/Assignee.java | 46 ++++++++ .../issuetracker/ragdoll/domain/Comment.java | 109 ++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Assignee.java create mode 100644 BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Comment.java diff --git a/BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Assignee.java b/BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Assignee.java new file mode 100644 index 0000000..44e95c3 --- /dev/null +++ b/BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Assignee.java @@ -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; + } +} diff --git a/BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Comment.java b/BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Comment.java new file mode 100644 index 0000000..58fd2b9 --- /dev/null +++ b/BE/src/main/java/com/codesquad/issuetracker/ragdoll/domain/Comment.java @@ -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); + } + } +}