-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autowire Converters in WebMVC (#102)
- Loading branch information
Showing
2 changed files
with
41 additions
and
17 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
server/application-server/src/main/java/de/tum/in/www1/hephaestus/WebConfig.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,27 @@ | ||
package de.tum.in.www1.hephaestus; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.format.FormatterRegistry; | ||
import org.springframework.lang.NonNull; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
import de.tum.in.www1.hephaestus.codereview.comment.IssueCommentConverter; | ||
import de.tum.in.www1.hephaestus.codereview.comment.review.PullRequestReviewCommentConverter; | ||
import de.tum.in.www1.hephaestus.codereview.pullrequest.PullRequestConverter; | ||
import de.tum.in.www1.hephaestus.codereview.pullrequest.review.PullRequestReviewConverter; | ||
import de.tum.in.www1.hephaestus.codereview.repository.RepositoryConverter; | ||
import de.tum.in.www1.hephaestus.codereview.user.UserConverter; | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addFormatters(@NonNull FormatterRegistry registry) { | ||
registry.addConverter(new UserConverter()); | ||
registry.addConverter(new RepositoryConverter()); | ||
registry.addConverter(new PullRequestConverter()); | ||
registry.addConverter(new PullRequestReviewConverter()); | ||
registry.addConverter(new IssueCommentConverter()); | ||
registry.addConverter(new PullRequestReviewCommentConverter()); | ||
} | ||
} |
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