Skip to content

Commit

Permalink
Merge pull request #99 from Korea-Certified-Store/develop
Browse files Browse the repository at this point in the history
Develop to Main 릴리즈 (#98)
  • Loading branch information
sungjindev authored Feb 14, 2024
2 parents 8a2155e + 38b9e8f commit 2deeaf9
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 16 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/action-production-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
username: ${{ secrets.KCS_USERNAME_PROD }}
host: ${{ secrets.KCS_HOST_PROD }}
key: ${{ secrets.KCS_KEY_PROD }}
source: "src/main/resources/backend-submodule/docker-compose.yml,src/main/resources/backend-submodule/nginx/nginx.conf"
source: "src/main/resources/backend-submodule"
target: "/home/g22203/"

# Docker hub 로그인
Expand All @@ -68,6 +68,14 @@ jobs:
cache-from: type=gha
cache-to: type=gha, mode=max

# Discord 에 알람 보내기
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_PROD }}
uses: Ilshidur/action-discord@master
with:
args: '{{ EVENT_PAYLOAD.repository.full_name }} 가 배포 되었 습니다. 운영 서버가 재시작 됩니다.'

# appleboy/ssh-action@master 액션을 사용하여 지정한 서버에 ssh로 접속하고, script를 실행합니다.
# 실행 시, docker-compose를 사용합니다.
- name: Deploy to server
Expand All @@ -83,5 +91,4 @@ jobs:
docker rmi $(docker images -q)
cp -f ./src/main/resources/backend-submodule/docker-compose.yml .
cp -rf ./src/main/resources/backend-submodule/nginx .
rm -r src
docker-compose -f docker-compose.yml up -d
12 changes: 6 additions & 6 deletions src/main/java/com/nainga/nainga/domain/store/api/StoreApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> createAllMobeomStores(@RequestParam(value = "fileName") String fileName) {
mobeomGoogleMapStoreService.createAllMobeomStores(fileName);
return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, null);
Expand All @@ -34,7 +34,7 @@ public Result<String> 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<CreateDividedMobeomStoresResponse> 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); //편하게 콘솔 로그에서 확인하기 위한 용도
Expand All @@ -44,7 +44,7 @@ public Result<CreateDividedMobeomStoresResponse> 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<String> createAllSafeStores(@RequestParam(value = "fileName") String fileName) {
safeGoogleMapStoreService.createAllSafeStores(fileName);
return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, null);
Expand All @@ -53,7 +53,7 @@ public Result<String> 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<CreateDividedSafeStoresResponse> 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); //편하게 콘솔 로그에서 확인하기 위한 용도
Expand All @@ -63,7 +63,7 @@ public Result<CreateDividedSafeStoresResponse> 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<String> createAllGoodPriceStores(@RequestParam(value = "fileName") String fileName) {
goodPriceGoogleMapStoreService.createAllGoodPriceStores(fileName);
return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, null);
Expand All @@ -72,7 +72,7 @@ public Result<String> 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<CreateDividedGoodPriceStoresResponse> 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); //편하게 콘솔 로그에서 확인하기 위한 용도
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class StoreCertificationApi {
private final StoreCertificationService storeCertificationService;

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

//총 사각형 영역의 네 꼭짓점 좌표를 받아 최대 75개를 랜덤하게 뽑아낸 뒤, 해당 가게들의 상세 정보를 반환
@Tag(name = "가게 상세 정보")
@Tag(name = "[Legacy] 가게 상세 정보")
@Operation(summary = "사용자 위치 기반 가게 상세 정보 제공 V2", description = "총 사각형 영역의 네 꼭짓점 좌표를 받아 최대 75개를 랜덤하게 뽑아낸 뒤, 해당 가게들의 상세 정보를 반환해줍니다.<br><br>" +
"[Request Body]<br>" +
"nwLong: 북서쪽 좌표 경도<br>" +
Expand All @@ -91,8 +91,90 @@ public Result<List<StoreCertificationsByLocationResponse>> findStoreCertificatio
"certificationName: 가게의 인증제 목록<br>" +
"=> 각 인증제별 순서는 보장되지 않습니다.")
@GetMapping("api/v2/storecertification/byLocation")
public Result<List<List<StoreCertificationsByLocationResponse>>> 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<List<StoreCertificationsByLocationResponse>> 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 = "[Legacy] 가게 상세 정보")
@Operation(summary = "사용자 위치 및 검색어 기반 가게 상세 정보 제공", description = "현재 사용자의 위치 좌표와 검색 키워드를 전달받아 가게 DB에서 검색한 뒤, 사용자와 가까운 순으로 최대 30개의 가게 상세 정보를 반환해줍니다.<br><br>" +
"[Request Body]<br>" +
"currLong: 현재 사용자의 위치 좌표 경도값<br>" +
"currLat: 현재 사용자의 위치 좌표 위도값<br>" +
"searchKeyword: 검색할 키워드<br><br>" +
"[Response Body]<br>" +
"id: Database 내 Primary Key값<br>" +
"displayName: 가게 이름<br>" +
"primaryTypeDisplayName: 업종<br>" +
"formattedAddress: 주소<br>" +
"phoneNumber: 전화번호<br>" +
"location: (경도, 위도) 가게 좌표<br>" +
"regularOpeningHours: 영업 시간<br>" +
"=> 특정 요일이 휴무인 경우에는 해당 요일에 대한 데이터가 들어있지 않습니다. Break time이 있는 경우 동일한 요일에 대해 영업 시간 데이터가 여러 개 존재할 수 있습니다. <br>" +
"localPhotos: 저장된 가게 사진 URL<br>" +
"certificationName: 가게의 인증제 목록<br>" +
"=> 각 인증제별 순서는 보장되지 않습니다.")
@GetMapping("api/v1/storecertification/byLocationAndKeyword")
public Result<List<StoreCertificationsByLocationResponse>> searchStoreCertificationsByLocationAndKeywordLegacy(@RequestParam("currLong") double currLong, @RequestParam("currLat") double currLat, @RequestParam("searchKeyword") String searchKeyword) {
List<StoreCertificationsByLocationResponse> 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개를 랜덤하게 뽑아낸 뒤, 해당 가게들의 상세 정보를 반환해줍니다.<br><br>" +
"[Request Body]<br>" +
"nwLong: 북서쪽 좌표 경도<br>" +
"nwLat: 북서쪽 좌표 위도<br>" +
"seLong: 남동쪽 좌표 경도<br>" +
"seLat: 남동쪽 좌표 위도<br><br>" +
"[Response Body]<br>" +
"id: Database 내 Primary Key값<br>" +
"displayName: 가게 이름<br>" +
"primaryTypeDisplayName: 업종<br>" +
"formattedAddress: 주소<br>" +
"phoneNumber: 전화번호<br>" +
"location: (경도, 위도) 가게 좌표<br>" +
"regularOpeningHours: 영업 시간<br>" +
"=> 특정 요일이 휴무인 경우에는 해당 요일에 대한 데이터가 들어있지 않습니다. Break time이 있는 경우 동일한 요일에 대해 영업 시간 데이터가 여러 개 존재할 수 있습니다. <br>" +
"localPhotos: 저장된 가게 사진 URL<br>" +
"certificationName: 가게의 인증제 목록<br>" +
"=> 각 인증제별 순서는 보장되지 않습니다.")
@GetMapping("api/storecertification/byLocation/v2")
public Result<List<List<StoreCertificationsByLocationResponse>>> 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<List<StoreCertificationsByLocationResponse>> 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개의 가게 상세 정보를 반환해줍니다.<br><br>" +
"[Request Body]<br>" +
"currLong: 현재 사용자의 위치 좌표 경도값<br>" +
"currLat: 현재 사용자의 위치 좌표 위도값<br>" +
"searchKeyword: 검색할 키워드<br><br>" +
"[Response Body]<br>" +
"id: Database 내 Primary Key값<br>" +
"displayName: 가게 이름<br>" +
"primaryTypeDisplayName: 업종<br>" +
"formattedAddress: 주소<br>" +
"phoneNumber: 전화번호<br>" +
"location: (경도, 위도) 가게 좌표<br>" +
"regularOpeningHours: 영업 시간<br>" +
"=> 특정 요일이 휴무인 경우에는 해당 요일에 대한 데이터가 들어있지 않습니다. Break time이 있는 경우 동일한 요일에 대해 영업 시간 데이터가 여러 개 존재할 수 있습니다. <br>" +
"localPhotos: 저장된 가게 사진 URL<br>" +
"certificationName: 가게의 인증제 목록<br>" +
"=> 각 인증제별 순서는 보장되지 않습니다.")
@GetMapping("api/storecertification/byLocationAndKeyword/v1")
public Result<List<StoreCertificationsByLocationResponse>> searchStoreCertificationsByLocationAndKeyword(@RequestParam("currLong") double currLong, @RequestParam("currLat") double currLat, @RequestParam("searchKeyword") String searchKeyword) {
List<StoreCertificationsByLocationResponse> storeCertificationsByLocationAndKeyword = storeCertificationService.searchStoreCertificationsByLocationAndKeyword(currLong, currLat, searchKeyword);
return new Result<>(Result.CODE_SUCCESS, Result.MESSAGE_OK, storeCertificationsByLocationAndKeyword);
}

}
Loading

0 comments on commit 2deeaf9

Please sign in to comment.