接口文档整理

This commit is contained in:
hupeng
2019-12-29 13:50:54 +08:00
parent 37fd174b7b
commit 16461bd97a
38 changed files with 280 additions and 293 deletions

View File

@ -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();
}
}