-
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 #118 from woowa-techcamp-2024/refactor/113-서버-분리
Refactor/113 서버 분리
- Loading branch information
Showing
103 changed files
with
897 additions
and
1,437,298 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dependencies { | ||
implementation project(":api-client:common-client") | ||
} |
49 changes: 49 additions & 0 deletions
49
...nt/cache-client/src/main/java/woowa/team4/bff/api/client/cache/caller/CacheApiCaller.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,49 @@ | ||
package woowa.team4.bff.api.client.cache.caller; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CompletableFuture; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.core.ParameterizedTypeReference; | ||
import org.springframework.stereotype.Component; | ||
import reactor.core.publisher.Mono; | ||
import woowa.team4.bff.api.client.cache.config.CacheClientConfiguration; | ||
import woowa.team4.bff.api.client.cache.request.CacheRequest; | ||
import woowa.team4.bff.api.client.cache.response.CacheResponse; | ||
import woowa.tema4.bff.api.client.caller.AsyncClientApiCaller; | ||
import woowa.tema4.bff.api.client.caller.SyncClientApiCaller; | ||
import woowa.tema4.bff.api.client.caller.WebClientCaller; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class CacheApiCaller { | ||
|
||
private final CacheClientConfiguration cacheClientConfiguration; | ||
private final SyncClientApiCaller syncClientApiCaller; | ||
private final AsyncClientApiCaller asyncClientApiCaller; | ||
private final WebClientCaller webClientCaller; | ||
|
||
public List<CacheResponse> send(CacheRequest cacheRequest) { | ||
return syncClientApiCaller.post(cacheClientConfiguration.getUrl(), | ||
cacheRequest, | ||
new ParameterizedTypeReference<>() { | ||
}); | ||
} | ||
|
||
public CompletableFuture<List<CacheResponse>> sendAsyncCompletableFuture( | ||
CacheRequest cacheRequest) { | ||
return asyncClientApiCaller.post(cacheClientConfiguration.getUrl(), | ||
cacheRequest, | ||
new ParameterizedTypeReference<>() { | ||
}); | ||
} | ||
|
||
public Mono<List<CacheResponse>> sendAsyncMono( | ||
CacheRequest cacheRequest) { | ||
return webClientCaller.post( | ||
cacheClientConfiguration.getUrl(), | ||
cacheRequest, | ||
new ParameterizedTypeReference<>() { | ||
} | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...lient/src/main/java/woowa/team4/bff/api/client/cache/config/CacheClientConfiguration.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,22 @@ | ||
package woowa.team4.bff.api.client.cache.config; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
import woowa.tema4.bff.api.client.config.ApiClientConfiguration; | ||
|
||
@Getter | ||
@Setter | ||
@Configuration | ||
@Import(ApiClientConfiguration.class) | ||
public class CacheClientConfiguration { | ||
|
||
@Value("${external-api.cache-service.endpoints}") | ||
private String endpoints; | ||
|
||
public String getUrl() { | ||
return endpoints; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ent/cache-client/src/main/java/woowa/team4/bff/api/client/cache/request/CacheRequest.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,18 @@ | ||
package woowa.team4.bff.api.client.cache.request; | ||
|
||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@ToString | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class CacheRequest { | ||
|
||
private List<Long> ids; | ||
} |
25 changes: 25 additions & 0 deletions
25
...t/cache-client/src/main/java/woowa/team4/bff/api/client/cache/response/CacheResponse.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,25 @@ | ||
package woowa.team4.bff.api.client.cache.response; | ||
|
||
import java.util.UUID; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Builder | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class CacheResponse { | ||
|
||
private Long restaurantId; | ||
private UUID restaurantUuid; | ||
private String restaurantName; | ||
private String restaurantThumbnailUrl; | ||
private int minimumOrderAmount; | ||
private long reviewCount; | ||
private double rating; | ||
private String menus; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dependencies { | ||
implementation project(":api-client:common-client") | ||
} |
48 changes: 48 additions & 0 deletions
48
...client/search-client/src/main/java/woowa/team4/bff/api/client/caller/SearchApiCaller.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,48 @@ | ||
package woowa.team4.bff.api.client.caller; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CompletableFuture; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.core.ParameterizedTypeReference; | ||
import org.springframework.stereotype.Component; | ||
import reactor.core.publisher.Mono; | ||
import woowa.tema4.bff.api.client.caller.AsyncClientApiCaller; | ||
import woowa.tema4.bff.api.client.caller.SyncClientApiCaller; | ||
import woowa.tema4.bff.api.client.caller.WebClientCaller; | ||
import woowa.team4.bff.api.client.config.SearchClientConfiguration; | ||
import woowa.team4.bff.api.client.request.SearchRequest; | ||
import woowa.team4.bff.api.client.response.SearchResponse; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class SearchApiCaller { | ||
private final SearchClientConfiguration searchClientConfiguration; | ||
private final SyncClientApiCaller syncClientApiCaller; | ||
private final AsyncClientApiCaller asyncClientApiCaller; | ||
private final WebClientCaller webClientCaller; | ||
|
||
public SearchResponse send(SearchRequest SearchRequest) { | ||
return syncClientApiCaller.post(searchClientConfiguration.getUrl(), | ||
SearchRequest, | ||
new ParameterizedTypeReference<>() { | ||
}); | ||
} | ||
|
||
public CompletableFuture<List<SearchResponse>> sendAsyncCompletableFuture( | ||
SearchRequest SearchRequest) { | ||
return asyncClientApiCaller.post(searchClientConfiguration.getUrl(), | ||
SearchRequest, | ||
new ParameterizedTypeReference<>() { | ||
}); | ||
} | ||
|
||
public Mono<List<SearchResponse>> sendAsyncMono( | ||
SearchRequest SearchRequest) { | ||
return webClientCaller.post( | ||
searchClientConfiguration.getUrl(), | ||
SearchRequest, | ||
new ParameterizedTypeReference<>() { | ||
} | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...rch-client/src/main/java/woowa/team4/bff/api/client/config/SearchClientConfiguration.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,22 @@ | ||
package woowa.team4.bff.api.client.config; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
import woowa.tema4.bff.api.client.config.ApiClientConfiguration; | ||
|
||
@Getter | ||
@Setter | ||
@Configuration | ||
@Import(ApiClientConfiguration.class) | ||
public class SearchClientConfiguration { | ||
|
||
@Value("${external-api.search-service.endpoints}") | ||
private String endpoints; | ||
|
||
public String getUrl() { | ||
return endpoints; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
api-client/search-client/src/main/java/woowa/team4/bff/api/client/request/SearchRequest.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,15 @@ | ||
package woowa.team4.bff.api.client.request; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
public class SearchRequest { | ||
|
||
private String keyword; | ||
private String deliveryLocation; | ||
private Integer pageNumber; | ||
} |
18 changes: 18 additions & 0 deletions
18
...lient/search-client/src/main/java/woowa/team4/bff/api/client/response/SearchResponse.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,18 @@ | ||
package woowa.team4.bff.api.client.response; | ||
|
||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@Builder | ||
@AllArgsConstructor | ||
public class SearchResponse { | ||
|
||
List<Long> ids; | ||
} |
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
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
Oops, something went wrong.