-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE-2992][Improve] Using code style & quality rules to improve org…
….apache.streampark.console.base.config package of streampark-console module. (#3012) * extract string as constant * code style format * define it directly instead of using constants * code correction * Update OpenapiConfig.java * Update WebMvcConfig.java --------- Co-authored-by: lihui <[email protected]> Co-authored-by: benjobs <[email protected]>
- Loading branch information
1 parent
0d61f5d
commit 65d968f
Showing
2 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,20 +40,27 @@ | |
@ConditionalOnWebApplication | ||
public class OpenapiConfig implements WebMvcConfigurer { | ||
|
||
private static final String OPEN_API_INFO_OVERVIEW = "Apache StreamPark Api Docs"; | ||
private static final String OPEN_API_INFO_VERSION = "2.2.0-SNAPSHOT"; | ||
private static final String OPEN_API_INFO_LICENSE_NAME = "Apache-2.0 license"; | ||
private static final String OPEN_API_INFO_CONTACT_NAME = "Apache StreamPark"; | ||
private static final String OPEN_API_INFO_CONTACT_URL = "https://streampark.apache.org"; | ||
private static final String OPEN_API_INFO_CONTACT_EMAIL = "[email protected]"; | ||
|
||
@Bean | ||
public OpenAPI apiV1Info() { | ||
return new OpenAPI() | ||
.info( | ||
new Info() | ||
.title("Apache StreamPark Api Docs") | ||
.description("Apache StreamPark Api Docs") | ||
.title(OPEN_API_INFO_OVERVIEW) | ||
.description(OPEN_API_INFO_OVERVIEW) | ||
.contact( | ||
new Contact() | ||
.name("Apache StreamPark") | ||
.url("https://streampark.apache.org/") | ||
.email("[email protected]")) | ||
.version("2.2.0-SNAPSHOT") | ||
.license(new License().name("Apache-2.0 license"))) | ||
.name(OPEN_API_INFO_CONTACT_NAME) | ||
.url(OPEN_API_INFO_CONTACT_URL) | ||
.email(OPEN_API_INFO_CONTACT_EMAIL)) | ||
.version(OPEN_API_INFO_VERSION) | ||
.license(new License().name(OPEN_API_INFO_LICENSE_NAME))) | ||
.components( | ||
new Components() | ||
.addSecuritySchemes( | ||
|
@@ -76,4 +83,5 @@ public GroupedOpenApi publicApiV1() { | |
public GroupedOpenApi publicApiV2() { | ||
return GroupedOpenApi.builder().group("v2").pathsToMatch("/v2/**").build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters