-
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.
all is tested
- Loading branch information
Alexander Emelianov
authored and
Alexander Emelianov
committed
Feb 19, 2019
1 parent
29ebde6
commit 49547a4
Showing
11 changed files
with
99 additions
and
28 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
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
9 changes: 3 additions & 6 deletions
9
src/main/java/ru/reliabletech/zuul/swagger/service/GenericRouteService.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
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
8 changes: 8 additions & 0 deletions
8
src/main/java/ru/reliabletech/zuul/swagger/service/RouteService.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,10 +1,18 @@ | ||
package ru.reliabletech.zuul.swagger.service; | ||
|
||
/** | ||
* Service for mapping routes to proxy path | ||
* | ||
* @author Alexandr Emelyanov <mr.lex91@gmail.com> | ||
* on 15.02.19. | ||
*/ | ||
public interface RouteService { | ||
|
||
/** | ||
* Perform route mapping to proxy path | ||
* | ||
* @param route | ||
* @return | ||
*/ | ||
String getPath(String route); | ||
} |
16 changes: 8 additions & 8 deletions
16
...service/VersionedPatternRouteService.java → ...rvice/ServiceRouteMapperRouteService.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,26 +1,26 @@ | ||
package ru.reliabletech.zuul.swagger.service; | ||
|
||
import lombok.AllArgsConstructor; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.cloud.netflix.zuul.filters.discovery.ServiceRouteMapper; | ||
import org.springframework.stereotype.Component; | ||
import ru.reliabletech.zuul.swagger.props.ServicesSwaggerInfo; | ||
|
||
/** | ||
* Realization? based on {@link ServiceRouteMapper } | ||
* | ||
* @author Alexandr Emelyanov <mr.lex91@gmail.com> | ||
* on 15.02.19. | ||
*/ | ||
@Component | ||
@ConditionalOnBean(ServiceRouteMapper.class) | ||
@AllArgsConstructor | ||
public class VersionedPatternRouteService implements RouteService { | ||
public class ServiceRouteMapperRouteService implements RouteService { | ||
|
||
@Autowired | ||
private ServicesSwaggerInfo servicesSwaggerInfo; | ||
@Autowired | ||
private ServiceRouteMapper serviceRouteMapper; | ||
|
||
@Override | ||
public String getPath(String route) { | ||
return servicesSwaggerInfo.getServicePath(route) | ||
return servicesSwaggerInfo | ||
.getServicePath(route) | ||
.orElseGet(() -> serviceRouteMapper.apply(route)); | ||
} | ||
} |
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