diff --git a/src/main/java/notai/comment/application/CommentQueryService.java b/src/main/java/notai/comment/application/CommentQueryService.java new file mode 100644 index 0000000..ad2ab1b --- /dev/null +++ b/src/main/java/notai/comment/application/CommentQueryService.java @@ -0,0 +1,4 @@ +package notai.comment.application; + +public class CommentQueryService { +} diff --git a/src/main/java/notai/comment/application/CommentService.java b/src/main/java/notai/comment/application/CommentService.java new file mode 100644 index 0000000..b46762e --- /dev/null +++ b/src/main/java/notai/comment/application/CommentService.java @@ -0,0 +1,4 @@ +package notai.comment.application; + +public class CommentService { +} diff --git a/src/main/java/notai/comment/domain/Comment.java b/src/main/java/notai/comment/domain/Comment.java new file mode 100644 index 0000000..03f5281 --- /dev/null +++ b/src/main/java/notai/comment/domain/Comment.java @@ -0,0 +1,49 @@ +package notai.comment.domain; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import notai.common.domain.RootEntity; + +import java.math.BigInteger; +import java.time.LocalDateTime; + +import static jakarta.persistence.GenerationType.IDENTITY; +import static lombok.AccessLevel.PROTECTED; + +@Entity +@Table(name = "comment") +@Getter +@NoArgsConstructor(access = PROTECTED) +@AllArgsConstructor +public class Comment extends RootEntity { + @Id + @GeneratedValue(strategy = IDENTITY) + private Long id; + @Column(nullable = false) + private Long memberId; + @Column(nullable = false) + private Long postId; + @Column(nullable = false) + private Long parentCommentId; + @Column(length = 255, nullable = false) + private String content; + public Comment( + Long memberId, + Long postId, + String content + ) { + this.memberId = memberId; + this.postId = postId; + this.content = content; + } + +} diff --git a/src/main/java/notai/comment/domain/CommentRepository.java b/src/main/java/notai/comment/domain/CommentRepository.java new file mode 100644 index 0000000..d547be2 --- /dev/null +++ b/src/main/java/notai/comment/domain/CommentRepository.java @@ -0,0 +1,11 @@ +package notai.comment.domain; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.math.BigInteger; + +@Repository +public interface CommentRepository extends JpaRepository { + +} diff --git a/src/main/java/notai/comment/presentation/CommentController.java b/src/main/java/notai/comment/presentation/CommentController.java new file mode 100644 index 0000000..4f7287a --- /dev/null +++ b/src/main/java/notai/comment/presentation/CommentController.java @@ -0,0 +1,4 @@ +package notai.comment.presentation; + +public class CommentController { +}