1. 添加swagger依赖,一定要高于2.6.1版本
//api
compile ('io.springfox:springfox-swagger2:2.6.1') {
exclude(module: 'slf4j-log4j12')
}
compile ('io.springfox:springfox-swagger-ui:2.6.1') {
exclude(module: 'slf4j-log4j12')
}
compile ('com.github.xiaoymin:swagger-bootstrap-ui:1.9.6')
apiCompile ('io.swagger:swagger-annotations:1.5.10') {
exclude(module: 'slf4j-log4j12')
}
2.请求拦截配置
package com.lie.config.springmvc;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.Int