From 4eb8cc7fbf7a45c673a359933cd6de8c9b387955 Mon Sep 17 00:00:00 2001 From: hoon7566 Date: Wed, 26 Jan 2022 17:22:16 +0900 Subject: [PATCH 1/2] =?UTF-8?q?notification-service=EC=97=90=20jpa=20?= =?UTF-8?q?=EC=84=A4=EA=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notification/entity/Notification.java | 25 +++++++++++++++++++ .../global/entity/BaseEntity.java | 15 +++++++++++ 2 files changed, 40 insertions(+) create mode 100644 notification-service/src/main/java/com/justpickup/notificationservice/domain/notification/entity/Notification.java create mode 100644 notification-service/src/main/java/com/justpickup/notificationservice/global/entity/BaseEntity.java diff --git a/notification-service/src/main/java/com/justpickup/notificationservice/domain/notification/entity/Notification.java b/notification-service/src/main/java/com/justpickup/notificationservice/domain/notification/entity/Notification.java new file mode 100644 index 0000000..e9757d7 --- /dev/null +++ b/notification-service/src/main/java/com/justpickup/notificationservice/domain/notification/entity/Notification.java @@ -0,0 +1,25 @@ +package com.justpickup.notificationservice.domain.notification.entity; + +import com.justpickup.notificationservice.global.entity.BaseEntity; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.persistence.*; + +@Entity +@Table(name = "notification") +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Notification extends BaseEntity { + + @Id @GeneratedValue + @Column(name = "notification_id") + private Long id; + + /** + * userdb.users.user_id + */ + private Long userId; + +} diff --git a/notification-service/src/main/java/com/justpickup/notificationservice/global/entity/BaseEntity.java b/notification-service/src/main/java/com/justpickup/notificationservice/global/entity/BaseEntity.java new file mode 100644 index 0000000..613ae6e --- /dev/null +++ b/notification-service/src/main/java/com/justpickup/notificationservice/global/entity/BaseEntity.java @@ -0,0 +1,15 @@ +package com.justpickup.notificationservice.global.entity; + + +import javax.persistence.MappedSuperclass; +import java.time.LocalDateTime; + +@MappedSuperclass +public abstract class BaseEntity { + + private LocalDateTime createdAt; + private Long createdBy; + private LocalDateTime lastModifiedAt; + private Long lastModifiedBy; + +} From e7402062a68619979de575bd89c694e3cf55d33d Mon Sep 17 00:00:00 2001 From: hoon7566 Date: Wed, 26 Jan 2022 17:24:47 +0900 Subject: [PATCH 2/2] =?UTF-8?q?notification-service=EC=97=90=20application?= =?UTF-8?q?.yml=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/notification-service/src/main/resources/application.yml b/notification-service/src/main/resources/application.yml index 73a7dfa..25ca7bd 100644 --- a/notification-service/src/main/resources/application.yml +++ b/notification-service/src/main/resources/application.yml @@ -10,15 +10,15 @@ spring: username: postgres password: admin - jpa: + jpa: + hibernate: + ddl-auto: create-drop + properties: hibernate: - ddl-auto: create-drop - properties: - hibernate: - format_sql: true - show_sql: true - open-in-view: false - default_batch_fetch_size: 1000 + format_sql: true + show_sql: true + open-in-view: false + default_batch_fetch_size: 1000 eureka: client: