-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
490 additions
and
290 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.siriusxi.ms.store</groupId> | ||
<artifactId>store-aggregator</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>Springy Store Aggregator</name> | ||
<description>Aggregator pom project for Springy μServices</description> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<maven.install.skip>true</maven.install.skip> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
|
||
|
||
<modules> | ||
<module>product-composite-service</module> | ||
<module>product-service</module> | ||
<module>review-service</module> | ||
<module>recommendation-service</module> | ||
<module>store-api</module> | ||
<module>store-utils</module> | ||
<module>store-build-chassis</module> | ||
<module>store-service-chassis</module> | ||
</modules> | ||
</project> |
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
78 changes: 78 additions & 0 deletions
78
...service/src/main/java/com/siriusxi/ms/store/pcs/config/ProductCompositeConfiguration.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,78 @@ | ||
package com.siriusxi.ms.store.pcs.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.client.RestTemplate; | ||
import springfox.documentation.builders.PathSelectors; | ||
import springfox.documentation.service.ApiInfo; | ||
import springfox.documentation.service.Contact; | ||
import springfox.documentation.spring.web.plugins.Docket; | ||
|
||
import static java.util.Collections.emptyList; | ||
import static org.springframework.web.bind.annotation.RequestMethod.GET; | ||
import static springfox.documentation.builders.RequestHandlerSelectors.basePackage; | ||
import static springfox.documentation.spi.DocumentationType.SWAGGER_2; | ||
|
||
@Configuration | ||
public class ProductCompositeConfiguration { | ||
@Value("${api.common.version}") | ||
String apiVersion; | ||
@Value("${api.common.title}") | ||
String apiTitle; | ||
@Value("${api.common.description}") | ||
String apiDescription; | ||
@Value("${api.common.termsOfServiceUrl}") | ||
String apiTermsOfServiceUrl; | ||
@Value("${api.common.license}") | ||
String apiLicense; | ||
@Value("${api.common.licenseUrl}") | ||
String apiLicenseUrl; | ||
@Value("${api.common.contact.name}") | ||
String apiContactName; | ||
@Value("${api.common.contact.url}") | ||
String apiContactUrl; | ||
@Value("${api.common.contact.email}") | ||
String apiContactEmail; | ||
|
||
@Bean | ||
RestTemplate newRestClient() { | ||
return new RestTemplate(); | ||
} | ||
|
||
/** | ||
* Will exposed on $HOST:$PORT/swagger-ui.html | ||
* | ||
* @return Docket swagger configuration | ||
*/ | ||
@Bean | ||
public Docket apiDocumentation() { | ||
|
||
return new Docket(SWAGGER_2) | ||
.select() | ||
/* | ||
Using the apis() and paths() methods, | ||
we can specify where SpringFox shall look for API documentation. | ||
*/ | ||
.apis(basePackage("com.siriusxi.ms.store.pcs")) | ||
.paths(PathSelectors.any()) | ||
.build() | ||
/* | ||
Using the globalResponseMessage() method, we ask SpringFox not to add any default HTTP response codes to the API documentation, such as 401 and 403, which we don't currently use. | ||
*/ | ||
.globalResponseMessage(GET, emptyList()) | ||
/* | ||
The api* variables that are used to configure the Docket bean with general information about the API are initialized from the property file using Spring @Value annotations. | ||
*/ | ||
.apiInfo(new ApiInfo( | ||
apiTitle, | ||
apiDescription, | ||
apiVersion, | ||
apiTermsOfServiceUrl, | ||
new Contact(apiContactName, apiContactUrl, apiContactEmail), | ||
apiLicense, | ||
apiLicenseUrl, | ||
emptyList() | ||
)); | ||
} | ||
} |
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.