Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] 선택 스토어 좌표 조회 - #50 #51

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,9 @@ public ResponseEntity<BaseResponse<?>> getStoreInformation(@PathVariable("storeI
public ResponseEntity<BaseResponse<?>> getStoreByLank(){
return ApiResponseUtil.success(SuccessCode.OK, storeService.getStoreByLank());
}

@GetMapping("/{storeId}/select/coordinate")
public ResponseEntity<BaseResponse<?>> getStoreSelectedCoordinate(@PathVariable final Long storeId) {
return ApiResponseUtil.success(SuccessCode.OK, storeService.getStoreSelectedCoordinate(storeId));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.cakey.store.dto;

public record StoreSelectedCoordinateRes(
Long storeId,
Double latitude,
Double longitude
) {
public static StoreSelectedCoordinateRes of(Long storeId, Double latitude, Double longitude) {
return new StoreSelectedCoordinateRes(storeId, latitude, longitude);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.cakey.size.dto.SizeDto;
import com.cakey.size.facade.SizeFacade;
import com.cakey.store.domain.Station;
import com.cakey.store.domain.Store;
import com.cakey.store.dto.*;
import com.cakey.store.facade.StoreFacade;
import java.time.format.DateTimeFormatter;
Expand Down Expand Up @@ -229,4 +230,9 @@ public StoreListByPopularityRes getStoreByLank() {
final List<StoreByPopularityDto> storeByPopularityDtoList = storeFacade.findStoreListByLank();
return new StoreListByPopularityRes(storeByPopularityDtoList);
}

public StoreSelectedCoordinateRes getStoreSelectedCoordinate(final long storeId) {
Store store = storeFacade.findStoreById(storeId);
return StoreSelectedCoordinateRes.of(storeId, store.getLatitude(), store.getLongitude());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@ public StoreDetailInfoDto findStoreDetailInfo(final Long storeId) {
public List<StoreByPopularityDto> findStoreListByLank() {
return storeRetriever.findStoreListByLank();
}

public Store findStoreById(final Long storeId) {
return storeRetriever.findById(storeId);
}
}