From 2f0f6fad1f6a57b6b9aacb281897b13872226e8d Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Wed, 13 Nov 2024 22:19:44 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[feat]=20=EA=B2=80=EC=83=89=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20Ngram=20Index=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/schema.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/sql/schema.sql b/src/main/resources/sql/schema.sql index 95c33646..4967f1a2 100644 --- a/src/main/resources/sql/schema.sql +++ b/src/main/resources/sql/schema.sql @@ -5,6 +5,8 @@ create table influencer job varchar(20) not null, name varchar(30) not null, img_url text not null + + FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram ); create table places @@ -21,6 +23,8 @@ create table places longitude text not null, menu_img_url text null, category enum ('CAFE', 'JAPANESE', 'KOREAN', 'NONE', 'RESTAURANT', 'WESTERN') not null + + FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram ); create table places_menuboardphotourl_list From 2c523fbd2771ac76ea734ff69734d35debd76b98 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Wed, 13 Nov 2024 23:54:43 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[refactor]=20readOnly=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team7/inplace/search/application/SearchService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/team7/inplace/search/application/SearchService.java b/src/main/java/team7/inplace/search/application/SearchService.java index 288380f7..191bcdb5 100644 --- a/src/main/java/team7/inplace/search/application/SearchService.java +++ b/src/main/java/team7/inplace/search/application/SearchService.java @@ -46,7 +46,6 @@ public List searchAutoCompletions(String keyword) { .toList(); } - @Transactional(readOnly = true) public List searchVideo(String keyword) { var videoInfos = videoSearchRepository.searchEntityByKeywords(keyword); @@ -57,7 +56,6 @@ public List searchVideo(String keyword) { .toList(); } - @Transactional(readOnly = true) public List searchInfluencer(String keyword) { var influencerInfos = influencerSearchRepository.searchEntityByKeywords(keyword); Long userId = AuthorizationUtil.getUserId(); From 7bdffca437302ff7468943471b381b0bda248b4a Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Thu, 14 Nov 2024 00:19:20 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[feat]=20userId=EB=A1=9C=20=EC=A2=8B?= =?UTF-8?q?=EC=95=84=EC=9A=94=ED=95=9C=20=EC=9E=A5=EC=86=8C=20id=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=20=EC=BF=BC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../likedPlace/persistence/LikedPlaceRepository.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java b/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java index 66f17eac..680afa79 100644 --- a/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java +++ b/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java @@ -1,9 +1,12 @@ package team7.inplace.likedPlace.persistence; import java.util.Optional; +import java.util.Set; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import team7.inplace.likedPlace.domain.LikedPlace; public interface LikedPlaceRepository extends JpaRepository { @@ -11,4 +14,7 @@ public interface LikedPlaceRepository extends JpaRepository { Optional findByUserIdAndPlaceId(Long userId, Long placeId); Page findByUserIdAndIsLikedTrue(Long userId, Pageable pageable); + + @Query("SELECT l.place.id FROM LikedPlace l WHERE l.user.id = :userId AND l.isLiked = true") + Set findPlaceIdsByUserIdAndIsLikedTrue(@Param("userId") Long userId); } From 3925ff263184f863aebe0f4227d34501ebd3408a Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Thu, 14 Nov 2024 00:19:41 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[feat]=20=ED=82=A4=EC=9B=8C=EB=93=9C?= =?UTF-8?q?=EB=A1=9C=20=EC=9E=A5=EC=86=8C=20=EA=B2=80=EC=83=89=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/application/SearchService.java | 23 +++++++++++++++++++ .../application/dto/PlaceSearchInfo.java | 19 +++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java diff --git a/src/main/java/team7/inplace/search/application/SearchService.java b/src/main/java/team7/inplace/search/application/SearchService.java index 191bcdb5..18ae87af 100644 --- a/src/main/java/team7/inplace/search/application/SearchService.java +++ b/src/main/java/team7/inplace/search/application/SearchService.java @@ -9,7 +9,9 @@ import org.springframework.transaction.annotation.Transactional; import team7.inplace.favoriteInfluencer.persistent.FavoriteInfluencerRepository; import team7.inplace.influencer.application.dto.InfluencerInfo; +import team7.inplace.likedPlace.persistence.LikedPlaceRepository; import team7.inplace.search.application.dto.AutoCompletionInfo; +import team7.inplace.search.application.dto.PlaceSearchInfo; import team7.inplace.search.application.dto.SearchType; import team7.inplace.search.persistence.InfluencerSearchRepository; import team7.inplace.search.persistence.PlaceSearchRepository; @@ -28,6 +30,7 @@ public class SearchService { private final InfluencerSearchRepository influencerSearchRepository; private final PlaceSearchRepository placeSearchRepository; private final FavoriteInfluencerRepository favoriteInfluencerRepository; + private final LikedPlaceRepository likedPlaceRepository; public List searchAutoCompletions(String keyword) { var influencerSearchInfo = influencerSearchRepository.searchEntityByKeywords(keyword); @@ -76,4 +79,24 @@ public List searchInfluencer(String keyword) { .sorted((a, b) -> Boolean.compare(b.likes(), a.likes())) .toList(); } + + public List searchPlace(String keyword) { + var placeInfos = placeSearchRepository.searchEntityByKeywords(keyword); + Long userId = AuthorizationUtil.getUserId(); + + if (userId == null) { + return placeInfos.stream() + .map(placeInfo -> PlaceSearchInfo.from(placeInfo.searchResult(), false)) + .toList(); + } + + var likedPlaceIds = likedPlaceRepository.findPlaceIdsByUserIdAndIsLikedTrue(userId); + return placeInfos.stream() + .map(placeInfo -> { + boolean isLiked = likedPlaceIds.contains(placeInfo.searchResult().getId()); + return PlaceSearchInfo.from(placeInfo.searchResult(), isLiked); + }) + .sorted((a, b) -> Boolean.compare(b.likes(), a.likes())) + .toList(); + } } diff --git a/src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java b/src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java new file mode 100644 index 00000000..9d85df53 --- /dev/null +++ b/src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java @@ -0,0 +1,19 @@ +package team7.inplace.search.application.dto; + +import team7.inplace.place.domain.Place; + +public record PlaceSearchInfo( + Long placeId, + String placeName, + String imageUrl, + Boolean likes +) { + public static PlaceSearchInfo from(Place place, Boolean likes) { + return new PlaceSearchInfo( + place.getId(), + place.getName(), + place.getMenuImgUrl(), + likes + ); + } +} From 8b68de0d6f2cc34d07c8aedccb71ea49b2e28fa4 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Thu, 14 Nov 2024 00:19:52 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[feat]=20=ED=82=A4=EC=9B=8C=EB=93=9C?= =?UTF-8?q?=EB=A1=9C=20=EC=9E=A5=EC=86=8C=20=EA=B2=80=EC=83=89=20API=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inplace/search/presentation/SearchController.java | 9 +++++++++ .../search/presentation/SearchControllerApiSpec.java | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/team7/inplace/search/presentation/SearchController.java b/src/main/java/team7/inplace/search/presentation/SearchController.java index b3928eb2..6ce45281 100644 --- a/src/main/java/team7/inplace/search/presentation/SearchController.java +++ b/src/main/java/team7/inplace/search/presentation/SearchController.java @@ -11,6 +11,7 @@ import team7.inplace.influencer.presentation.dto.InfluencerResponse; import team7.inplace.search.application.SearchService; import team7.inplace.search.application.dto.AutoCompletionInfo; +import team7.inplace.search.application.dto.PlaceSearchInfo; import team7.inplace.video.presentation.dto.VideoResponse; @RestController @@ -48,4 +49,12 @@ public ResponseEntity> searchInfluencer(@RequestParam S .toList(); return new ResponseEntity<>(response, HttpStatus.OK); } + + @Override + @GetMapping("/place") + public ResponseEntity> searchPlace(@RequestParam String value) { + var places = searchService.searchPlace(value); + + return new ResponseEntity<>(places, HttpStatus.OK); + } } diff --git a/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java b/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java index b576b87a..7ce9e0f1 100644 --- a/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java +++ b/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java @@ -7,6 +7,7 @@ import org.springframework.http.ResponseEntity; import team7.inplace.influencer.presentation.dto.InfluencerResponse; import team7.inplace.search.application.dto.AutoCompletionInfo; +import team7.inplace.search.application.dto.PlaceSearchInfo; import team7.inplace.video.presentation.dto.VideoResponse; @Tag(name = "검색 API입니다.") @@ -23,4 +24,8 @@ public interface SearchControllerApiSpec { @Operation(summary = "인플루언서를 검색합니다.") @ApiResponse(responseCode = "200", description = "인플루언서 검색 성공") ResponseEntity> searchInfluencer(String value); + + @Operation(summary = "장소를 검색합니다.") + @ApiResponse(responseCode = "200", description = "장소 검색 성공") + ResponseEntity> searchPlace(String value); } From bde94e4a6e4a3c47d942c2d6aec55e2bd2886063 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Thu, 14 Nov 2024 00:23:30 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[refactor]=20ddl=20=ED=98=95=EC=8B=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/schema.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/sql/schema.sql b/src/main/resources/sql/schema.sql index 4967f1a2..f1f32ac4 100644 --- a/src/main/resources/sql/schema.sql +++ b/src/main/resources/sql/schema.sql @@ -6,7 +6,7 @@ create table influencer name varchar(30) not null, img_url text not null - FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram + FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram ); create table places @@ -24,7 +24,7 @@ create table places menu_img_url text null, category enum ('CAFE', 'JAPANESE', 'KOREAN', 'NONE', 'RESTAURANT', 'WESTERN') not null - FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram + FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram ); create table places_menuboardphotourl_list From 3d6f7f4988d56c4c64cb82795d89f25e1e6dcf93 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Wed, 13 Nov 2024 22:19:44 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[feat]=20=EA=B2=80=EC=83=89=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20Ngram=20Index=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/schema.sql | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/resources/sql/schema.sql b/src/main/resources/sql/schema.sql index 0ce15c4c..f0b39453 100644 --- a/src/main/resources/sql/schema.sql +++ b/src/main/resources/sql/schema.sql @@ -4,7 +4,9 @@ create table influencer primary key, job varchar(20) not null, name varchar(30) not null, - img_url text not null + img_url text not null, + + FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram ); create table places @@ -20,8 +22,10 @@ create table places latitude text not null, longitude text not null, menu_img_url text null, - category enum ('CAFE', 'JAPANESE', 'KOREAN', 'NONE', 'RESTAURANT', 'WESTERN') not null, - index idx_long_lat (longitude(15), latitude(15)) + category enum ('CAFE', 'JAPANESE', 'KOREAN', 'NONE', 'RESTAURANT', 'WESTERN') not null + + FULLTEXT INDEX ft_name_ngram (name) WITH PARSER ngram, + INDEX idx_long_lat (longitude(15), latitude(15)) ); create table places_menuboardphotourl_list From 46d1512162465dba7b9ff5262334839c661febd1 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Wed, 13 Nov 2024 23:54:43 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[refactor]=20readOnly=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team7/inplace/search/application/SearchService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/team7/inplace/search/application/SearchService.java b/src/main/java/team7/inplace/search/application/SearchService.java index 288380f7..191bcdb5 100644 --- a/src/main/java/team7/inplace/search/application/SearchService.java +++ b/src/main/java/team7/inplace/search/application/SearchService.java @@ -46,7 +46,6 @@ public List searchAutoCompletions(String keyword) { .toList(); } - @Transactional(readOnly = true) public List searchVideo(String keyword) { var videoInfos = videoSearchRepository.searchEntityByKeywords(keyword); @@ -57,7 +56,6 @@ public List searchVideo(String keyword) { .toList(); } - @Transactional(readOnly = true) public List searchInfluencer(String keyword) { var influencerInfos = influencerSearchRepository.searchEntityByKeywords(keyword); Long userId = AuthorizationUtil.getUserId(); From 3edaf614177c4b6a2669e70349ea1a454c74eeee Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Thu, 14 Nov 2024 00:19:20 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[feat]=20userId=EB=A1=9C=20=EC=A2=8B?= =?UTF-8?q?=EC=95=84=EC=9A=94=ED=95=9C=20=EC=9E=A5=EC=86=8C=20id=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=20=EC=BF=BC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../likedPlace/persistence/LikedPlaceRepository.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java b/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java index 66f17eac..680afa79 100644 --- a/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java +++ b/src/main/java/team7/inplace/likedPlace/persistence/LikedPlaceRepository.java @@ -1,9 +1,12 @@ package team7.inplace.likedPlace.persistence; import java.util.Optional; +import java.util.Set; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import team7.inplace.likedPlace.domain.LikedPlace; public interface LikedPlaceRepository extends JpaRepository { @@ -11,4 +14,7 @@ public interface LikedPlaceRepository extends JpaRepository { Optional findByUserIdAndPlaceId(Long userId, Long placeId); Page findByUserIdAndIsLikedTrue(Long userId, Pageable pageable); + + @Query("SELECT l.place.id FROM LikedPlace l WHERE l.user.id = :userId AND l.isLiked = true") + Set findPlaceIdsByUserIdAndIsLikedTrue(@Param("userId") Long userId); } From f5cbc9996bcc15a09267e708db1d4baa4af23b6b Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Thu, 14 Nov 2024 00:19:41 +0900 Subject: [PATCH 10/11] =?UTF-8?q?[feat]=20=ED=82=A4=EC=9B=8C=EB=93=9C?= =?UTF-8?q?=EB=A1=9C=20=EC=9E=A5=EC=86=8C=20=EA=B2=80=EC=83=89=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/application/SearchService.java | 23 +++++++++++++++++++ .../application/dto/PlaceSearchInfo.java | 19 +++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java diff --git a/src/main/java/team7/inplace/search/application/SearchService.java b/src/main/java/team7/inplace/search/application/SearchService.java index 191bcdb5..18ae87af 100644 --- a/src/main/java/team7/inplace/search/application/SearchService.java +++ b/src/main/java/team7/inplace/search/application/SearchService.java @@ -9,7 +9,9 @@ import org.springframework.transaction.annotation.Transactional; import team7.inplace.favoriteInfluencer.persistent.FavoriteInfluencerRepository; import team7.inplace.influencer.application.dto.InfluencerInfo; +import team7.inplace.likedPlace.persistence.LikedPlaceRepository; import team7.inplace.search.application.dto.AutoCompletionInfo; +import team7.inplace.search.application.dto.PlaceSearchInfo; import team7.inplace.search.application.dto.SearchType; import team7.inplace.search.persistence.InfluencerSearchRepository; import team7.inplace.search.persistence.PlaceSearchRepository; @@ -28,6 +30,7 @@ public class SearchService { private final InfluencerSearchRepository influencerSearchRepository; private final PlaceSearchRepository placeSearchRepository; private final FavoriteInfluencerRepository favoriteInfluencerRepository; + private final LikedPlaceRepository likedPlaceRepository; public List searchAutoCompletions(String keyword) { var influencerSearchInfo = influencerSearchRepository.searchEntityByKeywords(keyword); @@ -76,4 +79,24 @@ public List searchInfluencer(String keyword) { .sorted((a, b) -> Boolean.compare(b.likes(), a.likes())) .toList(); } + + public List searchPlace(String keyword) { + var placeInfos = placeSearchRepository.searchEntityByKeywords(keyword); + Long userId = AuthorizationUtil.getUserId(); + + if (userId == null) { + return placeInfos.stream() + .map(placeInfo -> PlaceSearchInfo.from(placeInfo.searchResult(), false)) + .toList(); + } + + var likedPlaceIds = likedPlaceRepository.findPlaceIdsByUserIdAndIsLikedTrue(userId); + return placeInfos.stream() + .map(placeInfo -> { + boolean isLiked = likedPlaceIds.contains(placeInfo.searchResult().getId()); + return PlaceSearchInfo.from(placeInfo.searchResult(), isLiked); + }) + .sorted((a, b) -> Boolean.compare(b.likes(), a.likes())) + .toList(); + } } diff --git a/src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java b/src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java new file mode 100644 index 00000000..9d85df53 --- /dev/null +++ b/src/main/java/team7/inplace/search/application/dto/PlaceSearchInfo.java @@ -0,0 +1,19 @@ +package team7.inplace.search.application.dto; + +import team7.inplace.place.domain.Place; + +public record PlaceSearchInfo( + Long placeId, + String placeName, + String imageUrl, + Boolean likes +) { + public static PlaceSearchInfo from(Place place, Boolean likes) { + return new PlaceSearchInfo( + place.getId(), + place.getName(), + place.getMenuImgUrl(), + likes + ); + } +} From 33c2f5077571d50addbf6bbb8699ffe7d846ef44 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Thu, 14 Nov 2024 00:19:52 +0900 Subject: [PATCH 11/11] =?UTF-8?q?[feat]=20=ED=82=A4=EC=9B=8C=EB=93=9C?= =?UTF-8?q?=EB=A1=9C=20=EC=9E=A5=EC=86=8C=20=EA=B2=80=EC=83=89=20API=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inplace/search/presentation/SearchController.java | 9 +++++++++ .../search/presentation/SearchControllerApiSpec.java | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/team7/inplace/search/presentation/SearchController.java b/src/main/java/team7/inplace/search/presentation/SearchController.java index b3928eb2..6ce45281 100644 --- a/src/main/java/team7/inplace/search/presentation/SearchController.java +++ b/src/main/java/team7/inplace/search/presentation/SearchController.java @@ -11,6 +11,7 @@ import team7.inplace.influencer.presentation.dto.InfluencerResponse; import team7.inplace.search.application.SearchService; import team7.inplace.search.application.dto.AutoCompletionInfo; +import team7.inplace.search.application.dto.PlaceSearchInfo; import team7.inplace.video.presentation.dto.VideoResponse; @RestController @@ -48,4 +49,12 @@ public ResponseEntity> searchInfluencer(@RequestParam S .toList(); return new ResponseEntity<>(response, HttpStatus.OK); } + + @Override + @GetMapping("/place") + public ResponseEntity> searchPlace(@RequestParam String value) { + var places = searchService.searchPlace(value); + + return new ResponseEntity<>(places, HttpStatus.OK); + } } diff --git a/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java b/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java index b576b87a..7ce9e0f1 100644 --- a/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java +++ b/src/main/java/team7/inplace/search/presentation/SearchControllerApiSpec.java @@ -7,6 +7,7 @@ import org.springframework.http.ResponseEntity; import team7.inplace.influencer.presentation.dto.InfluencerResponse; import team7.inplace.search.application.dto.AutoCompletionInfo; +import team7.inplace.search.application.dto.PlaceSearchInfo; import team7.inplace.video.presentation.dto.VideoResponse; @Tag(name = "검색 API입니다.") @@ -23,4 +24,8 @@ public interface SearchControllerApiSpec { @Operation(summary = "인플루언서를 검색합니다.") @ApiResponse(responseCode = "200", description = "인플루언서 검색 성공") ResponseEntity> searchInfluencer(String value); + + @Operation(summary = "장소를 검색합니다.") + @ApiResponse(responseCode = "200", description = "장소 검색 성공") + ResponseEntity> searchPlace(String value); }