升级SpringBoot 2.3.0
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
package com.macro.mall.demo.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
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;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* Swagger API文档相关配置
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class Swagger2Config {
|
||||
@Bean
|
||||
public Docket createRestApi(){
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.macro.mall.demo"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("SwaggerUI演示")
|
||||
.description("Demo模块")
|
||||
.contact("macro")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.macro.mall.demo.config;
|
||||
|
||||
import com.macro.mall.common.config.BaseSwaggerConfig;
|
||||
import com.macro.mall.common.domain.SwaggerProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* Swagger相关配置
|
||||
* Created by macro on 2019/4/8.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig extends BaseSwaggerConfig {
|
||||
|
||||
@Override
|
||||
public SwaggerProperties swaggerProperties() {
|
||||
return SwaggerProperties.builder()
|
||||
.apiBasePackage("com.macro.mall.demo.controller")
|
||||
.title("mall-demo系统")
|
||||
.description("SpringBoot版本中的一些示例")
|
||||
.contactName("macro")
|
||||
.version("1.0")
|
||||
.enableSecurity(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,8 @@ server:
|
||||
port: 8082
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: mall-demo
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
@@ -12,7 +14,6 @@ spring:
|
||||
servlet:
|
||||
content-type: text/html
|
||||
cache: false #开发时关闭缓存,不然没法看到实时页面
|
||||
|
||||
mybatis:
|
||||
mapper-locations:
|
||||
- classpath:mapper/*.xml
|
||||
@@ -20,10 +21,8 @@ mybatis:
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info #日志配置DEBUG,INFO,WARN,ERROR
|
||||
root: info
|
||||
com.macro.mall: debug
|
||||
# file: demo_log.log #配置日志生成路径
|
||||
# path: /var/logs #配置日志文件名称
|
||||
|
||||
host:
|
||||
mall:
|
||||
|
||||
Reference in New Issue
Block a user