Skip to content

Commit

Permalink
feat: concepts 테이블에 conceptType 필드 추가 #32
Browse files Browse the repository at this point in the history
  • Loading branch information
PgmJun committed Jan 27, 2024
1 parent 16cbd30 commit 4929412
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/main/java/com/nice/petudio/domain/concept/Concept.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.nice.petudio.domain.base.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
Expand All @@ -24,6 +26,10 @@ public class Concept extends BaseEntity {
@Column(name = "concept_id")
private Long id;

@Enumerated(EnumType.STRING)
@Column(name = "concept_type", length = 30, nullable = false)
private ConceptType conceptType;

@Column(name = "concept_main_image", length = 200, nullable = false)
private String mainImage;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.nice.petudio.domain.concept;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum ConceptMessageType {
NAME("name"),
DESCRIPTION("description");

private final String type;
}
14 changes: 14 additions & 0 deletions src/main/java/com/nice/petudio/domain/concept/ConceptType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.nice.petudio.domain.concept;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum ConceptType {
CONCEPT_3D("concept.3d."),
CONCEPT_TRENDY("concept.trendy.");

private final String messagePrefix;
}
Empty file.
2 changes: 2 additions & 0 deletions src/main/resources/sql/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO concepts VALUES(1, 'CONCEPT_3D', 'mainImage','image','image','image','image','image','image','image','image', '2024-01-24 23:48:52','2024-01-24 23:48:52')
INSERT INTO concepts VALUES(2, 'CONCEPT_TRENDY', 'mainImage','image','image','image','image','image','image','image','image', '2024-01-24 23:48:52','2024-01-24 23:48:52')
3 changes: 2 additions & 1 deletion src/main/resources/sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CREATE TABLE `members`
`social_id` varchar(300) NOT NULL,
`social_type` varchar(30) NOT NULL,
`member_role` varchar(30) NOT NULL,
`email` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`fcm_token` varchar(300) NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
Expand All @@ -40,6 +40,7 @@ CREATE TABLE `points`
CREATE TABLE `concepts`
(
`concept_id` bigint AUTO_INCREMENT PRIMARY KEY,
`concept_type` varchar(30) NOT NULL,
`concept_main_image` varchar(200) NOT NULL,
`concept_sub_image1` varchar(200) NOT NULL,
`concept_sub_image2` varchar(200) NOT NULL,
Expand Down

0 comments on commit 4929412

Please sign in to comment.