diff --git a/http/DummyHttpRequest.http b/http/DummyHttpRequest.http index a8f26ee..04c8146 100644 --- a/http/DummyHttpRequest.http +++ b/http/DummyHttpRequest.http @@ -29,7 +29,9 @@ Content-Type: application/json "youtube_url" : "{{dummy.dummy1.store_info.youtube_url}}", "name" : "{{dummy.dummy1.store_info.name}}", "category" : "{{dummy.dummy1.store_info.category}}", - "introduction" : "{{dummy.dummy1.store_info.introduction}}" + "introduction" : "{{dummy.dummy1.store_info.introduction}}", + "latitude" : "{{dummy.dummy1.store_info.latitude}}", + "longitude" : "{{dummy.dummy1.store_info.longitude}}" }, "ocr_info" : { @@ -74,9 +76,10 @@ Content-Type: application/json "title" : "{{dummy.dummy2.store_info.title}}", "youtube_url" : "{{dummy.dummy2.store_info.youtube_url}}", "name" : "{{dummy.dummy2.store_info.name}}", - "category" : "{{dummy.dummy2.store_info.category}}", - "introduction" : "{{dummy.dummy2.store_info.introduction}}" + "introduction" : "{{dummy.dummy2.store_info.introduction}}", + "latitude" : "{{dummy.dummy2.store_info.latitude}}", + "longitude" : "{{dummy.dummy2.store_info.longitude}}" }, "ocr_info" : { @@ -121,7 +124,9 @@ Content-Type: application/json "youtube_url" : "{{dummy.dummy3.store_info.youtube_url}}", "name" : "{{dummy.dummy3.store_info.name}}", "category" : "{{dummy.dummy3.store_info.category}}", - "introduction" : "{{dummy.dummy3.store_info.introduction}}" + "introduction" : "{{dummy.dummy3.store_info.introduction}}", + "latitude" : "{{dummy.dummy3.store_info.latitude}}", + "longitude" : "{{dummy.dummy3.store_info.longitude}}" }, "ocr_info" : { @@ -166,7 +171,9 @@ Content-Type: application/json "youtube_url" : "{{dummy.dummy4.store_info.youtube_url}}", "name" : "{{dummy.dummy4.store_info.name}}", "category" : "{{dummy.dummy4.store_info.category}}", - "introduction" : "{{dummy.dummy4.store_info.introduction}}" + "introduction" : "{{dummy.dummy4.store_info.introduction}}", + "latitude" : "{{dummy.dummy4.store_info.latitude}}", + "longitude" : "{{dummy.dummy4.store_info.longitude}}" }, "ocr_info" : { @@ -211,7 +218,9 @@ Content-Type: application/json "youtube_url" : "{{dummy.dummy5.store_info.youtube_url}}", "name" : "{{dummy.dummy5.store_info.name}}", "category" : "{{dummy.dummy5.store_info.category}}", - "introduction" : "{{dummy.dummy5.store_info.introduction}}" + "introduction" : "{{dummy.dummy5.store_info.introduction}}", + "latitude" : "{{dummy.dummy5.store_info.latitude}}", + "longitude" : "{{dummy.dummy5.store_info.longitude}}" }, "ocr_info" : { diff --git a/src/main/java/com/daon/onjung/account/application/dto/response/ReadStoreDetailResponseDto.java b/src/main/java/com/daon/onjung/account/application/dto/response/ReadStoreDetailResponseDto.java index a4518a6..37180d3 100644 --- a/src/main/java/com/daon/onjung/account/application/dto/response/ReadStoreDetailResponseDto.java +++ b/src/main/java/com/daon/onjung/account/application/dto/response/ReadStoreDetailResponseDto.java @@ -90,6 +90,12 @@ public static class StoreInfoDto { @JsonProperty("introduction") private final String introduction; + @JsonProperty("latitude") + private final Double latitude; + + @JsonProperty("longitude") + private final Double longitude; + @Builder public StoreInfoDto( String bannerImgUrl, @@ -100,7 +106,9 @@ public StoreInfoDto( String name, String category, String address, - String introduction + String introduction, + Double latitude, + Double longitude ) { this.bannerImgUrl = bannerImgUrl; this.tags = tags; @@ -111,6 +119,8 @@ public StoreInfoDto( this.category = category; this.address = address; this.introduction = introduction; + this.latitude = latitude; + this.longitude = longitude; } public static StoreInfoDto fromEntity(Store store) { @@ -124,6 +134,8 @@ public static StoreInfoDto fromEntity(Store store) { .category(store.getCategory().name()) .address(store.getOcrStoreAddress()) .introduction(store.getIntroduction()) + .latitude(store.getLatitude()) + .longitude(store.getLongitude()) .build(); } } diff --git a/src/main/java/com/daon/onjung/account/domain/Store.java b/src/main/java/com/daon/onjung/account/domain/Store.java index c862104..a890382 100644 --- a/src/main/java/com/daon/onjung/account/domain/Store.java +++ b/src/main/java/com/daon/onjung/account/domain/Store.java @@ -65,6 +65,12 @@ public class Store { @Column(name = "ocr_store_address", length = 100, nullable = false) private String ocrStoreAddress; + @Column(name = "latitude", nullable = false) + private Double latitude; + + @Column(name = "longitude", nullable = false) + private Double longitude; + /* -------------------------------------------- */ /* Timestamp Column --------------------------- */ /* -------------------------------------------- */ @@ -91,7 +97,7 @@ public class Store { /* Methods ------------------------------------ */ /* -------------------------------------------- */ @Builder - public Store(String title, String bannerImgUrl, Set onjungTags, String youtubeUrl, String logoImgUrl, String name, ECategory category, String introduction, String ocrStoreName, String ocrStoreAddress, Owner owner) { + public Store(String title, String bannerImgUrl, Set onjungTags, String youtubeUrl, String logoImgUrl, String name, ECategory category, String introduction, String ocrStoreName, String ocrStoreAddress, Double latitude, Double longitude, Owner owner) { this.title = title; this.onjungTags = onjungTags; this.bannerImgUrl = bannerImgUrl; @@ -102,6 +108,8 @@ public Store(String title, String bannerImgUrl, Set onjungTags, Stri this.introduction = introduction; this.ocrStoreName = ocrStoreName; this.ocrStoreAddress = ocrStoreAddress; + this.latitude = latitude; + this.longitude = longitude; this.createdAt = LocalDateTime.now(); this.owner = owner; } diff --git a/src/main/java/com/daon/onjung/account/domain/service/StoreService.java b/src/main/java/com/daon/onjung/account/domain/service/StoreService.java index cea1c69..46c8436 100644 --- a/src/main/java/com/daon/onjung/account/domain/service/StoreService.java +++ b/src/main/java/com/daon/onjung/account/domain/service/StoreService.java @@ -23,8 +23,10 @@ public Store createStore( ECategory category, String introduction, String ocrStoreName, - String ocrStoreAddress - , Owner owner) { + String ocrStoreAddress, + Double latitude, + Double longitude, + Owner owner) { return Store.builder() .title(title) .bannerImgUrl(bannerImgUrl) @@ -36,6 +38,8 @@ public Store createStore( .introduction(introduction) .ocrStoreName(ocrStoreName) .ocrStoreAddress(ocrStoreAddress) + .latitude(latitude) + .longitude(longitude) .owner(owner) .build(); } diff --git a/src/main/java/com/daon/onjung/security/application/dto/request/SignUpOwnerByDefaultRequestDto.java b/src/main/java/com/daon/onjung/security/application/dto/request/SignUpOwnerByDefaultRequestDto.java index e6e82f4..ef68a2c 100644 --- a/src/main/java/com/daon/onjung/security/application/dto/request/SignUpOwnerByDefaultRequestDto.java +++ b/src/main/java/com/daon/onjung/security/application/dto/request/SignUpOwnerByDefaultRequestDto.java @@ -59,7 +59,15 @@ public record StoreInfo( @NotNull @Size(min = 1, max = 100) @JsonProperty("introduction") - String introduction + String introduction, + + @NotNull + @JsonProperty("latitude") + Double latitude, + + @NotNull + @JsonProperty("longitude") + Double longitude ) {} public record OcrInfo( diff --git a/src/main/java/com/daon/onjung/security/application/service/SignUpOwnerByDefaultService.java b/src/main/java/com/daon/onjung/security/application/service/SignUpOwnerByDefaultService.java index 8cc56fe..7d9ccbf 100644 --- a/src/main/java/com/daon/onjung/security/application/service/SignUpOwnerByDefaultService.java +++ b/src/main/java/com/daon/onjung/security/application/service/SignUpOwnerByDefaultService.java @@ -87,6 +87,8 @@ public void execute(MultipartFile logo, requestDto.storeInfo().introduction(), requestDto.ocrInfo().storeName(), requestDto.ocrInfo().addressName(), + requestDto.storeInfo().latitude(), + requestDto.storeInfo().longitude(), owner ); storeRepository.save(store);