-
Notifications
You must be signed in to change notification settings - Fork 52
优化关联应用功能 #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
优化关联应用功能 #61
Changes from 6 commits
be94f81
05f6b80
b586257
a96d55a
81c500b
fce71ef
749375f
e8d5517
bbb5293
6ae5787
135e93a
b9200c8
804ea73
c921a59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,4 +70,10 @@ public class SofaDashboardConstants { | |
public static final String ZOOKEEPER_PREFIX = "zookeeper://"; | ||
public static final String SOFA_PREFIX = "sofa://"; | ||
|
||
// API接口类 | ||
public static final String API_ARK_TAGS = "Ark相关接口"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 是不是可以考虑使用一个枚举来描述下所有的接口类型,而不是在 常量类中定义 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这是个不错的建议 |
||
public static final String API_APPLICATION_TAGS = "Application相关接口"; | ||
public static final String API_GOVERNANCE_TAGS = "Governance相关接口"; | ||
public static final String API_WEB_TAGS = "Web相关接口"; | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,25 @@ | |
</properties> | ||
|
||
<dependencies> | ||
<!--knife4j--> | ||
<dependency> | ||
<groupId>com.github.xiaoymin</groupId> | ||
<artifactId>knife4j-spring-boot-starter</artifactId> | ||
<version>2.0.7</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 版本管理在主pom 的 dependentmanagement 中 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 收到 |
||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<version>20.0</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.plugin</groupId> | ||
<artifactId>spring-plugin-core</artifactId> | ||
<version>2.0.0.RELEASE</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>sofa-dashboard-governance</artifactId> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.alipay.sofa.dashboard.configuration; | ||
|
||
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.service.Contact; | ||
import springfox.documentation.spi.DocumentationType; | ||
import springfox.documentation.spring.web.plugins.Docket; | ||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; | ||
|
||
|
||
@Configuration | ||
@EnableSwagger2WebMvc | ||
public class Swagger2Config { | ||
@Bean | ||
public Docket createRestApi() { | ||
return new Docket(DocumentationType.SWAGGER_2) | ||
.useDefaultResponseMessages(false) | ||
.apiInfo(apiInfo()) | ||
.groupName("1.0版本") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不建议在代码中直接使用这种常量,同时也不建议使用中文 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 好的,这个打算后面换成5个分类,application、arkmng、core、governance、web这样方便开发者对接。 |
||
.select() | ||
.apis(RequestHandlerSelectors.basePackage("com.alipay.sofa.dashboard.controller")) | ||
.paths(PathSelectors.any()) | ||
.build(); | ||
|
||
} | ||
|
||
private ApiInfo apiInfo() { | ||
return new ApiInfoBuilder() | ||
.title("SOFADashboard APIs") | ||
.description("SOFADashboard 接口对接文档") | ||
.termsOfServiceUrl("http://localhost:8099/") | ||
.version("1.0") | ||
.build(); | ||
} | ||
|
||
|
||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意格式化