Skip to content

Commit

Permalink
[BE/#17] Feat : 도메인 클래스 생성 (Comment, Assignee)
Browse files Browse the repository at this point in the history
DB의 테이블과 같은 구성을 가진 도메인 클래스 생성
- Comment
- Assignee (다대다 관계 테이블, 불 필요시 추후 삭제할 수 있다.)
  • Loading branch information
MuseopKim committed Jun 11, 2020
1 parent 0f3d896 commit 3bc1de7
Show file tree
Hide file tree
Showing 2 changed files with 155 additions and 0 deletions.
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;
}
}
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);
}
}
}

0 comments on commit 3bc1de7

Please sign in to comment.