From ee34525301c1c972f8fa64e9bd5a92175e8c5396 Mon Sep 17 00:00:00 2001 From: sungjindev Date: Fri, 9 Feb 2024 21:12:37 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix=20:=20StoreAPI=20=EB=82=B4=20=EB=AA=A8?= =?UTF-8?q?=EB=93=A0=20API=20Versiong=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nainga/nainga/domain/store/api/StoreApi.java | 12 ++++++------ src/test/resources/backend-submodule | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/nainga/nainga/domain/store/api/StoreApi.java b/src/main/java/com/nainga/nainga/domain/store/api/StoreApi.java index 559911b..a9a8b5a 100644 --- a/src/main/java/com/nainga/nainga/domain/store/api/StoreApi.java +++ b/src/main/java/com/nainga/nainga/domain/store/api/StoreApi.java @@ -25,7 +25,7 @@ public class StoreApi { @Hidden @Tag(name = "초기 Data 생성") @Operation(summary = "모범음식점 데이터 생성", description = "[WARNING] DB에 처음으로 모든 모범음식점 데이터를 주입해주는 API입니다. DB에 엄청난 부하가 가는 작업으로, 합의 없이 실행시켜선 안됩니다!") - @GetMapping("api/v1/store/mobeom") + @GetMapping("api/store/mobeom/v1") public Result createAllMobeomStores(@RequestParam(value = "fileName") String fileName) { mobeomGoogleMapStoreService.createAllMobeomStores(fileName); return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, null); @@ -34,7 +34,7 @@ public Result createAllMobeomStores(@RequestParam(value = "fileName") St @Hidden @Tag(name = "초기 Data 생성") @Operation(summary = "지정한 Credit까지만 사용하여 모범음식점 데이터 생성", description = "[WARNING] 지정한 Credit까지만 사용하여 그동안 DB에 모범음식점 데이터를 주입해주는 API입니다. DB에 엄청난 부하가 가는 작업으로, 합의 없이 실행시켜선 안됩니다!") - @GetMapping("api/v1/store/dividedMobeom") + @GetMapping("api/store/dividedMobeom/v1") public Result createDividedMobeomStores(@RequestParam(value = "fileName") String fileName, @RequestParam(value = "dollars") double dollars, @RequestParam(value = "startIndex") int startIndex) { CreateDividedMobeomStoresResponse response = mobeomGoogleMapStoreService.createDividedMobeomStores(fileName, dollars, startIndex); System.out.println("response = " + response); //편하게 콘솔 로그에서 확인하기 위한 용도 @@ -44,7 +44,7 @@ public Result createDividedMobeomStores(@Requ @Hidden @Tag(name = "초기 Data 생성") @Operation(summary = "안심식당 데이터 생성", description = "[WARNING] DB에 처음으로 모든 안심식당 데이터를 주입해주는 API입니다. DB에 엄청난 부하가 가는 작업으로, 합의 없이 실행시켜선 안됩니다!") - @GetMapping("api/v1/store/safe") + @GetMapping("api/store/safe/v1") public Result createAllSafeStores(@RequestParam(value = "fileName") String fileName) { safeGoogleMapStoreService.createAllSafeStores(fileName); return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, null); @@ -53,7 +53,7 @@ public Result createAllSafeStores(@RequestParam(value = "fileName") Stri @Hidden @Tag(name = "초기 Data 생성") @Operation(summary = "지정한 Credit까지만 사용하여 안심식당 데이터 생성", description = "[WARNING] 지정한 Credit까지만 사용하여 그동안 DB에 안심식당 데이터를 주입해주는 API입니다. DB에 엄청난 부하가 가는 작업으로, 합의 없이 실행시켜선 안됩니다!") - @GetMapping("api/v1/store/dividedSafe") + @GetMapping("api/store/dividedSafe/v1") public Result createDividedSafeStores(@RequestParam(value = "fileName") String fileName, @RequestParam(value = "dollars") double dollars, @RequestParam(value = "startIndex") int startIndex) { CreateDividedSafeStoresResponse response = safeGoogleMapStoreService.createDividedSafeStores(fileName, dollars, startIndex); System.out.println("response = " + response); //편하게 콘솔 로그에서 확인하기 위한 용도 @@ -63,7 +63,7 @@ public Result createDividedSafeStores(@RequestP @Hidden @Tag(name = "초기 Data 생성") @Operation(summary = "착한가격업소 데이터 생성", description = "[WARNING] DB에 처음으로 모든 착한가격업소 데이터를 주입해주는 API입니다. DB에 엄청난 부하가 가는 작업으로, 합의 없이 실행시켜선 안됩니다!") - @GetMapping("api/v1/store/goodPrice") + @GetMapping("api/store/goodPrice/v1") public Result createAllGoodPriceStores(@RequestParam(value = "fileName") String fileName) { goodPriceGoogleMapStoreService.createAllGoodPriceStores(fileName); return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, null); @@ -72,7 +72,7 @@ public Result createAllGoodPriceStores(@RequestParam(value = "fileName") @Hidden @Tag(name = "초기 Data 생성") @Operation(summary = "지정한 Credit까지만 사용하여 착한가격업소 데이터 생성", description = "[WARNING] 지정한 Credit까지만 사용하여 그동안 DB에 착한가격업소 데이터를 주입해주는 API입니다. DB에 엄청난 부하가 가는 작업으로, 합의 없이 실행시켜선 안됩니다!") - @GetMapping("api/v1/store/dividedGoodPrice") + @GetMapping("api/store/dividedGoodPrice/v1") public Result createDividedGoodPriceStores(@RequestParam(value = "fileName") String fileName, @RequestParam(value = "dollars") double dollars, @RequestParam(value = "startIndex") int startIndex) { CreateDividedGoodPriceStoresResponse response = goodPriceGoogleMapStoreService.createDividedGoodPriceStores(fileName, dollars, startIndex); System.out.println("response = " + response); //편하게 콘솔 로그에서 확인하기 위한 용도 diff --git a/src/test/resources/backend-submodule b/src/test/resources/backend-submodule index 732770b..6ee111c 160000 --- a/src/test/resources/backend-submodule +++ b/src/test/resources/backend-submodule @@ -1 +1 @@ -Subproject commit 732770ba3e8a25abfb4212a7a75175249e2c099e +Subproject commit 6ee111c8697d5426fe4c7ee77e345f83d518b162 From 9245fa2f014046d8bd7bd1e3880170485d4d8fc1 Mon Sep 17 00:00:00 2001 From: sungjindev Date: Fri, 9 Feb 2024 21:38:16 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix=20:=20StoreCertificationAPI=20=EB=82=B4?= =?UTF-8?q?=20=EB=AA=A8=EB=93=A0=20API=20Versiong=20=EB=B0=A9=EC=8B=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/StoreCertificationApi.java | 67 +++++++++++++++++-- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/nainga/nainga/domain/storecertification/api/StoreCertificationApi.java b/src/main/java/com/nainga/nainga/domain/storecertification/api/StoreCertificationApi.java index 09f3a67..9b22055 100644 --- a/src/main/java/com/nainga/nainga/domain/storecertification/api/StoreCertificationApi.java +++ b/src/main/java/com/nainga/nainga/domain/storecertification/api/StoreCertificationApi.java @@ -24,7 +24,7 @@ public class StoreCertificationApi { private final StoreCertificationService storeCertificationService; //총 사각형 영역의 네 꼭짓점 좌표를 받아, 해당 가게들의 상세 정보를 반환 - @Tag(name = "가게 상세 정보") + @Tag(name = "[Legacy] 가게 상세 정보") @Operation(summary = "사용자 위치 기반 가게 상세 정보 제공 V1", description = "총 사각형 영역의 네 꼭짓점 좌표를 받아 해당 가게들의 상세 정보를 반환해줍니다.

" + "[Request Body]
" + "nwLong: 북서쪽 좌표 경도
" + @@ -44,7 +44,7 @@ public class StoreCertificationApi { "certificationName: 가게의 인증제 목록
" + "=> 각 인증제별 순서는 보장되지 않습니다.") @GetMapping("api/v1/storecertification/byLocation") - public Result> findStoreCertificationsByLocation(@RequestParam("nwLong") double nwLong, @RequestParam("nwLat") double nwLat, @RequestParam("swLong") double swLong, @RequestParam("swLat") double swLat, @RequestParam("seLong") double seLong, @RequestParam("seLat") double seLat, @RequestParam("neLong") double neLong, @RequestParam("neLat") double neLat) { + public Result> findStoreCertificationsByLocationLegacy(@RequestParam("nwLong") double nwLong, @RequestParam("nwLat") double nwLat, @RequestParam("swLong") double swLong, @RequestParam("swLat") double swLat, @RequestParam("seLong") double seLong, @RequestParam("seLat") double seLat, @RequestParam("neLong") double neLong, @RequestParam("neLat") double neLat) { List storeCertificationsByLocation = storeCertificationService.findStoreCertificationsByLocation(new Location(nwLong, nwLat), new Location(swLong, swLat), new Location(seLong, seLat), new Location(neLong, neLat)); List storeIdsWithMultipleCertifications = storeCertificationService.getDuplicatedStoreIds(); //여러 인증제를 가지고 있는 가게의 id 리스트 List storeCertificationsByLocationResponses = new ArrayList<>(); //반환해줄 StoreCertificationsByLocationResponse들의 List @@ -71,7 +71,7 @@ public Result> findStoreCertificatio } //총 사각형 영역의 네 꼭짓점 좌표를 받아 최대 75개를 랜덤하게 뽑아낸 뒤, 해당 가게들의 상세 정보를 반환 - @Tag(name = "가게 상세 정보") + @Tag(name = "[Legacy] 가게 상세 정보") @Operation(summary = "사용자 위치 기반 가게 상세 정보 제공 V2", description = "총 사각형 영역의 네 꼭짓점 좌표를 받아 최대 75개를 랜덤하게 뽑아낸 뒤, 해당 가게들의 상세 정보를 반환해줍니다.

" + "[Request Body]
" + "nwLong: 북서쪽 좌표 경도
" + @@ -91,13 +91,13 @@ public Result> findStoreCertificatio "certificationName: 가게의 인증제 목록
" + "=> 각 인증제별 순서는 보장되지 않습니다.") @GetMapping("api/v2/storecertification/byLocation") - public Result>> findStoreCertificationsByLocationRandomly(@RequestParam("nwLong") double nwLong, @RequestParam("nwLat") double nwLat, @RequestParam("swLong") double swLong, @RequestParam("swLat") double swLat, @RequestParam("seLong") double seLong, @RequestParam("seLat") double seLat, @RequestParam("neLong") double neLong, @RequestParam("neLat") double neLat) { + public Result>> findStoreCertificationsByLocationRandomlyLegacy(@RequestParam("nwLong") double nwLong, @RequestParam("nwLat") double nwLat, @RequestParam("swLong") double swLong, @RequestParam("swLat") double swLat, @RequestParam("seLong") double seLong, @RequestParam("seLat") double seLat, @RequestParam("neLong") double neLong, @RequestParam("neLat") double neLat) { List> storeCertificationsByLocationRandomly = storeCertificationService.findStoreCertificationsByLocationRandomly(new Location(nwLong, nwLat), new Location(swLong, swLat), new Location(seLong, seLat), new Location(neLong, neLat)); return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, storeCertificationsByLocationRandomly); } //검색어를 이용해 가게 이름, 업종, 주소에 대해 검색하고 나온 검색 결과 중 사용자로부터 가까운 순으로 최대 30개의 가게 정보를 리턴 - @Tag(name = "가게 상세 정보") + @Tag(name = "[Legacy] 가게 상세 정보") @Operation(summary = "사용자 위치 및 검색어 기반 가게 상세 정보 제공", description = "현재 사용자의 위치 좌표와 검색 키워드를 전달받아 가게 DB에서 검색한 뒤, 사용자와 가까운 순으로 최대 30개의 가게 상세 정보를 반환해줍니다.

" + "[Request Body]
" + "currLong: 현재 사용자의 위치 좌표 경도값
" + @@ -116,8 +116,65 @@ public Result>> findStoreCertif "certificationName: 가게의 인증제 목록
" + "=> 각 인증제별 순서는 보장되지 않습니다.") @GetMapping("api/v1/storecertification/byLocationAndKeyword") + public Result> searchStoreCertificationsByLocationAndKeywordLegacy(@RequestParam("currLong") double currLong, @RequestParam("currLat") double currLat, @RequestParam("searchKeyword") String searchKeyword) { + List storeCertificationsByLocationAndKeyword = storeCertificationService.searchStoreCertificationsByLocationAndKeyword(currLong, currLat, searchKeyword); + return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, storeCertificationsByLocationAndKeyword); + } + + /* + 이 이하로는 모두 새로운 API Versioning 적용! Version이 URI에서 제일 뒤에 가도록 변경하였습니다. + 한 동안은 전 API Versioning 방식과 후 API Versioning 방식 모두 유지시키고 나중에는 최근 API Versioning 방식만 남겨둘 계획입니다. + */ + + //총 사각형 영역의 네 꼭짓점 좌표를 받아 최대 75개를 랜덤하게 뽑아낸 뒤, 해당 가게들의 상세 정보를 반환 + @Tag(name = "[New] 가게 상세 정보") + @Operation(summary = "사용자 위치 기반 가게 상세 정보 제공 V2", description = "총 사각형 영역의 네 꼭짓점 좌표를 받아 최대 75개를 랜덤하게 뽑아낸 뒤, 해당 가게들의 상세 정보를 반환해줍니다.

" + + "[Request Body]
" + + "nwLong: 북서쪽 좌표 경도
" + + "nwLat: 북서쪽 좌표 위도
" + + "seLong: 남동쪽 좌표 경도
" + + "seLat: 남동쪽 좌표 위도

" + + "[Response Body]
" + + "id: Database 내 Primary Key값
" + + "displayName: 가게 이름
" + + "primaryTypeDisplayName: 업종
" + + "formattedAddress: 주소
" + + "phoneNumber: 전화번호
" + + "location: (경도, 위도) 가게 좌표
" + + "regularOpeningHours: 영업 시간
" + + "=> 특정 요일이 휴무인 경우에는 해당 요일에 대한 데이터가 들어있지 않습니다. Break time이 있는 경우 동일한 요일에 대해 영업 시간 데이터가 여러 개 존재할 수 있습니다.
" + + "localPhotos: 저장된 가게 사진 URL
" + + "certificationName: 가게의 인증제 목록
" + + "=> 각 인증제별 순서는 보장되지 않습니다.") + @GetMapping("api/storecertification/byLocation/v2") + public Result>> findStoreCertificationsByLocationRandomly(@RequestParam("nwLong") double nwLong, @RequestParam("nwLat") double nwLat, @RequestParam("swLong") double swLong, @RequestParam("swLat") double swLat, @RequestParam("seLong") double seLong, @RequestParam("seLat") double seLat, @RequestParam("neLong") double neLong, @RequestParam("neLat") double neLat) { + List> storeCertificationsByLocationRandomly = storeCertificationService.findStoreCertificationsByLocationRandomly(new Location(nwLong, nwLat), new Location(swLong, swLat), new Location(seLong, seLat), new Location(neLong, neLat)); + return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, storeCertificationsByLocationRandomly); + } + + //검색어를 이용해 가게 이름, 업종, 주소에 대해 검색하고 나온 검색 결과 중 사용자로부터 가까운 순으로 최대 30개의 가게 정보를 리턴 + @Tag(name = "[New] 가게 상세 정보") + @Operation(summary = "사용자 위치 및 검색어 기반 가게 상세 정보 제공", description = "현재 사용자의 위치 좌표와 검색 키워드를 전달받아 가게 DB에서 검색한 뒤, 사용자와 가까운 순으로 최대 30개의 가게 상세 정보를 반환해줍니다.

" + + "[Request Body]
" + + "currLong: 현재 사용자의 위치 좌표 경도값
" + + "currLat: 현재 사용자의 위치 좌표 위도값
" + + "searchKeyword: 검색할 키워드

" + + "[Response Body]
" + + "id: Database 내 Primary Key값
" + + "displayName: 가게 이름
" + + "primaryTypeDisplayName: 업종
" + + "formattedAddress: 주소
" + + "phoneNumber: 전화번호
" + + "location: (경도, 위도) 가게 좌표
" + + "regularOpeningHours: 영업 시간
" + + "=> 특정 요일이 휴무인 경우에는 해당 요일에 대한 데이터가 들어있지 않습니다. Break time이 있는 경우 동일한 요일에 대해 영업 시간 데이터가 여러 개 존재할 수 있습니다.
" + + "localPhotos: 저장된 가게 사진 URL
" + + "certificationName: 가게의 인증제 목록
" + + "=> 각 인증제별 순서는 보장되지 않습니다.") + @GetMapping("api/storecertification/byLocationAndKeyword/v1") public Result> searchStoreCertificationsByLocationAndKeyword(@RequestParam("currLong") double currLong, @RequestParam("currLat") double currLat, @RequestParam("searchKeyword") String searchKeyword) { List storeCertificationsByLocationAndKeyword = storeCertificationService.searchStoreCertificationsByLocationAndKeyword(currLong, currLat, searchKeyword); return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, storeCertificationsByLocationAndKeyword); } + } \ No newline at end of file From e9bcdf738f0cc50ac71f39f306ce35fbde541db6 Mon Sep 17 00:00:00 2001 From: sungjindev Date: Fri, 9 Feb 2024 21:45:12 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix=20:=20GCS=20=EA=B4=80=EB=A0=A8=20API=20?= =?UTF-8?q?=EB=82=B4=20=EB=AA=A8=EB=93=A0=20API=20Versiong=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=EA=B2=BD=20(#93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nainga/nainga/global/config/SwaggerConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/nainga/nainga/global/config/SwaggerConfig.java b/src/main/java/com/nainga/nainga/global/config/SwaggerConfig.java index 0472428..7a30728 100644 --- a/src/main/java/com/nainga/nainga/global/config/SwaggerConfig.java +++ b/src/main/java/com/nainga/nainga/global/config/SwaggerConfig.java @@ -32,7 +32,7 @@ public OpenAPI customOpenAPI() { "참고로 Swagger 상에서는 Base URL이 달라 테스트가 불가능합니다.
" + "만약 테스트를 원하신다면 브라우저 상에서 직접 URL을 입력해주시면 됩니다.
" + "예) https://storage.googleapis.com/kcs-dev-bucket1/ad06294c-d4ed-42bd-9839-82af8714bd1e") - .tags(List.of("가게 상세 정보")) + .tags(List.of("[New] 가게 상세 정보")) .responses(new ApiResponses().addApiResponse("200", new ApiResponse().description("OK") .content(new Content().addMediaType("image/jpeg", new MediaType()