From 7d65bbed034424aaf989139fa781bda39c47f3fc Mon Sep 17 00:00:00 2001 From: BeommoKoo-dev <95630007+BeommoKoo-dev@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:22:11 +0900 Subject: [PATCH] =?UTF-8?q?NO-JIRA--chore=20:=20=EC=95=A0=ED=94=8C?= =?UTF-8?q?=EB=A6=AC=EC=BC=80=EC=9D=B4=EC=85=98=20=EC=8B=A4=ED=96=89?= =?UTF-8?q?=EC=8B=9C=20data.sql=EC=8B=A4=ED=96=89=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/category/entity/Category.java | 14 ++++++++++---- .../suggestion/service/SuggestionService.java | 2 +- src/main/resources/application.yml | 10 ++++++++++ src/main/resources/data.sql | 9 +++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/data.sql diff --git a/src/main/java/org/prgrms/nabimarketbe/domain/category/entity/Category.java b/src/main/java/org/prgrms/nabimarketbe/domain/category/entity/Category.java index d48821e5..909cb867 100644 --- a/src/main/java/org/prgrms/nabimarketbe/domain/category/entity/Category.java +++ b/src/main/java/org/prgrms/nabimarketbe/domain/category/entity/Category.java @@ -1,16 +1,22 @@ package org.prgrms.nabimarketbe.domain.category.entity; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + import lombok.Getter; import lombok.NoArgsConstructor; -import org.prgrms.nabimarketbe.global.BaseEntity; - -import javax.persistence.*; @Entity @Table(name = "categories") @Getter @NoArgsConstructor -public class Category extends BaseEntity { +public class Category { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "category_id", nullable = false) diff --git a/src/main/java/org/prgrms/nabimarketbe/domain/suggestion/service/SuggestionService.java b/src/main/java/org/prgrms/nabimarketbe/domain/suggestion/service/SuggestionService.java index 4796ead1..e4abb8a3 100644 --- a/src/main/java/org/prgrms/nabimarketbe/domain/suggestion/service/SuggestionService.java +++ b/src/main/java/org/prgrms/nabimarketbe/domain/suggestion/service/SuggestionService.java @@ -115,7 +115,7 @@ public SuggestionResponseDTO updateSuggestionStatus( .orElseThrow(() -> new BaseException(ErrorCode.SUGGESTION_NOT_FOUND)); suggestion.decideSuggestion(isAccepted); - + //TODO : 채팅방 생성 return SuggestionResponseDTO.from(suggestion); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f08c04e6..5e2550b7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,6 +2,16 @@ spring: profiles: active: local + ## .sql문을 실행하기 위함 + sql: + init: + mode: always + + ## hibernate ddl 이후 datasource intialize + jpa: + defer-datasource-initialization: true + + springdoc: version: '@springdoc.version@' swagger-ui: diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 00000000..d61d969b --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,9 @@ +insert into categories(category_name) values ('MALE_CLOTHES'); +insert into categories(category_name) values ('FEMALE_CLOTHES'); +insert into categories(category_name) values ('GOODS_ACCESSORY'); +insert into categories(category_name) values ('SHOES'); +insert into categories(category_name) values ('SPORTS'); +insert into categories(category_name) values ('BOOKS'); +insert into categories(category_name) values ('ELECTRONICS'); +insert into categories(category_name) values ('FURNITURE_INTERIOR'); +insert into categories(category_name) values ('HOME_ELECTRONICS');