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
a320e4c5
Commit
a320e4c5
authored
May 11, 2021
by
Alex Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-91]
🎨
Create custom annotations & resolvers for 'ManagerController' (
@asegers
)
parent
4493d085
Pipeline
#1702
failed with stage
in 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
AnnotationConfig.java
...java/com/afp/ordermanagement/config/AnnotationConfig.java
+33
-0
No files found.
src/main/java/com/afp/ordermanagement/config/AnnotationConfig.java
0 → 100644
View file @
a320e4c5
package
com
.
afp
.
ordermanagement
.
config
;
import
com.afp.ordermanagement.annotation.AccessTokenResolver
;
import
com.afp.ordermanagement.annotation.ManagerPayloadResolver
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.reactive.config.EnableWebFlux
;
import
org.springframework.web.reactive.config.WebFluxConfigurer
;
import
org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer
;
@Configuration
//@ConditionalOnClass(EnableWebFlux.class) // checks that WebFlux is on the classpath
//@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
//@EnableWebFlux
public
class
AnnotationConfig
implements
WebFluxConfigurer
{
@Override
public
void
configureArgumentResolvers
(
ArgumentResolverConfigurer
configurer
)
{
configurer
.
addCustomResolver
(
accessTokenResolver
());
configurer
.
addCustomResolver
(
managerPayloadResolver
());
}
@Bean
public
AccessTokenResolver
accessTokenResolver
()
{
return
new
AccessTokenResolver
();
}
@Bean
public
ManagerPayloadResolver
managerPayloadResolver
()
{
return
new
ManagerPayloadResolver
();
}
}
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