正在显示
2 个修改的文件
包含
48 行增加
和
17 行删除
@@ -106,27 +106,16 @@ | @@ -106,27 +106,16 @@ | ||
106 | </dependency> | 106 | </dependency> |
107 | 107 | ||
108 | <dependency> | 108 | <dependency> |
109 | - <groupId>io.springfox</groupId> | ||
110 | - <artifactId>springfox-swagger2</artifactId> | ||
111 | - <version>2.9.2</version> | 109 | + <groupId>io.springfox</groupId> |
110 | + <artifactId>springfox-swagger2</artifactId> | ||
111 | + <version>2.9.2</version> | ||
112 | </dependency> | 112 | </dependency> |
113 | <dependency> | 113 | <dependency> |
114 | - <groupId>io.springfox</groupId> | ||
115 | - <artifactId>springfox-swagger-ui</artifactId> | ||
116 | - <version>2.9.2</version> | 114 | + <groupId>com.github.xiaoymin</groupId> |
115 | + <artifactId>swagger-bootstrap-ui</artifactId> | ||
116 | + <version>1.9.6</version> | ||
117 | </dependency> | 117 | </dependency> |
118 | <dependency> | 118 | <dependency> |
119 | - <groupId>io.swagger</groupId> | ||
120 | - <artifactId>swagger-annotations</artifactId> | ||
121 | - <version>1.5.22</version> | ||
122 | - </dependency> | ||
123 | - <dependency> | ||
124 | - <groupId>io.swagger</groupId> | ||
125 | - <artifactId>swagger-models</artifactId> | ||
126 | - <version>1.5.22</version> | ||
127 | - </dependency> | ||
128 | - | ||
129 | - <dependency> | ||
130 | <groupId>joda-time</groupId> | 119 | <groupId>joda-time</groupId> |
131 | <artifactId>joda-time</artifactId> | 120 | <artifactId>joda-time</artifactId> |
132 | <version>2.10.5</version> | 121 | <version>2.10.5</version> |
1 | +package com.sunyo.wlpt.message.bus.service.config; | ||
2 | + | ||
3 | +import org.springframework.context.annotation.Bean; | ||
4 | +import org.springframework.context.annotation.Configuration; | ||
5 | +import springfox.documentation.builders.ApiInfoBuilder; | ||
6 | +import springfox.documentation.builders.PathSelectors; | ||
7 | +import springfox.documentation.builders.RequestHandlerSelectors; | ||
8 | +import springfox.documentation.service.ApiInfo; | ||
9 | +import springfox.documentation.spi.DocumentationType; | ||
10 | +import springfox.documentation.spring.web.plugins.Docket; | ||
11 | +import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||
12 | + | ||
13 | +/** | ||
14 | + * @author 子诚 | ||
15 | + * Description:swagger-knife4j 的配置文件 | ||
16 | + * 时间:2020/7/10 11:48 | ||
17 | + */ | ||
18 | +@Configuration | ||
19 | +@EnableSwagger2 | ||
20 | +public class SwaggerConfig { | ||
21 | + @Bean | ||
22 | + public Docket createRestApi() { | ||
23 | + return new Docket(DocumentationType.SWAGGER_2) | ||
24 | + .apiInfo(apiInfo()) | ||
25 | + .select() | ||
26 | + .apis(RequestHandlerSelectors.basePackage("com.sunyo.wlpt.message.bus.service.controller")) | ||
27 | + .paths(PathSelectors.any()) | ||
28 | + .build(); | ||
29 | + } | ||
30 | + /** | ||
31 | + * 默认访问地址是:http://${host}:${port}/doc.html | ||
32 | + */ | ||
33 | + private ApiInfo apiInfo() { | ||
34 | + return new ApiInfoBuilder() | ||
35 | + .title("消息平台控制中心 APIs") | ||
36 | + .description("swagger-bootstrap-ui") | ||
37 | + .termsOfServiceUrl("http://localhost:9030/") | ||
38 | + .contact("523186180@qq.com") | ||
39 | + .version("1.0.0") | ||
40 | + .build(); | ||
41 | + } | ||
42 | +} |
-
请 注册 或 登录 后发表评论