From 16c98e1b6136165badf44af5b2b16d77b49af451 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 6 Nov 2023 19:07:05 +0400 Subject: [PATCH] #3 -- Remove from api documentation --- .../java/ru/ulstu/fc/config/MvcConfiguration.java | 11 +++++++++++ .../fc/rule/controller/InferenceMvcController.java | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/ru/ulstu/fc/config/MvcConfiguration.java b/src/main/java/ru/ulstu/fc/config/MvcConfiguration.java index 1203d38..cf79a53 100644 --- a/src/main/java/ru/ulstu/fc/config/MvcConfiguration.java +++ b/src/main/java/ru/ulstu/fc/config/MvcConfiguration.java @@ -14,6 +14,9 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.i18n.CookieLocaleResolver; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; @Configuration public class MvcConfiguration implements WebMvcConfigurer { @@ -41,6 +44,14 @@ public class MvcConfiguration implements WebMvcConfigurer { return localeInterceptor; } + @Bean + public Docket api() { + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("ru.ulstu")) + .build(); + } + @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(localeInterceptor()); diff --git a/src/main/java/ru/ulstu/fc/rule/controller/InferenceMvcController.java b/src/main/java/ru/ulstu/fc/rule/controller/InferenceMvcController.java index 133bf62..b18e7af 100644 --- a/src/main/java/ru/ulstu/fc/rule/controller/InferenceMvcController.java +++ b/src/main/java/ru/ulstu/fc/rule/controller/InferenceMvcController.java @@ -9,12 +9,14 @@ import org.springframework.web.bind.annotation.RequestMethod; import ru.ulstu.fc.rule.model.Antecedent; import ru.ulstu.fc.rule.model.InferenceForm; import ru.ulstu.fc.rule.service.FuzzyInferenceService; +import springfox.documentation.annotations.ApiIgnore; import java.util.Arrays; import java.util.List; import java.util.Map; @Controller +@ApiIgnore public class InferenceMvcController { private final FuzzyInferenceService fuzzyInferenceService;