From 135701381f3c346302f576d5564286a2fb2e6d95 Mon Sep 17 00:00:00 2001 From: jeongns2611 Date: Fri, 3 Jan 2025 14:04:55 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Feat:=20=EA=B2=8C=EC=8B=9C=ED=8C=90=20?= =?UTF-8?q?=EC=97=94=ED=8B=B0=ED=8B=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Post, PostHistory, Comment 엔티티에서 등록자, 수정자, 등록일시, 수정일시 필드 삭제 - Post, PostHistory 엔티티에 priority 컬럼 추가 - Answer, AnswerHistory, Question, QuestionHistory 엔티티 삭제 --- .../devlens/domain/board/entity/Answer.java | 34 ---------- .../domain/board/entity/AnswerHistory.java | 39 ------------ .../devlens/domain/board/entity/Comment.java | 17 +---- .../devlens/domain/board/entity/Post.java | 34 ++++------ .../domain/board/entity/PostHistory.java | 34 +++++----- .../devlens/domain/board/entity/Question.java | 62 ------------------- .../domain/board/entity/QuestionHistory.java | 58 ----------------- 7 files changed, 28 insertions(+), 250 deletions(-) delete mode 100644 src/main/java/com/seveneleven/devlens/domain/board/entity/Answer.java delete mode 100644 src/main/java/com/seveneleven/devlens/domain/board/entity/AnswerHistory.java delete mode 100644 src/main/java/com/seveneleven/devlens/domain/board/entity/Question.java delete mode 100644 src/main/java/com/seveneleven/devlens/domain/board/entity/QuestionHistory.java diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Answer.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Answer.java deleted file mode 100644 index 0b71bfef..00000000 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Answer.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.seveneleven.devlens.domain.board.entity; - -import com.seveneleven.devlens.global.entity.BaseEntity; -import jakarta.persistence.*; -import lombok.*; - -@Entity -@Getter -@Setter -@ToString -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor(access = AccessLevel.PRIVATE) -@Table(name = "answer") -public class Answer extends BaseEntity { - - @Id - @Column(name = "question_id") // 질문 ID를 기본 키로 사용 - private Long questionId; - - @OneToOne(fetch = FetchType.LAZY) - @MapsId // 질문 ID를 외래 키이면서 기본 키로 매핑 - @JoinColumn(name = "question_id", nullable = false) - private Question question; // 질문 엔티티 참조 - - @Column(name = "content", nullable = false) - private String content; // 답변 내용 - - @Column(name = "register_id", nullable = false) - private String registerId; // 답변 등록자 - - @Column(name = "register_ip", nullable = false) - private String registerIp; // 답변 등록자 IP -} \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/AnswerHistory.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/AnswerHistory.java deleted file mode 100644 index 451df64e..00000000 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/AnswerHistory.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.seveneleven.devlens.domain.board.entity; - -import com.seveneleven.devlens.global.entity.BaseEntity; -import jakarta.persistence.*; -import lombok.*; -import org.springframework.data.annotation.CreatedDate; - -import java.time.LocalDateTime; - -@Entity -@Getter -@Setter -@ToString -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor(access = AccessLevel.PRIVATE) -@Table(name = "answer_history") -public class AnswerHistory extends BaseEntity { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "question_history_id") - private Long questionHistoryId; - - @Column(name = "question_id") // 질문 ID를 기본 키로 사용 - private Long questionId; - - @Column(name = "content", nullable = false) - private String content; // 답변 내용 - - @Column(name = "register_id", nullable = false) - private String registerId; // 답변 등록자 - - @Column(name = "register_ip", nullable = false) - private String registerIp; // 답변 등록자 IP - - @CreatedDate - @Column(name = "registered_date", nullable = false) - private LocalDateTime registeredDate; -} diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java index 5eef29b7..bb193463 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java @@ -31,28 +31,15 @@ public class Comment extends BaseEntity { private Comment parentCommentId; // 부모 댓글 ID @Column(name = "is_active", nullable = false) - private Boolean isActive; // 사용 유무 (Y, N) + private Boolean isActive; // 사용 유무 (true, false) @Column(name = "content", nullable = false, columnDefinition = "TEXT") private String content; // 내용 - @JoinColumn(name = "register_id", nullable = false) - @ManyToOne(fetch = FetchType.LAZY) - private Member registerId; - @Column(name = "register_ip", length = 50) private String registerIp; // 등록자 IP - @Column(name = "registered_date") - private LocalDateTime registeredDate; // 등록일 - - @JoinColumn(name = "modifier_id", nullable = false) - @ManyToOne(fetch = FetchType.LAZY) - private Member modifierId; // 수정자 - - @Column(name = "modified_date") - private LocalDateTime modifiedDate; // 등록일 - @Column(name = "modifier_ip", length = 50) private String modifierIp; // 수정자 IP + } \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java index 7e7007ff..751bd98b 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java @@ -10,6 +10,7 @@ import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; +import java.time.LocalDate; import java.time.LocalDateTime; @Entity @@ -25,7 +26,7 @@ public class Post extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "post_id") - private Long postId; // 게시물 ID + private Long postId; // 게시물 ID (문서번호) @JoinColumn(name = "project_step_id", nullable = false) @ManyToOne(fetch = FetchType.LAZY) @@ -36,10 +37,13 @@ public class Post extends BaseEntity { private Post parentPostId; // 부모 게시물 ID @Column(name = "is_pinned_post") - private Boolean isPinnedPost; // 고정 여부 + private Boolean isPinnedPost; // 상단고정 여부 + + @Column(name = "priority") + private Integer priority; // 우선순위 (1,2,3) @Column(name = "status", nullable = false, length = 50) - private String status; // 상태 (요청, 진행, 피드백, 완료, 보류) + private String status; // 상태 (선택(기본값), 진행, 추가, 완료, 보류) @Column(name = "title", nullable = false, length = 255) private String title; // 제목 @@ -53,27 +57,13 @@ public class Post extends BaseEntity { @Column(name = "has_link", nullable = false) private Boolean hasLink; // 링크 유무 - @CreatedBy - @JoinColumn(name = "register_id", nullable = false) - @ManyToOne(fetch = FetchType.LAZY) - private Member registerId; - - @Column(name = "registered_ip", length = 50) - private String registeredIp; // 등록자 IP + @Column(name = "deadline") + private LocalDate deadline; // 마감일자 - @CreatedDate - @Column(name = "registered_date") - private LocalDateTime registeredDate; // 등록일 - - @LastModifiedBy - @JoinColumn(name = "modified_id", nullable = false) - @ManyToOne(fetch = FetchType.LAZY) - private Member modifier; // 수정자 - - @LastModifiedDate - @Column(name = "modified_date") - private LocalDateTime modifiedDate; // 수정일 + @Column(name = "register_ip", length = 50) + private String registerIp; // 등록자 IP @Column(name = "modifier_ip", length = 50) private String modifierIp; // 수정자 IP + } \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java index e8e99e72..fa6cddb5 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java @@ -9,6 +9,7 @@ import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; +import java.time.LocalDate; import java.time.LocalDateTime; @Entity @@ -20,10 +21,14 @@ @AllArgsConstructor(access = AccessLevel.PRIVATE) @Table(name = "post_history") public class PostHistory { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "post_history_id") - private Long postHistoryId; // 게시물 ID + private Long postHistoryId; // 게시물 이력 ID + + @Column(name = "post_id", nullable = false) + private Long postId; // 게시물 ID @Column(name = "project_step_id", nullable = false) private Long projectStepId; // 프로젝트 단계 ID @@ -32,10 +37,13 @@ public class PostHistory { private Long parentPostId; // 부모 게시물 ID @Column(name = "is_pinned_post") - private Boolean isPinnedPost; // 고정 여부 + private Boolean isPinnedPost; // 상단고정 여부 + + @Column(name = "priority") + private Integer priority; // 우선순위 (1,2,3) @Column(name = "status", nullable = false, length = 50) - private String status; // 상태 (요청, 진행, 피드백, 완료, 보류) + private String status; // 상태 (선택(기본값), 진행, 추가, 완료, 보류) @Column(name = "title", nullable = false, length = 255) private String title; // 제목 @@ -49,27 +57,13 @@ public class PostHistory { @Column(name = "has_link", nullable = false) private Boolean hasLink; // 링크 유무 - @CreatedBy - @JoinColumn(name = "register_id", nullable = false) - @ManyToOne(fetch = FetchType.LAZY) - private Member registerId; + @Column(name = "deadline") + private LocalDate deadline; // 마감일자 @Column(name = "registered_ip", length = 50) private String registeredIp; // 등록자 IP - @CreatedDate - @Column(name = "registered_date") - private LocalDateTime registeredDate; // 등록일 - - @LastModifiedBy - @JoinColumn(name = "modified_id", nullable = false) - @ManyToOne(fetch = FetchType.LAZY) - private Member modifier; // 수정자 - - @LastModifiedDate - @Column(name = "modified_date") - private LocalDateTime modifiedDate; // 등록일 - @Column(name = "modifier_ip", length = 50) private String modifierIp; // 수정자 IP + } diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Question.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Question.java deleted file mode 100644 index 3e297cd2..00000000 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Question.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.seveneleven.devlens.domain.board.entity; - -import com.seveneleven.devlens.domain.member.entity.Member; -import com.seveneleven.devlens.global.entity.BaseEntity; -import jakarta.persistence.*; -import lombok.*; -import org.springframework.data.annotation.CreatedBy; -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.annotation.LastModifiedBy; -import org.springframework.data.annotation.LastModifiedDate; - -import java.time.LocalDateTime; - -@Entity -@Getter -@Setter -@ToString -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor(access = AccessLevel.PRIVATE) -@Table(name = "question") -public class Question extends BaseEntity { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "question_id") - private Long questionId; // 질문 ID - - @JoinColumn(name = "post_id", nullable = false) - @OneToOne(fetch = FetchType.LAZY) - private Post postId; // 게시물 ID - - @Column(name = "question_content", nullable = false, columnDefinition = "TEXT") - private String questionContent; // 질문 내용 - - @Column(name = "answer_content", columnDefinition = "TEXT") - private String answerContent; // 답변 내용 - - @CreatedDate - @Column(name = "registered_date", nullable = false, updatable = false) - private LocalDateTime registeredDate; // 등록일시 - - @LastModifiedDate - @Column(name = "modification_date") - private LocalDateTime modificationDate; // 수정일시 - - @CreatedBy - @JoinColumn(name = "register_id", updatable = false) - @OneToOne(fetch = FetchType.LAZY) - private Member registerId; // 등록자 - - @LastModifiedBy - @JoinColumn(name = "modified_id") - @OneToOne(fetch = FetchType.LAZY) - private Member modifierId; // 수정자 - - @Column(name = "register_ip", length = 50) - private String registerIp; // 등록자 IP - - @Column(name = "modifier_ip", length = 50) - private String modifierIp; // 수정자 IP -} \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/QuestionHistory.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/QuestionHistory.java deleted file mode 100644 index 027946bf..00000000 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/QuestionHistory.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.seveneleven.devlens.domain.board.entity; - -import com.seveneleven.devlens.domain.member.entity.Member; -import com.seveneleven.devlens.global.entity.BaseEntity; -import jakarta.persistence.*; -import lombok.*; -import org.springframework.data.annotation.CreatedBy; -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.annotation.LastModifiedBy; -import org.springframework.data.annotation.LastModifiedDate; - -import java.time.LocalDateTime; - -@Entity -@Getter -@Setter -@ToString -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor(access = AccessLevel.PRIVATE) -@Table(name = "question_history") -public class QuestionHistory extends BaseEntity { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "question_history_id") - private Long questionHistoryId; // 질문 ID - - @Column(name = "post_id", nullable = false) - private Long postId; // 게시물 ID - - @Column(name = "question_content", nullable = false, columnDefinition = "TEXT") - private String questionContent; // 질문 내용 - - @Column(name = "answer_content", columnDefinition = "TEXT") - private String answerContent; // 답변 내용 - - @CreatedDate - @Column(name = "registered_date", nullable = false, updatable = false) - private LocalDateTime registeredDate; // 등록일시 - - @LastModifiedDate - @Column(name = "modification_date") - private LocalDateTime modificationDate; // 수정일시 - - @CreatedBy - @Column(name = "register_id", updatable = false) - private Long registerId; // 등록자 - - @LastModifiedBy - @Column(name = "modifier_id") - private Long modifierId; // 수정자 - - @Column(name = "register_ip", length = 50) - private String registerIp; // 등록자 IP - - @Column(name = "modifier_ip", length = 50) - private String modifierIp; // 수정자 IP -} \ No newline at end of file From 4099b9337152899ddad916e3642fe2cf9548aee2 Mon Sep 17 00:00:00 2001 From: jeongns2611 Date: Fri, 3 Jan 2025 14:57:03 +0900 Subject: [PATCH 2/4] =?UTF-8?q?Feat:=20=EC=97=94=ED=8B=B0=ED=8B=B0=20?= =?UTF-8?q?=EC=96=B4=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=A0=9C?= =?UTF-8?q?=EC=99=B8,=20Enum=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Setter, ToString, Builder, AllArgsConstructor 어노테이션 삭제 - 게시물 상태 Enum 추가 --- .../devlens/domain/board/dto/PostStatus.java | 19 +++++++++++++++++++ .../devlens/domain/board/entity/Comment.java | 10 +++------- .../devlens/domain/board/entity/Post.java | 12 ++++-------- .../domain/board/entity/PostHistory.java | 8 ++------ 4 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java diff --git a/src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java b/src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java new file mode 100644 index 00000000..4da3716c --- /dev/null +++ b/src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java @@ -0,0 +1,19 @@ +package com.seveneleven.devlens.domain.board.dto; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum PostStatus { + + DEFAULT, // 선택 + IN_PROGRESS, // 진행 + ADDITION, // 추가 + COMPLETED, // 완료 + ON_HOLD; // 보류 + +// 사용할지 고민 +// FEEDBACK, // 피드백 +// REQUESTED; // 요청 +} diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java index bb193463..1a5a0aaf 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java @@ -9,21 +9,17 @@ @Entity @Getter -@Setter -@ToString -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor(access = AccessLevel.PRIVATE) +@NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "comment") public class Comment extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "comment_id") - private Long commentId; // 댓글 ID + private Long id; // 댓글 ID @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "post_id", nullable = false) + @JoinColumn(name = "post_id", nullable = false, referencedColumnName = "id") private Post postId; // 게시물 ID @JoinColumn(name = "parent_comment_id") diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java index 751bd98b..d12d8b5d 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java @@ -15,24 +15,20 @@ @Entity @Getter -@Setter -@ToString -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor(access = AccessLevel.PRIVATE) +@NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "post") public class Post extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "post_id") - private Long postId; // 게시물 ID (문서번호) + private Long id; // 게시물 ID (문서번호) - @JoinColumn(name = "project_step_id", nullable = false) + @JoinColumn(name = "project_step_id", nullable = false, referencedColumnName = "id") @ManyToOne(fetch = FetchType.LAZY) private ProjectStep projectStepId; // 프로젝트 단계 ID - @JoinColumn(name = "parent_post_id") + @JoinColumn(name = "parent_post_id", referencedColumnName = "id") @ManyToOne(fetch = FetchType.LAZY) private Post parentPostId; // 부모 게시물 ID diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java index fa6cddb5..5ff3ebe2 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java @@ -14,18 +14,14 @@ @Entity @Getter -@Setter -@ToString -@Builder(toBuilder = true) -@NoArgsConstructor -@AllArgsConstructor(access = AccessLevel.PRIVATE) +@NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "post_history") public class PostHistory { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "post_history_id") - private Long postHistoryId; // 게시물 이력 ID + private Long id; // 게시물 이력 ID @Column(name = "post_id", nullable = false) private Long postId; // 게시물 ID From 031f44834efccb26c031b6d4df354d32c5d617b2 Mon Sep 17 00:00:00 2001 From: jeongns2611 Date: Fri, 3 Jan 2025 16:06:46 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Feat:=20entity=20id=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seveneleven/devlens/domain/board/entity/Comment.java | 2 +- .../com/seveneleven/devlens/domain/board/entity/Post.java | 8 +------- .../devlens/domain/board/entity/PostHistory.java | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java index 1a5a0aaf..ee5e5f3e 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java @@ -15,7 +15,7 @@ public class Comment extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "comment_id") + @Column(name = "id") private Long id; // 댓글 ID @ManyToOne(fetch = FetchType.LAZY) diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java index d12d8b5d..b48295c8 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java @@ -1,17 +1,11 @@ package com.seveneleven.devlens.domain.board.entity; -import com.seveneleven.devlens.domain.member.entity.Member; import com.seveneleven.devlens.domain.project.entity.ProjectStep; import com.seveneleven.devlens.global.entity.BaseEntity; import jakarta.persistence.*; import lombok.*; -import org.springframework.data.annotation.CreatedBy; -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.annotation.LastModifiedBy; -import org.springframework.data.annotation.LastModifiedDate; import java.time.LocalDate; -import java.time.LocalDateTime; @Entity @Getter @@ -21,7 +15,7 @@ public class Post extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "post_id") + @Column(name = "id") private Long id; // 게시물 ID (문서번호) @JoinColumn(name = "project_step_id", nullable = false, referencedColumnName = "id") diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java index 5ff3ebe2..c0e11f1e 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java @@ -20,7 +20,7 @@ public class PostHistory { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "post_history_id") + @Column(name = "id") private Long id; // 게시물 이력 ID @Column(name = "post_id", nullable = false) From 20d1b2c1f5ac27c80a82b6b5748440a6220a7bb2 Mon Sep 17 00:00:00 2001 From: jeongns2611 Date: Fri, 3 Jan 2025 16:49:45 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=ED=9B=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devlens/domain/board/dto/PostStatus.java | 24 +++++++++++-------- .../devlens/domain/board/entity/Comment.java | 2 +- .../devlens/domain/board/entity/Post.java | 3 ++- .../domain/board/entity/PostHistory.java | 3 ++- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java b/src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java index 4da3716c..bf61d8c3 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/dto/PostStatus.java @@ -1,19 +1,23 @@ package com.seveneleven.devlens.domain.board.dto; -import lombok.AllArgsConstructor; import lombok.Getter; @Getter -@AllArgsConstructor public enum PostStatus { - DEFAULT, // 선택 - IN_PROGRESS, // 진행 - ADDITION, // 추가 - COMPLETED, // 완료 - ON_HOLD; // 보류 + DEFAULT("선택"), + IN_PROGRESS("진행"), + ADDITION("추가"), + COMPLETED("완료"), + ON_HOLD("보류"); -// 사용할지 고민 -// FEEDBACK, // 피드백 -// REQUESTED; // 요청 + private final String description; + + PostStatus(String description) { + this.description = description; + } + + // 사용할지 고민 + // FEEDBACK("피드백"), + // REQUESTED("요청"); } diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java index ee5e5f3e..a0f33476 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Comment.java @@ -27,7 +27,7 @@ public class Comment extends BaseEntity { private Comment parentCommentId; // 부모 댓글 ID @Column(name = "is_active", nullable = false) - private Boolean isActive; // 사용 유무 (true, false) + private Boolean isActive; // 사용 유무 (Y, N) @Column(name = "content", nullable = false, columnDefinition = "TEXT") private String content; // 내용 diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java index b48295c8..fd74b9b8 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/Post.java @@ -1,5 +1,6 @@ package com.seveneleven.devlens.domain.board.entity; +import com.seveneleven.devlens.domain.board.dto.PostStatus; import com.seveneleven.devlens.domain.project.entity.ProjectStep; import com.seveneleven.devlens.global.entity.BaseEntity; import jakarta.persistence.*; @@ -33,7 +34,7 @@ public class Post extends BaseEntity { private Integer priority; // 우선순위 (1,2,3) @Column(name = "status", nullable = false, length = 50) - private String status; // 상태 (선택(기본값), 진행, 추가, 완료, 보류) + private PostStatus status; // 상태 (선택(기본값), 진행, 추가, 완료, 보류) @Column(name = "title", nullable = false, length = 255) private String title; // 제목 diff --git a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java index c0e11f1e..6bb6f508 100644 --- a/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/board/entity/PostHistory.java @@ -1,5 +1,6 @@ package com.seveneleven.devlens.domain.board.entity; +import com.seveneleven.devlens.domain.board.dto.PostStatus; import com.seveneleven.devlens.domain.member.entity.Member; import com.seveneleven.devlens.domain.project.entity.ProjectStep; import jakarta.persistence.*; @@ -39,7 +40,7 @@ public class PostHistory { private Integer priority; // 우선순위 (1,2,3) @Column(name = "status", nullable = false, length = 50) - private String status; // 상태 (선택(기본값), 진행, 추가, 완료, 보류) + private PostStatus status; // 상태 (선택(기본값), 진행, 추가, 완료, 보류) @Column(name = "title", nullable = false, length = 255) private String title; // 제목