-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from woowa-techcamp-2024/feature/88-restauarnt…
…-exposure [feature] restauarnt exposure
- Loading branch information
Showing
25 changed files
with
262 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,3 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group = 'woowa.team4' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testImplementation platform('org.junit:junit-bom:5.10.0') | ||
testImplementation 'org.junit.jupiter:junit-jupiter' | ||
// module | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
domain/exposure-common-domain/src/main/java/woowa/team4/bff/interfaces/SearchService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package woowa.team4.bff.interfaces; | ||
|
||
import java.util.List; | ||
import woowa.team4.bff.domain.RestaurantSummary; | ||
|
||
public interface SearchService { | ||
List<Long> findIdsByKeywordAndDeliveryLocation(String keyword, String deliveryLocation, Integer pageNumber); | ||
List<RestaurantSummary> findRestaurantSummaryByKeywordAndDeliveryLocation(String keyword, String deliveryLocation, Integer pageNumber); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
dependencies { | ||
// module | ||
implementation project(":domain:exposure-common-domain") | ||
implementation project(":domain:search-domain-rdb") | ||
} |
4 changes: 4 additions & 0 deletions
4
domain/exposure-domain/src/main/java/woowa/team4/bff/exposure/command/SearchCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package woowa.team4.bff.exposure.command; | ||
|
||
public record SearchCommand(String keyword, String deliveryLocation, Integer pageNumber) { | ||
} |
20 changes: 19 additions & 1 deletion
20
...-domain/src/main/java/woowa/team4/bff/exposure/service/RestaurantExposureListService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
package woowa.team4.bff.exposure.service; | ||
|
||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import woowa.team4.bff.domain.RestaurantSummary; | ||
import woowa.team4.bff.exposure.command.SearchCommand; | ||
import woowa.team4.bff.interfaces.CacheService; | ||
import woowa.team4.bff.interfaces.SearchService; | ||
|
||
@Slf4j | ||
@Service | ||
@RequiredArgsConstructor | ||
public class RestaurantExposureListService { | ||
|
||
private final SearchService searchService; | ||
// private final CacheService cacheService; | ||
|
||
public List<RestaurantSummary> search(SearchCommand command){ | ||
// List<Long> restaurantIds = searchService.findIdsByKeywordAndDeliveryLocation(command.keyword(), command.deliveryLocation()); | ||
// return cacheService.findByRestaurantIds(restaurantIds); | ||
return List.of(); | ||
} | ||
|
||
// ToDo: 실험 후 제거 | ||
public List<RestaurantSummary> searchNoCache(SearchCommand command){ | ||
return searchService.findRestaurantSummaryByKeywordAndDeliveryLocation(command.keyword(), | ||
command.deliveryLocation(), command.pageNumber()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
dependencies { | ||
// module | ||
implementation project(":domain:restaurant-domain-rdb") | ||
implementation project(":domain:exposure-common-domain") | ||
} |
7 changes: 0 additions & 7 deletions
7
...arch-domain-rdb/src/main/java/woowa/team4/bff/search/command/SearchRestaurantCommand.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
...search-domain-rdb/src/main/java/woowa/team4/bff/search/domain/RestaurantSearchResult.java
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
...rdb/src/main/java/woowa/team4/bff/search/repository/RestaurantSearchResultRepository.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...main-rdb/src/main/java/woowa/team4/bff/search/repository/RestaurantSummaryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package woowa.team4.bff.search.repository; | ||
|
||
import java.awt.print.Pageable; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.domain.PageRequest; | ||
import org.springframework.stereotype.Repository; | ||
import woowa.team4.bff.domain.RestaurantSummary; | ||
import woowa.team4.bff.search.aop.MethodLogging; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class RestaurantSummaryRepository { | ||
private final int PAGE_SIZE = 25; | ||
private final RestaurantSummaryEntityRepository restaurantSummaryEntityRepository; | ||
|
||
@MethodLogging | ||
public List<Long> findIdsByKeywordAndDeliveryLocation(String keyword, String deliveryLocation, Integer pageNumber){ | ||
return restaurantSummaryEntityRepository.findIdsByKeywordAndDeliveryLocation(keyword, deliveryLocation, PageRequest.of(pageNumber, PAGE_SIZE)); | ||
} | ||
|
||
@MethodLogging | ||
public List<RestaurantSummary> findByKeywordAndDeliveryLocation(String keyword, String deliveryLocation, Integer pageNumber) { | ||
return restaurantSummaryEntityRepository.findByKeywordAndDeliveryLocation(keyword, deliveryLocation, PageRequest.of(pageNumber, PAGE_SIZE)); | ||
} | ||
|
||
// id in ids | ||
@MethodLogging | ||
public List<RestaurantSummary> findByRestaurantIds(List<Long> restaurantIds){ | ||
return restaurantSummaryEntityRepository.findByIds(restaurantIds); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
domain/search-domain-rdb/src/main/java/woowa/team4/bff/search/service/SearchRdbService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package woowa.team4.bff.search.service; | ||
|
||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import woowa.team4.bff.domain.RestaurantSummary; | ||
import woowa.team4.bff.interfaces.SearchService; | ||
import woowa.team4.bff.search.repository.RestaurantSummaryRepository; | ||
|
||
@Slf4j | ||
@Service | ||
@RequiredArgsConstructor | ||
public class SearchRdbService implements SearchService { | ||
private final RestaurantSummaryRepository restaurantSummaryRepository; | ||
|
||
@Override | ||
public List<Long> findIdsByKeywordAndDeliveryLocation(String keyword, String deliveryLocation, Integer pageNumber) { | ||
return restaurantSummaryRepository.findIdsByKeywordAndDeliveryLocation(keyword, deliveryLocation, pageNumber); | ||
|
||
} | ||
|
||
@Override | ||
public List<RestaurantSummary> findRestaurantSummaryByKeywordAndDeliveryLocation(String keyword, | ||
String deliveryLocation, | ||
Integer pageNumber) { | ||
return restaurantSummaryRepository.findByKeywordAndDeliveryLocation(keyword, deliveryLocation, pageNumber); | ||
} | ||
} |
Oops, something went wrong.