diff --git a/daemawiki-domain/src/main/java/org/daemawiki/domain/article/model/Article.java b/daemawiki-domain/src/main/java/org/daemawiki/domain/article/model/Article.java index 041e3c9..e4df36b 100644 --- a/daemawiki-domain/src/main/java/org/daemawiki/domain/article/model/Article.java +++ b/daemawiki-domain/src/main/java/org/daemawiki/domain/article/model/Article.java @@ -1,5 +1,6 @@ package org.daemawiki.domain.article.model; +import lombok.Builder; import lombok.Getter; import org.daemawiki.domain.user.model.Writer; import org.springframework.data.annotation.CreatedDate; @@ -14,32 +15,35 @@ public class Article { @Id private String id; + private String title; + private String content; + private Writer writer; + @CreatedDate private LocalDateTime createdAt; - private Long recommend = 0L; - private Long view = 0L; - public void increaseView() { - view++; - } + private Long recommend = 0L; - public void increaseRecommend() { - recommend++; - } + private Long view = 0L; protected Article() {} - protected Article(String title, String content, Writer writer) { + @Builder + public Article(String title, String content, Writer writer) { this.title = title; this.content = content; this.writer = writer; } - public static Article create(String title, String content, Writer writer) { - return new Article(title, content, writer); + public void increaseView() { + view++; + } + + public void increaseRecommend() { + recommend++; } } \ No newline at end of file