From 036984b3bca7f26f33193b1a5bec4f91d1637057 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:16:04 +0900 Subject: [PATCH 01/14] =?UTF-8?q?Feat(#6):=20Auditing=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/wypl/jpacore/JpaAuditingConfig.java | 9 +++++++++ .../java/com/wypl/mongocore/MongoAuditingConfig.java | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 domain/jpa-core/src/main/java/com/wypl/jpacore/JpaAuditingConfig.java create mode 100644 domain/mongo-core/src/main/java/com/wypl/mongocore/MongoAuditingConfig.java diff --git a/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaAuditingConfig.java b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaAuditingConfig.java new file mode 100644 index 0000000..fca6d4e --- /dev/null +++ b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaAuditingConfig.java @@ -0,0 +1,9 @@ +package com.wypl.jpacore; + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; + +@EnableJpaAuditing +@Configuration +public class JpaAuditingConfig { +} diff --git a/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoAuditingConfig.java b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoAuditingConfig.java new file mode 100644 index 0000000..95f3cf8 --- /dev/null +++ b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoAuditingConfig.java @@ -0,0 +1,9 @@ +package com.wypl.mongocore; + +import org.springframework.context.annotation.Configuration; +import org.springframework.data.mongodb.config.EnableMongoAuditing; + +@EnableMongoAuditing +@Configuration +public class MongoAuditingConfig { +} From d212cb50cefe7961dd9b80f79b16f6135c4b3697 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:16:14 +0900 Subject: [PATCH 02/14] =?UTF-8?q?Remove(#6):=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/jpa-core/src/main/java/com/wypl/jpacore/.gitkeep | 0 domain/jpa-core/src/main/resources/application.yml | 0 domain/mongo-core/src/main/java/com/wypl/mongocore/.gitkeep | 0 domain/mongo-core/src/main/resources/application.yml | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 domain/jpa-core/src/main/java/com/wypl/jpacore/.gitkeep delete mode 100644 domain/jpa-core/src/main/resources/application.yml delete mode 100644 domain/mongo-core/src/main/java/com/wypl/mongocore/.gitkeep delete mode 100644 domain/mongo-core/src/main/resources/application.yml diff --git a/domain/jpa-core/src/main/java/com/wypl/jpacore/.gitkeep b/domain/jpa-core/src/main/java/com/wypl/jpacore/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/domain/jpa-core/src/main/resources/application.yml b/domain/jpa-core/src/main/resources/application.yml deleted file mode 100644 index e69de29..0000000 diff --git a/domain/mongo-core/src/main/java/com/wypl/mongocore/.gitkeep b/domain/mongo-core/src/main/java/com/wypl/mongocore/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/domain/mongo-core/src/main/resources/application.yml b/domain/mongo-core/src/main/resources/application.yml deleted file mode 100644 index e69de29..0000000 From a655e5ffbcf366688e01403fb890101bf55f28de Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:20:41 +0900 Subject: [PATCH 03/14] =?UTF-8?q?Feat(#6):=20Internal=20Server=20Error=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/exception/GlobalErrorCode.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java diff --git a/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java b/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java new file mode 100644 index 0000000..1e4d4d1 --- /dev/null +++ b/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java @@ -0,0 +1,31 @@ +package com.wypl.common.exception; + +public enum GlobalErrorCode implements ServerErrorCode { + INTERNAL_SERVER_ERROR(500, "GLOBAL_001", "알수 없는 서버의 오류입니다."), + ; + + private final int statusCode; + private final String errorCode; + private final String message; + + private GlobalErrorCode(int statusCode, String errorCode, String message) { + this.statusCode = statusCode; + this.errorCode = errorCode; + this.message = message; + } + + @Override + public String getErrorCode() { + return errorCode; + } + + @Override + public String getMessage() { + return message; + } + + @Override + public int getStatusCode() { + return statusCode; + } +} From 78c2654ff0c53d112b6a991c9480907cebdef118 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:24:26 +0900 Subject: [PATCH 04/14] =?UTF-8?q?Chore(#6):=20build.gradle=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/jpa-core/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/domain/jpa-core/build.gradle b/domain/jpa-core/build.gradle index b65f5b6..183958e 100644 --- a/domain/jpa-core/build.gradle +++ b/domain/jpa-core/build.gradle @@ -5,7 +5,9 @@ java { } dependencies { + implementation project(':common') + api('org.springframework.boot:spring-boot-starter-data-jpa') - runtimeOnly 'com.h2database:h2' + runtimeOnly('com.h2database:h2') } From ffd5c028941b19556e2adbc073fe6c118bb3f110 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:24:37 +0900 Subject: [PATCH 05/14] =?UTF-8?q?Feat(#6):=20JPA=20Base=20Entity=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/wypl/jpacore/JpaBaseEntity.java | 55 +++++++++++++++++++ .../java/com/wypl/jpacore/JpaErrorCode.java | 20 +++++++ 2 files changed, 75 insertions(+) create mode 100644 domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java create mode 100644 domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java diff --git a/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java new file mode 100644 index 0000000..27c5595 --- /dev/null +++ b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java @@ -0,0 +1,55 @@ +package com.wypl.jpacore; + +import java.time.LocalDateTime; + +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import com.wypl.common.exception.WyplException; + +import jakarta.persistence.Column; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.MappedSuperclass; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@MappedSuperclass +@NoArgsConstructor +@EntityListeners(AuditingEntityListener.class) +public abstract class JpaBaseEntity { + + @CreatedDate + @Column(name = "created_at", nullable = false, updatable = false) + private LocalDateTime createdAt; + + @LastModifiedDate + @Column(name = "modified_at", nullable = false) + private LocalDateTime modifiedAt; + + @Column(name = "deleted_at") + private LocalDateTime deletedAt; + + public void delete() { + if (isDeleted()) { + throw new WyplException(JpaErrorCode.ALREADY_DELETED_ENTITY); + } + this.deletedAt = LocalDateTime.now(); + } + + public void restore() { + if (isNotDeleted()) { + throw new WyplException(JpaErrorCode.NON_DELETED_ENTITY); + } + this.deletedAt = null; + } + + public boolean isNotDeleted() { + return deletedAt == null; + } + + public boolean isDeleted() { + return !isNotDeleted(); + } +} diff --git a/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java new file mode 100644 index 0000000..e8bf042 --- /dev/null +++ b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java @@ -0,0 +1,20 @@ +package com.wypl.jpacore; + +import com.wypl.common.exception.ServerErrorCode; + +import lombok.Getter; + +@Getter +public enum JpaErrorCode implements ServerErrorCode { + ALREADY_DELETED_ENTITY(400, "JPA_001", "이미 삭제된 요소는 삭제할 수 없습니다."), + NON_DELETED_ENTITY(400, "JPA_002", "삭제되지 않은 요소는 복구할 수 없습니다."); + private final int statusCode; + private final String errorCode; + private final String message; + + private JpaErrorCode(int statusCode, String errorCode, String message) { + this.statusCode = statusCode; + this.errorCode = errorCode; + this.message = message; + } +} From a5fa3fd8e72e132a700d214dc566f7c8b70a6655 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:27:56 +0900 Subject: [PATCH 06/14] =?UTF-8?q?Chore(#6):=20Mongo=20build.gradle=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/mongo-core/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/domain/mongo-core/build.gradle b/domain/mongo-core/build.gradle index 9221ddf..4475f3c 100644 --- a/domain/mongo-core/build.gradle +++ b/domain/mongo-core/build.gradle @@ -5,6 +5,8 @@ java { } dependencies { + implementation project(':common') + /* Database */ api('org.springframework.boot:spring-boot-starter-data-mongodb') implementation('de.flapdoodle.embed:de.flapdoodle.embed.mongo.spring31x:4.11.0') From 6aabc2f148b98848d2223ac525548b22ac1d75c8 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:28:11 +0900 Subject: [PATCH 07/14] =?UTF-8?q?Feat(#6):=20Mongo=20Base=20Entity=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolvers: #6 --- .../com/wypl/mongocore/MongoBaseEntity.java | 49 +++++++++++++++++++ .../com/wypl/mongocore/MongoErrorCode.java | 20 ++++++++ 2 files changed, 69 insertions(+) create mode 100644 domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java create mode 100644 domain/mongo-core/src/main/java/com/wypl/mongocore/MongoErrorCode.java diff --git a/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java new file mode 100644 index 0000000..1ae771d --- /dev/null +++ b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java @@ -0,0 +1,49 @@ +package com.wypl.mongocore; + +import java.time.LocalDateTime; + +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.mongodb.core.mapping.Field; + +import com.wypl.common.exception.WyplException; + +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public abstract class MongoBaseEntity { + @CreatedDate + @Field(name = "created_at", write = Field.Write.NON_NULL) + private LocalDateTime createdAt; + + @LastModifiedDate + @Field(name = "modified_at", write = Field.Write.NON_NULL) + private LocalDateTime modifiedAt; + + @Field(name = "deleted_at") + private LocalDateTime deletedAt; + + public void delete() { + if (isDeleted()) { + throw new WyplException(MongoErrorCode.ALREADY_DELETED_ENTITY); + } + this.deletedAt = LocalDateTime.now(); + } + + public void restore() { + if (isNotDeleted()) { + throw new WyplException(MongoErrorCode.NON_DELETED_ENTITY); + } + this.deletedAt = null; + } + + public boolean isNotDeleted() { + return deletedAt == null; + } + + public boolean isDeleted() { + return !isNotDeleted(); + } +} diff --git a/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoErrorCode.java b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoErrorCode.java new file mode 100644 index 0000000..c2eec64 --- /dev/null +++ b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoErrorCode.java @@ -0,0 +1,20 @@ +package com.wypl.mongocore; + +import com.wypl.common.exception.ServerErrorCode; + +import lombok.Getter; + +@Getter +public enum MongoErrorCode implements ServerErrorCode { + ALREADY_DELETED_ENTITY(400, "JPA_001", "이미 삭제된 요소는 삭제할 수 없습니다."), + NON_DELETED_ENTITY(400, "JPA_002", "삭제되지 않은 요소는 복구할 수 없습니다."); + private final int statusCode; + private final String errorCode; + private final String message; + + private MongoErrorCode(int statusCode, String errorCode, String message) { + this.statusCode = statusCode; + this.errorCode = errorCode; + this.message = message; + } +} From 380bbee540d46181cfc8092d2522db30be7d3cd3 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:35:15 +0900 Subject: [PATCH 08/14] =?UTF-8?q?Feat(#6):=20=EA=B8=B0=EB=B3=B8=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EC=9E=90=20=EC=A0=91=EA=B7=BC=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=EC=9E=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolvers: #6 --- .../jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java | 3 ++- .../src/main/java/com/wypl/mongocore/MongoBaseEntity.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java index 27c5595..6bd4331 100644 --- a/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java +++ b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaBaseEntity.java @@ -11,12 +11,13 @@ import jakarta.persistence.Column; import jakarta.persistence.EntityListeners; import jakarta.persistence.MappedSuperclass; +import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @Getter @MappedSuperclass -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) @EntityListeners(AuditingEntityListener.class) public abstract class JpaBaseEntity { diff --git a/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java index 1ae771d..b9c7ee3 100644 --- a/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java +++ b/domain/mongo-core/src/main/java/com/wypl/mongocore/MongoBaseEntity.java @@ -8,11 +8,12 @@ import com.wypl.common.exception.WyplException; +import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public abstract class MongoBaseEntity { @CreatedDate @Field(name = "created_at", write = Field.Write.NON_NULL) From 8d6285923d1835e5ec4783f85537a95749225538 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:57:16 +0900 Subject: [PATCH 09/14] =?UTF-8?q?Chore(#5):=20.gitkeep=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/com/wypl/jpamongoreviewdomain/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 domain/jpamongo-review-domain/src/test/java/com/wypl/jpamongoreviewdomain/.gitkeep diff --git a/domain/jpamongo-review-domain/src/test/java/com/wypl/jpamongoreviewdomain/.gitkeep b/domain/jpamongo-review-domain/src/test/java/com/wypl/jpamongoreviewdomain/.gitkeep new file mode 100644 index 0000000..e69de29 From d57eb3b3b081942a4926f0ef962c701a2def0c1c Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:57:36 +0900 Subject: [PATCH 10/14] =?UTF-8?q?Chore(#5):=20review=20module=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/jpamongo-review-domain/build.gradle | 13 +++++++++++++ settings.gradle | 1 + 2 files changed, 14 insertions(+) create mode 100644 domain/jpamongo-review-domain/build.gradle diff --git a/domain/jpamongo-review-domain/build.gradle b/domain/jpamongo-review-domain/build.gradle new file mode 100644 index 0000000..4c56292 --- /dev/null +++ b/domain/jpamongo-review-domain/build.gradle @@ -0,0 +1,13 @@ +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + +dependencies { + implementation project(':common') + implementation project(':domain:jpa-core') + implementation project(':domain:jpa-member-domain') + implementation project(':domain:jpa-calendar-domain') + implementation project(':domain:mongo-core') +} diff --git a/settings.gradle b/settings.gradle index a52971e..8f812b1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,6 +12,7 @@ include ':domain' include ':domain:jpa-core' include ':domain:jpa-calendar-domain' include ':domain:jpa-member-domain' +include ':domain:jpamongo-review-domain' include ':domain:mongo-core' /* Client Module */ From d5dcbca35fdf64a7e2cd5b6d235a1d3000e0c63c Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:58:31 +0900 Subject: [PATCH 11/14] =?UTF-8?q?Feat(#5):=20JPA=20Review=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../review/domain/Review.java | 42 +++++++++++++++++++ .../review/repository/ReviewRepository.java | 8 ++++ 2 files changed, 50 insertions(+) create mode 100644 domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/domain/Review.java create mode 100644 domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/repository/ReviewRepository.java diff --git a/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/domain/Review.java b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/domain/Review.java new file mode 100644 index 0000000..4210575 --- /dev/null +++ b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/domain/Review.java @@ -0,0 +1,42 @@ +package com.wypl.jpamongoreviewdomain.review.domain; + +import org.hibernate.annotations.SQLRestriction; + +import com.wypl.jpacore.JpaBaseEntity; +import com.wypl.jpamemberdomain.member.Member; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@SQLRestriction("deleted_at is null") +@Entity +public class Review extends JpaBaseEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "review_id") + private Long reviewId; + + @Column(nullable = false, length = 50) + private String title; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "member_id") + private Member member; + + // TODO: 추후 schedule 와 `@ManyToOne` 관계가 필요 +} diff --git a/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/repository/ReviewRepository.java b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/repository/ReviewRepository.java new file mode 100644 index 0000000..89bffe5 --- /dev/null +++ b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/review/repository/ReviewRepository.java @@ -0,0 +1,8 @@ +package com.wypl.jpamongoreviewdomain.review.repository; + +import org.springframework.data.jpa.repository.JpaRepository; + +import com.wypl.jpamongoreviewdomain.review.domain.Review; + +public interface ReviewRepository extends JpaRepository { +} From 4d429eef97ec82bfc1b8588aebc756bbc5588393 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Mon, 9 Sep 2024 18:59:26 +0900 Subject: [PATCH 12/14] =?UTF-8?q?Feat(#5):=20Mongo=20Review=20Domain=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reviewcontents/domain/ReviewContents.java | 27 +++++++++++++++++++ .../repository/ReviewContentsRepository.java | 8 ++++++ 2 files changed, 35 insertions(+) create mode 100644 domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/domain/ReviewContents.java create mode 100644 domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/repository/ReviewContentsRepository.java diff --git a/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/domain/ReviewContents.java b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/domain/ReviewContents.java new file mode 100644 index 0000000..d1fc5a3 --- /dev/null +++ b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/domain/ReviewContents.java @@ -0,0 +1,27 @@ +package com.wypl.jpamongoreviewdomain.reviewcontents.domain; + +import java.util.List; +import java.util.Map; + +import org.springframework.data.mongodb.core.mapping.Document; + +import com.wypl.mongocore.MongoBaseEntity; + +import jakarta.persistence.Id; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Document(collection = "review_contents") +public class ReviewContents extends MongoBaseEntity { + @Id + private Long reviewId; + + private List> contents; +} diff --git a/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/repository/ReviewContentsRepository.java b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/repository/ReviewContentsRepository.java new file mode 100644 index 0000000..2ef7b09 --- /dev/null +++ b/domain/jpamongo-review-domain/src/main/java/com/wypl/jpamongoreviewdomain/reviewcontents/repository/ReviewContentsRepository.java @@ -0,0 +1,8 @@ +package com.wypl.jpamongoreviewdomain.reviewcontents.repository; + +import org.springframework.data.mongodb.repository.MongoRepository; + +import com.wypl.jpamongoreviewdomain.reviewcontents.domain.ReviewContents; + +public interface ReviewContentsRepository extends MongoRepository { +} From b042fe575cd005158e68239cfe45175dc1483529 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Sun, 15 Sep 2024 15:27:00 +0900 Subject: [PATCH 13/14] =?UTF-8?q?Refactor(#5):=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolvers: #5 --- .../jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java index e8bf042..5961a1f 100644 --- a/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java +++ b/domain/jpa-core/src/main/java/com/wypl/jpacore/JpaErrorCode.java @@ -6,8 +6,8 @@ @Getter public enum JpaErrorCode implements ServerErrorCode { - ALREADY_DELETED_ENTITY(400, "JPA_001", "이미 삭제된 요소는 삭제할 수 없습니다."), - NON_DELETED_ENTITY(400, "JPA_002", "삭제되지 않은 요소는 복구할 수 없습니다."); + ALREADY_DELETED_ENTITY(400, "JPA_001", "이미 삭제된 데이터입니다"), + NON_DELETED_ENTITY(400, "JPA_002", "삭제되지 않은 데이터는 복구할 수 없습니다."); private final int statusCode; private final String errorCode; private final String message; From 63785a515e2cc886931f0ed68182630ec6bb5df3 Mon Sep 17 00:00:00 2001 From: KIMSEI1124 Date: Sun, 15 Sep 2024 15:30:39 +0900 Subject: [PATCH 14/14] Refactor(#5): fix typo --- .../main/java/com/wypl/common/exception/GlobalErrorCode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java b/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java index 1e4d4d1..ab0ded3 100644 --- a/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java +++ b/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java @@ -1,7 +1,7 @@ package com.wypl.common.exception; public enum GlobalErrorCode implements ServerErrorCode { - INTERNAL_SERVER_ERROR(500, "GLOBAL_001", "알수 없는 서버의 오류입니다."), + INTERNAL_SERVER_ERROR(500, "GLOBAL_001", "알 수 없는 서버의 오류입니다."), ; private final int statusCode;