From d9f5b39bafd13c0abe8a332294832feaa9dfc49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cadashkdy9960?= <â€vjftmxmwlwhs@gmail.com> Date: Sat, 3 Feb 2024 01:05:39 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20:=20Hive=20Entity,=20DTO=20=EC=97=90?= =?UTF-8?q?=20=EC=A3=BC=EC=86=8C=EA=B0=92=20=EC=9E=85=EB=A0=A5=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HHive/hhive/domain/hive/dto/CreateHiveRequestDTO.java | 6 ++++++ .../com/HHive/hhive/domain/hive/dto/HiveResponseDTO.java | 6 ++++++ src/main/java/com/HHive/hhive/domain/hive/entity/Hive.java | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/main/java/com/HHive/hhive/domain/hive/dto/CreateHiveRequestDTO.java b/src/main/java/com/HHive/hhive/domain/hive/dto/CreateHiveRequestDTO.java index 506fa91..6944ebd 100644 --- a/src/main/java/com/HHive/hhive/domain/hive/dto/CreateHiveRequestDTO.java +++ b/src/main/java/com/HHive/hhive/domain/hive/dto/CreateHiveRequestDTO.java @@ -23,11 +23,17 @@ public class CreateHiveRequestDTO { private String subCategoryName; + private String fullAddress; + + private String roadAddress; + public Hive toEntity(User createdBy,MajorCategory majorCategory,SubCategory subCategory) { return Hive.builder() .title(title) .majorCategory(majorCategory) .subCategory(subCategory) + .fullAddress(fullAddress) + .roadAddress(roadAddress) .creatorId(createdBy.getId()) .introduction("내용을 넣어주세요") .user(createdBy) diff --git a/src/main/java/com/HHive/hhive/domain/hive/dto/HiveResponseDTO.java b/src/main/java/com/HHive/hhive/domain/hive/dto/HiveResponseDTO.java index 68c064b..6f3a9cc 100644 --- a/src/main/java/com/HHive/hhive/domain/hive/dto/HiveResponseDTO.java +++ b/src/main/java/com/HHive/hhive/domain/hive/dto/HiveResponseDTO.java @@ -23,6 +23,10 @@ public class HiveResponseDTO { private String subCategory; + private String fullAddress; + + private String roadAddress; + private String introduction; private Long hostId; @@ -47,6 +51,8 @@ public static HiveResponseDTO of(Hive hive) { .title(hive.getTitle()) .majorCategory(majorName) .subCategory(subName) + .fullAddress(hive.getFullAddress()) + .roadAddress(hive.getRoadAddress()) .introduction(hive.getIntroduction()) .hostId(hive.getCreatorId()) .hostName(hive.getUser().getUsername()) diff --git a/src/main/java/com/HHive/hhive/domain/hive/entity/Hive.java b/src/main/java/com/HHive/hhive/domain/hive/entity/Hive.java index 425ddef..b2be660 100644 --- a/src/main/java/com/HHive/hhive/domain/hive/entity/Hive.java +++ b/src/main/java/com/HHive/hhive/domain/hive/entity/Hive.java @@ -48,6 +48,12 @@ public class Hive extends BaseTimeEntity { @Enumerated(EnumType.STRING) private SubCategory subCategory; + @Column + private String fullAddress; + + @Column + private String roadAddress; + @Column private String introduction;