From f34be092ff7b3c788292b31a2da5c9cbb2ac0882 Mon Sep 17 00:00:00 2001 From: kyubeom Date: Sun, 18 Aug 2024 16:52:41 +0900 Subject: [PATCH] =?UTF-8?q?#1=20=EC=97=94=ED=8B=B0=ED=8B=B0=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../out/persistence/entity/ScrapJpaEntity.kt | 16 +++++ .../out/persistence/entity/StoreJpaEntity.kt | 58 +++++++++++++++++++ .../out/persistence/entity/UserJpaEntity.kt | 10 ++++ 3 files changed, 84 insertions(+) diff --git a/core/src/main/kotlin/com/core/adapter/out/persistence/entity/ScrapJpaEntity.kt b/core/src/main/kotlin/com/core/adapter/out/persistence/entity/ScrapJpaEntity.kt index 095f189..540dd01 100644 --- a/core/src/main/kotlin/com/core/adapter/out/persistence/entity/ScrapJpaEntity.kt +++ b/core/src/main/kotlin/com/core/adapter/out/persistence/entity/ScrapJpaEntity.kt @@ -1,4 +1,20 @@ package com.core.adapter.out.persistence.entity +import jakarta.persistence.* +import org.hibernate.annotations.Comment +import java.awt.Image + +@Entity +@Table(name = "scarp") class ScrapJpaEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val idx: Long = 0 + + @Column(name = "store_id") + val storeId: Long = 0 + + @Column(name = "user_id") + val userId: Long = 0 + } \ No newline at end of file diff --git a/core/src/main/kotlin/com/core/adapter/out/persistence/entity/StoreJpaEntity.kt b/core/src/main/kotlin/com/core/adapter/out/persistence/entity/StoreJpaEntity.kt index 4265d06..3ac7822 100644 --- a/core/src/main/kotlin/com/core/adapter/out/persistence/entity/StoreJpaEntity.kt +++ b/core/src/main/kotlin/com/core/adapter/out/persistence/entity/StoreJpaEntity.kt @@ -1,4 +1,62 @@ package com.core.adapter.out.persistence.entity +import jakarta.persistence.* +import org.hibernate.annotations.Comment + +@Entity +@Table(name = "store", indexes = [ + Index(name = "store_idx_name", columnList = "name"), + Index(name = "store_idx_category_group", columnList = "category_group"), + Index(name = "store_idx_category", columnList = "category"), +]) class StoreJpaEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val idx: Long = 0 + + @Column(name = "name") + val name: String = "DEFAULT" + + @Column(name = "address") + val address: String = "DEFAULT" + + @Comment("카카오에서 제공하는 카테고리") + @Column(name = "category_group") + val categoryGroup: String = "DEFAULT" + + @Comment("조회할때 쓰인 음식점, 카페에 대한 카테고리") + @Column(name = "category") + val category: String = "DEFAULT" + + @Comment("조회할때 쓰인 음식점, 카페에 대한 세분화된 카테고리") + @Column(name = "category_detail") + val categoryDetail: String = "DEFAULT" + + @Comment("카카오에서 제공하는 ID") + val kakaoId: String = "DEFAULT" + + @Column(name = "phone") + val phone: String = "DEFAULT" + + @Column(name = "distance") + val distance: Int = 0 + + @Column(name = "url") + val url: String = "DEFAULT" + + @Column(name = "road_address") + val roadAddress: String = "DEFAULT" + + @Column(name = "x") + val x: String = "DEFAULT" + + @Column(name = "y") + val y: String = "DEFAULT" + + @Column(name = "is_deleted") + val isDeleted: Boolean = false + + @ManyToOne(fetch = FetchType.LAZY) + val university: CampusJpaEntity = CampusJpaEntity() } \ No newline at end of file diff --git a/core/src/main/kotlin/com/core/adapter/out/persistence/entity/UserJpaEntity.kt b/core/src/main/kotlin/com/core/adapter/out/persistence/entity/UserJpaEntity.kt index ae640f5..fef20ac 100644 --- a/core/src/main/kotlin/com/core/adapter/out/persistence/entity/UserJpaEntity.kt +++ b/core/src/main/kotlin/com/core/adapter/out/persistence/entity/UserJpaEntity.kt @@ -1,4 +1,14 @@ package com.core.adapter.out.persistence.entity +import jakarta.persistence.* + +@Entity +@Table(name = "users") class UserJpaEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val idx: Long = 0 + + @Column(name = "phone_id") + val phoneId: String = "DEFAULT" } \ No newline at end of file