我收到此弹出式广告http://localhost:8080/swagger-ui.html。 首先我认为它是我的数据库或我的GIT的密码。 但是,不接受上述内容。
package com.gabor.usermanagment.configs;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import static springfox.documentation.builders.PathSelectors.regex;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.gabor.usermanagment.api"))
.paths(regex("/customerapi.*"))
.build()
.apiInfo(metaData());
}
private ApiInfo metaData() {
ApiInfo apiInfo = new ApiInfo(
"Spring Boot REST API",
"Spring Boot REST API for Online Store",
"1.0",
"Terms of service",
new Contact("John Thompson", "https://springframework.guru/about/", "john@springfrmework.guru"),
"Apache License Version 2.0",
"https://www.apache.org/licenses/LICENSE-2.0");
return apiInfo;
}
}
答案 0 :(得分:0)
What is username and password when starting Spring Boot with Tomcat?
在进一步研究解决方案之后,我找到了它。此问题已得到解决。