-
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.
feature preview. the main work is done
- Loading branch information
Showing
18 changed files
with
244 additions
and
167 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
27 changes: 0 additions & 27 deletions
27
src/main/java/ru/reliabletech/zuul/swagger/GenericSwaggerService.java
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
src/main/java/ru/reliabletech/zuul/swagger/ServiceInfo.java
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/main/java/ru/reliabletech/zuul/swagger/SwaggerService.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
36 changes: 0 additions & 36 deletions
36
src/main/java/ru/reliabletech/zuul/swagger/ZuulSwaggerController.java
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
src/main/java/ru/reliabletech/zuul/swagger/controller/ZuulSwaggerController.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,26 @@ | ||
package ru.reliabletech.zuul.swagger.controller; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import ru.reliabletech.zuul.swagger.service.SwaggerService; | ||
|
||
/** | ||
* Controller for api | ||
* | ||
* @author Alexandr Emelyanov <[email protected]> | ||
* on 27.11.2017. | ||
*/ | ||
@RestController | ||
public class ZuulSwaggerController { | ||
|
||
@Autowired | ||
private SwaggerService swaggerService; | ||
|
||
@GetMapping("/api-docs") | ||
public JsonNode getApiDocs(@RequestParam("route") String route) { | ||
return swaggerService.getSwaggerDoc(route); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...etech/zuul/swagger/NotFoundException.java → .../swagger/exception/NotFoundException.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
22 changes: 22 additions & 0 deletions
22
src/main/java/ru/reliabletech/zuul/swagger/props/ServiceInfo.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 ru.reliabletech.zuul.swagger.props; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* @author Alexandr Emelyanov <[email protected]> | ||
* on 27.11.2017. | ||
*/ | ||
@Data | ||
class ServiceInfo { | ||
|
||
private String path; | ||
|
||
private String serviceId; | ||
|
||
private String url; | ||
|
||
private String swaggerUri; | ||
|
||
private String protocol = ""; | ||
|
||
} |
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
26 changes: 26 additions & 0 deletions
26
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ru.reliabletech.zuul.swagger.service; | ||
|
||
import lombok.AllArgsConstructor; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.stereotype.Component; | ||
import ru.reliabletech.zuul.swagger.props.ServicesSwaggerInfo; | ||
|
||
/** | ||
* @author Alexandr Emelyanov <[email protected]> | ||
* on 15.02.19. | ||
*/ | ||
@ConditionalOnMissingBean(RouteService.class) | ||
@Component | ||
@AllArgsConstructor | ||
public class GenericRouteService implements RouteService { | ||
|
||
private ServicesSwaggerInfo servicesSwaggerInfo; | ||
|
||
@Override | ||
public String getPath(String route) { | ||
return servicesSwaggerInfo | ||
.getServicePath(route) | ||
.orElse(route); | ||
} | ||
} |
Oops, something went wrong.