From f66c89fb7f139387ffbc29278995e8d4cbcfa8b5 Mon Sep 17 00:00:00 2001 From: Klaus Date: Thu, 1 Oct 2026 22:56:59 +0900 Subject: [PATCH] =?UTF-8?q?feat(gift):=20=EC=84=A0=EB=AC=BC=20=EB=B0=9B?= =?UTF-8?q?=EC=9D=84=20=EC=A3=BC=EC=86=8C=20=EC=A0=80=EC=9E=A5=EC=86=8C?= =?UTF-8?q?=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gift-schema.sql | 10 ++++++ .../adapter/out/persistence/GiftMailbox.kt | 33 +++++++++++++++++++ .../out/persistence/GiftMailboxRepository.kt | 5 +++ 3 files changed, 48 insertions(+) create mode 100644 src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailbox.kt create mode 100644 src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailboxRepository.kt diff --git a/docs/20260929_크리에이터_선물하기/gift-schema.sql b/docs/20260929_크리에이터_선물하기/gift-schema.sql index 7e969356..81dbfff3 100644 --- a/docs/20260929_크리에이터_선물하기/gift-schema.sql +++ b/docs/20260929_크리에이터_선물하기/gift-schema.sql @@ -15,6 +15,16 @@ CREATE TABLE gift_category ( UNIQUE KEY uk_gift_category_receipt_code (receipt_code) ) COMMENT='선물 카테고리'; +CREATE TABLE gift_mailbox ( + id BIGINT NOT NULL COMMENT '전역 단일 설정 ID. 항상 1', + name VARCHAR(50) NOT NULL COMMENT '받을 사람 이름', + phone_number VARCHAR(30) NOT NULL COMMENT '받을 연락처', + zip_code VARCHAR(20) NOT NULL COMMENT '받을 우편번호', + address VARCHAR(255) NOT NULL COMMENT '받을 주소', + address_detail VARCHAR(255) NULL COMMENT '받을 상세주소', + PRIMARY KEY (id) +) COMMENT='선물 받을 주소 전역 설정'; + CREATE TABLE gift ( id BIGINT NOT NULL AUTO_INCREMENT COMMENT '내부 기본키', application_no VARCHAR(40) NOT NULL COMMENT '신청번호', diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailbox.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailbox.kt new file mode 100644 index 00000000..88e46a3e --- /dev/null +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailbox.kt @@ -0,0 +1,33 @@ +package kr.co.vividnext.sodalive.v2.gift.adapter.out.persistence + +import javax.persistence.Column +import javax.persistence.Entity +import javax.persistence.Id +import javax.persistence.Table + +@Entity +@Table(name = "gift_mailbox") +class GiftMailbox( + @Id + @Column(name = "id", nullable = false) + val id: Long = SINGLETON_ID, + + @Column(name = "name", nullable = false, length = 50) + var name: String, + + @Column(name = "phone_number", nullable = false, length = 30) + var phoneNumber: String, + + @Column(name = "zip_code", nullable = false, length = 20) + var zipCode: String, + + @Column(name = "address", nullable = false, length = 255) + var address: String, + + @Column(name = "address_detail", length = 255) + var addressDetail: String? +) { + companion object { + const val SINGLETON_ID = 1L + } +} diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailboxRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailboxRepository.kt new file mode 100644 index 00000000..914cadfe --- /dev/null +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/gift/adapter/out/persistence/GiftMailboxRepository.kt @@ -0,0 +1,5 @@ +package kr.co.vividnext.sodalive.v2.gift.adapter.out.persistence + +import org.springframework.data.jpa.repository.JpaRepository + +interface GiftMailboxRepository : JpaRepository