Commit dbe0a0f8 authored by 张永's avatar 张永

1

parent 0dd703fe
...@@ -10,9 +10,7 @@ ...@@ -10,9 +10,7 @@
<properties> <properties>
<start-class>com.egolm.shop.ShopApplication</start-class> <start-class>com.egolm.shop.ShopApplication</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <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> </properties>
<parent> <parent>
......
...@@ -7,7 +7,10 @@ import org.springframework.web.context.request.async.DeferredResult; ...@@ -7,7 +7,10 @@ import org.springframework.web.context.request.async.DeferredResult;
import com.egolm.common.DateUtil; import com.egolm.common.DateUtil;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo; import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
...@@ -17,33 +20,17 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -17,33 +20,17 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2 @EnableSwagger2
public class SwaggerConfig { public class SwaggerConfig {
@Value("${server.servlet.context-path}")
private String contextPath;
@Value("${maven.build.timestamp}")
private String mavenBuildTime;
@Bean @Bean
public Docket ProductApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
.genericModelSubstitutes(DeferredResult.class) .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).paths(PathSelectors.any())
.useDefaultResponseMessages(false) .build();
.forCodeGeneration(false)
.pathMapping("/")
.select()
.build()
.apiInfo(productApiInfo());
} }
private ApiInfo productApiInfo() { private ApiInfo apiInfo() {
String releaseTime = DateUtil.formatTimeEight(mavenBuildTime.replace("T"," ").replace("Z", "")); return new ApiInfoBuilder().title("B2B商品在线接口服务在线文档").version("1.0").description("领锋智能(嘉兴)科技有限公司,会员管理系统API").build();
return new ApiInfoBuilder()
.title("B2B商品在线接口服务-------"+contextPath+"---发布时间:-"+releaseTime)
.termsOfServiceUrl("NO terms of service")
.version("1.0")
.build();
} }
......
...@@ -14,9 +14,14 @@ spring.http.encoding.charset=utf-8 ...@@ -14,9 +14,14 @@ spring.http.encoding.charset=utf-8
spring.aop.proxy-target-class=true spring.aop.proxy-target-class=true
spring.profiles.active=dev spring.profiles.active=dev
spring.messages.basename=messages 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.username=ERP
spring.datasource.password=qiyang@2013 spring.datasource.password=qiyang@2013
spring.datasource.url=jdbc:sqlserver://10.10.0.22:1433;instanceName=SQLSERVER;DatabaseName=B2BDB;allowMultiQueries=true spring.datasource.url=jdbc:sqlserver://10.10.0.22:1433;instanceName=SQLSERVER;DatabaseName=B2BDB;allowMultiQueries=true
......
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