package com.zsc.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StopWatch;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import javax.xml.crypto.Data;
import static springfox.documentation.builders.PathSelectors.regex;
/**
*
* @author lenovo
*/
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
/**
* 定义API接口映射路径
*/
public static final String DEFAULT_INCLUDE_PATTERN = "/order/.*";
private final Logger logger = LoggerFactory.getLogger(SwaggerConfiguration.class);
@Bean
public Docket swaggerSpringfoxDocket() {
logger.debug("Starting Swagger~");
StopWatch stopWatch = new StopWatch();
stopWatch.start();
/**
* String title, String description,
* String version, String termsOfServiceUrl,
* String contact, String license,
* String licenseUrl
*/
ApiInfo apiInfo = new ApiInfo("订单管理API接口测试文档", "商品接口API文档",
"0.0.1", "termsOfServiceUrl",
"contact", "", "");
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo)
.genericModelSubstitutes(ResponseEntity.class)
.forCodeGeneration(true)
// .genericModelSubstitutes(ResponseEntity.class)
.directModelSubstitute(java.time.LocalDate.class, String.class)
.directModelSubstitute(java.time.ZonedDateTime.class, Data.class)
.directModelSubstitute(java.time.LocalDate.class, Data.class)
.select()
// 匹配路径生成对应接口文档
.paths(regex(DEFAULT_INCLUDE_PATTERN))
.build();
stopWatch.stop();
logger.debug("Started Swagger in {} ms,ok",stopWatch.getTotalTimeMillis());
return docket;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
springboot_integrate.zip (77个子文件)
shiyannsix.sql 0B
pom.xml 2KB
user-service
pom.xml 2KB
src
test
java
main
resources
dist
swagger-ui-standalone-preset.js.map 168B
swagger-ui.js.map 121B
swagger-ui-bundle.js.map 264B
swagger-ui.css 30KB
favicon-32x32.png 1KB
oauth2-redirect.html 2KB
swagger-ui.js 286KB
swagger-ui-bundle.js 1.26MB
swagger-ui-standalone-preset.js 254KB
index.html 4KB
swagger-ui.css.map 80B
favicon-16x16.png 445B
application.yaml 812B
java
com
zsc
mapper
UserMapper.java 394B
controller
UserController.java 1KB
pojo
Order.java 233B
User.java 530B
config
BeanConfig.java 369B
SwaggerConfiguration.java 2KB
UserApplication.java 436B
target
classes
application.yaml 812B
com
zsc
mapper
UserMapper.class 418B
controller
UserController.class 2KB
UserApplication.class 783B
pojo
User.class 3KB
Order.class 2KB
config
SwaggerConfiguration.class 3KB
BeanConfig.class 625B
generated-sources
annotations
src
test
java
main
resources
java
shiyansix_2.sql 6KB
.idea
jarRepositories.xml 879B
uiDesigner.xml 9KB
qaplug_profiles.xml 41KB
workspace.xml 7KB
misc.xml 887B
inspectionProfiles
Project_Default.xml 1KB
compiler.xml 1KB
.gitignore 0B
encodings.xml 605B
$PROJECT_FILE$ 364B
order-service
pom.xml 2KB
src
test
java
main
resources
dist
swagger-ui-standalone-preset.js.map 168B
swagger-ui.js.map 121B
swagger-ui-bundle.js.map 264B
swagger-ui.css 30KB
favicon-32x32.png 1KB
oauth2-redirect.html 2KB
swagger-ui.js 286KB
swagger-ui-bundle.js 1.26MB
swagger-ui-standalone-preset.js 254KB
index.html 4KB
swagger-ui.css.map 80B
favicon-16x16.png 445B
application.yaml 928B
java
com
zsc
mapper
OrderMapper.java 416B
OrderApplication.java 438B
controller
OrderController.java 1KB
pojo
Order.java 233B
config
SwaggerConfiguration.java 2KB
target
classes
application.yaml 928B
com
zsc
OrderApplication.class 786B
mapper
OrderMapper.class 411B
controller
OrderController.class 1KB
pojo
Order.class 2KB
config
SwaggerConfiguration.class 3KB
generated-sources
annotations
eureka-server
pom.xml 920B
src
test
java
main
resources
application.yaml 383B
java
com
zsc
EurekaServerApplication.java 459B
target
classes
application.yaml 383B
com
zsc
EurekaServerApplication.class 814B
generated-sources
annotations
gateway-zuul
pom.xml 1KB
src
test
java
main
resources
application.yaml 360B
java
com
zsc
ZuulApplication.java 428B
target
classes
application.yaml 360B
com
zsc
ZuulApplication.class 778B
generated-sources
annotations
共 77 条
- 1
资源评论
拾贰_C
- 粉丝: 2174
- 资源: 41
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 新建 Microsoft Word 文档
- (176102016)MATLAB代码:考虑灵活性供需不确定性的储能参与电网调峰优化配置 关键词:储能优化配置 电网调峰 风电场景生成 灵活性供需不
- SINAMICS S120驱动第三方直线永磁同步电机系列视频-配置和优化.mp4
- (175601006)51单片机交通信号灯系统设计
- Starter SINAMICS S120驱动第三方直线永磁同步电机系列视频-调试演示.mp4
- (174755032)抽烟、烟雾检测voc数据集
- 基于滑膜控制的差动制动防侧翻稳定性控制,上层通过滑膜控制产生期望的横摆力矩,下层根据对应的paper实现对应的制动力矩分配,实现车辆的防侧翻稳定性控制,通过通过carsim和simulink联合仿真
- 伺服系统基于陷波滤波器双惯量伺服系统机械谐振抑制matlab Simulink仿真 1.模型简介 模型为基于陷波滤波器的双惯量伺服系统机械谐振抑制仿真,采用Matlab R2018a Simul
- (175989002)DDR4 JESD79-4C.pdf
- lanchaoHunanHoutaiQiantai
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功