From 6c5173c9306dfb137ea946722e5f6b2e024f3013 Mon Sep 17 00:00:00 2001 From: Anna-Jin Date: Mon, 11 Jul 2022 12:05:40 +0900 Subject: [PATCH] =?UTF-8?q?#16=20[Update]=20=EC=97=85=EC=9E=A5=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 구현 중 --- .../store/controller/StoreController.java | 9 ++- .../mpnp/baechelin/store/domain/Store.java | 17 +++-- .../store/dto/StoreImgResponseDto.java | 12 ++++ .../baechelin/store/dto/StoreResponseDto.java | 64 +++++++++++++++++++ .../baechelin/store/service/StoreService.java | 12 ++++ 5 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/mpnp/baechelin/store/dto/StoreImgResponseDto.java create mode 100644 src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java diff --git a/src/main/java/com/mpnp/baechelin/store/controller/StoreController.java b/src/main/java/com/mpnp/baechelin/store/controller/StoreController.java index c8646a8..60b3883 100644 --- a/src/main/java/com/mpnp/baechelin/store/controller/StoreController.java +++ b/src/main/java/com/mpnp/baechelin/store/controller/StoreController.java @@ -1,10 +1,14 @@ package com.mpnp.baechelin.store.controller; +import com.mpnp.baechelin.store.dto.StoreResponseDto; import com.mpnp.baechelin.store.service.StoreService; import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequiredArgsConstructor @RequestMapping("/store") @@ -12,5 +16,8 @@ public class StoreController { private final StoreService storeService; - + @GetMapping + public List getStoreList() { + return null; + } } diff --git a/src/main/java/com/mpnp/baechelin/store/domain/Store.java b/src/main/java/com/mpnp/baechelin/store/domain/Store.java index 01534c6..6e03d0f 100644 --- a/src/main/java/com/mpnp/baechelin/store/domain/Store.java +++ b/src/main/java/com/mpnp/baechelin/store/domain/Store.java @@ -1,6 +1,5 @@ package com.mpnp.baechelin.store.domain; -import com.mpnp.baechelin.api.dto.LocationResponseDto; import com.mpnp.baechelin.api.dto.PublicApiResponseDto; import com.mpnp.baechelin.review.domain.Review; import lombok.AllArgsConstructor; @@ -9,6 +8,7 @@ import lombok.NoArgsConstructor; import javax.persistence.*; +import java.math.BigDecimal; import java.util.List; @Entity @@ -25,12 +25,11 @@ public class Store { @Column(nullable = false) private String name; + @Column(nullable = false, precision = 25, scale = 22) + private BigDecimal latitude; - @Column(nullable = false) - private String latitude; - - @Column(nullable = false) - private String longitude; + @Column(nullable = false, precision = 25, scale = 22) + private BigDecimal longitude; @Column(nullable = false) private String address; @@ -74,8 +73,8 @@ public Store(PublicApiResponseDto.Row row) { //화장실 this.toilet = row.getST5(); - this.latitude = row.getLatitude(); - this.longitude = row.getLongitude(); + this.latitude = new BigDecimal(row.getLatitude()); + this.longitude = new BigDecimal(row.getLongitude()); this.category = row.getCategory(); } @@ -83,4 +82,4 @@ public Store(PublicApiResponseDto.Row row) { private List reviewList; -} +} \ No newline at end of file diff --git a/src/main/java/com/mpnp/baechelin/store/dto/StoreImgResponseDto.java b/src/main/java/com/mpnp/baechelin/store/dto/StoreImgResponseDto.java new file mode 100644 index 0000000..8ebe241 --- /dev/null +++ b/src/main/java/com/mpnp/baechelin/store/dto/StoreImgResponseDto.java @@ -0,0 +1,12 @@ +package com.mpnp.baechelin.store.dto; + +import lombok.Getter; + +@Getter +public class StoreImgResponseDto { + private String storeImageUrl; + + public StoreImgResponseDto(String storeImageUrl) { + this.storeImageUrl = storeImageUrl; + } +} diff --git a/src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java b/src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java new file mode 100644 index 0000000..224b10c --- /dev/null +++ b/src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java @@ -0,0 +1,64 @@ +package com.mpnp.baechelin.store.dto; + +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.List; + +@Getter +@NoArgsConstructor +public class StoreResponseDto { + private int storeId; + private String category; + private String name; + private String latitude; + private String longitude; + private String address; + private String elevator; + private String toilet; + private String parking; + private String phoneNumber; + private String heightDifferent; + private String approach; + private List storeImgList; + private LocalDateTime storeModifiedAt; + private double pointAvg; +// private List reviewList; + + @Builder + public StoreResponseDto( + int storeId, + String category, + String name, + String latitude, + String longitude, + String address, + String elevator, + String toilet, + String parking, + String phoneNumber, + String heightDifferent, + String approach, + List storeImgList, + LocalDateTime storeModifiedAt, + double pointAvg) { + + this.storeId = storeId; + this.category = category; + this.name = name; + this.latitude = latitude; + this.longitude = longitude; + this.address = address; + this.elevator = elevator; + this.toilet = toilet; + this.parking = parking; + this.phoneNumber = phoneNumber; + this.heightDifferent = heightDifferent; + this.approach = approach; + this.storeImgList = storeImgList; + this.storeModifiedAt = storeModifiedAt; + this.pointAvg = pointAvg; + } +} diff --git a/src/main/java/com/mpnp/baechelin/store/service/StoreService.java b/src/main/java/com/mpnp/baechelin/store/service/StoreService.java index c639c9f..e312127 100644 --- a/src/main/java/com/mpnp/baechelin/store/service/StoreService.java +++ b/src/main/java/com/mpnp/baechelin/store/service/StoreService.java @@ -1,7 +1,19 @@ package com.mpnp.baechelin.store.service; +import com.mpnp.baechelin.store.dto.StoreResponseDto; +import com.mpnp.baechelin.store.repository.StoreRepository; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.List; + @Service +@RequiredArgsConstructor public class StoreService { + + private final StoreRepository storeRepository; + + public List getStoreList() { + return null; + } }