Commit dbe0a0f8 authored by 张永's avatar 张永

1

parent 0dd703fe
......@@ -11,8 +11,6 @@
<start-class>com.egolm.shop.ShopApplication</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp>${maven.build.timestamp}</maven.build.timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
</properties>
<parent>
......
......@@ -7,7 +7,10 @@ import org.springframework.web.context.request.async.DeferredResult;
import com.egolm.common.DateUtil;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
......@@ -17,31 +20,15 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2
public class SwaggerConfig {
@Value("${server.servlet.context-path}")
private String contextPath;
@Value("${maven.build.timestamp}")
private String mavenBuildTime;
@Bean
public Docket ProductApi() {
return new Docket(DocumentationType.SWAGGER_2)
.genericModelSubstitutes(DeferredResult.class)
.useDefaultResponseMessages(false)
.forCodeGeneration(false)
.pathMapping("/")
.select()
.build()
.apiInfo(productApiInfo());
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).paths(PathSelectors.any())
.build();
}
private ApiInfo productApiInfo() {
String releaseTime = DateUtil.formatTimeEight(mavenBuildTime.replace("T"," ").replace("Z", ""));
return new ApiInfoBuilder()
.title("B2B商品在线接口服务-------"+contextPath+"---发布时间:-"+releaseTime)
.termsOfServiceUrl("NO terms of service")
.version("1.0")
.build();
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("B2B商品在线接口服务在线文档").version("1.0").description("领锋智能(嘉兴)科技有限公司,会员管理系统API").build();
}
......
......@@ -14,8 +14,13 @@ spring.http.encoding.charset=utf-8
spring.aop.proxy-target-class=true
spring.profiles.active=dev
spring.messages.basename=messages
###版本号
maven.build.timestamp=@maven.build.timestamp@
#thymeleaf
# 前缀
spring.thymeleaf.prefix=classpath:/templates/
# 后缀
spring.thymeleaf.suffix=.html
spring.datasource.username=ERP
spring.datasource.password=qiyang@2013
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment