接口文档整理
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package co.yixiang.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
@ -19,9 +20,13 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfiguration {
|
||||
@Value("${swagger.enabled}")
|
||||
private Boolean enabled;
|
||||
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(enabled)
|
||||
.apiInfo(apiInfo())
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("co.yixiang.modules"))
|
||||
@ -31,11 +36,11 @@ public class SwaggerConfiguration {
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Yshop商城API")
|
||||
.description("Yshop商城API")
|
||||
.termsOfServiceUrl("http://localhost:8009/")
|
||||
.title("yshop商城移动端API")
|
||||
.description("yshop商城移动端API")
|
||||
.termsOfServiceUrl("http://localhost:8009/api")
|
||||
.contact("610796224@qq.com")
|
||||
.version("1.0")
|
||||
.version("1.6")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user