Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
order-management-backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
order-management-backend
Commits
f863568e
Commit
f863568e
authored
May 06, 2021
by
Shanelle Valencia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-85]
😎
Add dependencies and integrate swagger [
@svalencia
]
parent
3d1389fa
Pipeline
#1653
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
3 deletions
+67
-3
pom.xml
backend/order-management/pom.xml
+11
-1
AppConfig.java
...c/main/java/com/afp/ordermanagement/config/AppConfig.java
+5
-2
SwaggerConfig.java
...in/java/com/afp/ordermanagement/config/SwaggerConfig.java
+39
-0
WebFluxConfig.java
...in/java/com/afp/ordermanagement/config/WebFluxConfig.java
+12
-0
No files found.
backend/order-management/pom.xml
View file @
f863568e
...
@@ -46,7 +46,6 @@
...
@@ -46,7 +46,6 @@
<version>
1.18.20
</version>
<version>
1.18.20
</version>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
@@ -57,6 +56,17 @@
...
@@ -57,6 +56,17 @@
<artifactId>
reactor-test
</artifactId>
<artifactId>
reactor-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
3.0.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-boot-starter
</artifactId>
<version>
3.0.0
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
backend/order-management/src/main/java/com/afp/ordermanagement/config/AppConfig.java
View file @
f863568e
package
com
.
afp
.
ordermanagement
.
config
;
package
com
.
afp
.
ordermanagement
.
config
;
//import com.google.common.base.Predicate;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.ClassPathResource
;
@Configuration
@Configuration
public
class
AppConfig
public
class
AppConfig
{
{
@Bean
@Bean
public
static
PropertyPlaceholderConfigurer
getPropertyPlaceholderConfigurer
()
public
static
PropertyPlaceholderConfigurer
getPropertyPlaceholderConfigurer
()
{
{
...
@@ -16,4 +17,6 @@ public class AppConfig
...
@@ -16,4 +17,6 @@ public class AppConfig
ppc
.
setIgnoreUnresolvablePlaceholders
(
true
);
ppc
.
setIgnoreUnresolvablePlaceholders
(
true
);
return
ppc
;
return
ppc
;
}
}
}
}
backend/order-management/src/main/java/com/afp/ordermanagement/config/SwaggerConfig.java
0 → 100644
View file @
f863568e
package
com
.
afp
.
ordermanagement
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Configuration
@EnableSwagger2
public
class
SwaggerConfig
{
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"Order Management PRO"
)
.
build
();
}
@Bean
public
Docket
api
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
useDefaultResponseMessages
(
false
)
.
select
()
.
apis
(
RequestHandlerSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
.
build
()
.
apiInfo
(
apiInfo
());
}
}
\ No newline at end of file
backend/order-management/src/main/java/com/afp/ordermanagement/config/WebFluxConfig.java
View file @
f863568e
...
@@ -2,10 +2,22 @@ package com.afp.ordermanagement.config;
...
@@ -2,10 +2,22 @@ package com.afp.ordermanagement.config;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.reactive.config.EnableWebFlux
;
import
org.springframework.web.reactive.config.EnableWebFlux
;
import
org.springframework.web.reactive.config.ResourceHandlerRegistry
;
import
org.springframework.web.reactive.config.WebFluxConfigurer
;
import
org.springframework.web.reactive.config.WebFluxConfigurer
;
@Configuration
@Configuration
@EnableWebFlux
@EnableWebFlux
public
class
WebFluxConfig
implements
WebFluxConfigurer
public
class
WebFluxConfig
implements
WebFluxConfigurer
{
{
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
registry
.
addResourceHandler
(
"/swagger-ui.html**"
)
.
addResourceLocations
(
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/webjars/**"
)
.
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment