RocMarshal commented on code in PR #3012:
URL:
https://github.com/apache/incubator-streampark/pull/3012#discussion_r1314433770
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/AlertRestTemplateConfig.java:
##########
@@ -28,8 +28,10 @@ public class AlertRestTemplateConfig {
*
* @return RestTemplate
*/
- @Bean(name = "alertRestTemplate")
+ @Bean(name = BEAN_NAME_ALERT_REST_TEMPLATE)
Review Comment:
The content in `Annotations` can be more intuitive and readable by
maintaining direct string references without extracting constants
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/MybatisConfig.java:
##########
@@ -76,8 +76,8 @@ public PostgreSQLPrepareInterceptor
postgreSQLPrepareInterceptor() {
@Bean
public MybatisPlusPropertiesCustomizer mybatisPlusPropertiesCustomizer() {
return properties -> {
-
properties.setTypeAliasesPackage("org.apache.streampark.console.*.entity");
- properties.setMapperLocations(new String[] {"classpath:mapper/*/*.xml"});
+ properties.setTypeAliasesPackage(TYPE_ALIASES_PACKAGE);
+ properties.setMapperLocations(new String[] {MAPPER_LOCATION});
Review Comment:
same as mentioned above.
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/AsyncExecutorPoolConfig.java:
##########
@@ -35,9 +35,11 @@ public Executor taskExecutor() {
executor.setMaxPoolSize(20);
executor.setQueueCapacity(100);
executor.setKeepAliveSeconds(30);
- executor.setThreadNamePrefix("asyncTaskExecutor-");
+ executor.setThreadNamePrefix(THREAD_NAME_PREFIX_ASYNC_TASK);
Review Comment:
same as mentioned above.
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/OpenapiConfig.java:
##########
@@ -76,4 +76,12 @@ public GroupedOpenApi publicApiV1() {
public GroupedOpenApi publicApiV2() {
return GroupedOpenApi.builder().group("v2").pathsToMatch("/v2/**").build();
}
+
+ private static final String OPEN_API_INFO_TITLE = "Apache StreamPark Api
Docs";
+ private static final String OPEN_API_INFO_DESCRIPTION = "Apache StreamPark
Api Docs";
Review Comment:
Its could be inlined into a new contant named `OPEN_API_INFO_OVERVIEW`, then
remove the two lines, because the contents of the two lines is the same.
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/WebMvcConfig.java:
##########
@@ -70,6 +71,17 @@ public Module jacksonModule() {
@Override
public void addInterceptors(InterceptorRegistry registry) {
-
registry.addInterceptor(uploadFileTypeInterceptor).addPathPatterns("/flink/app/upload");
+ registry
+ .addInterceptor(uploadFileTypeInterceptor)
+ .addPathPatterns(INTERCEPTOR_UPLOAD_FILE_PATH_PATTERN);
Review Comment:
Maybe it should be inlined back to `"/flink/app/upload"` diractly.
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/WebMvcConfig.java:
##########
@@ -54,7 +55,7 @@ public void addCorsMappings(CorsRegistry registry) {
registry
.addMapping("/**")
.allowedOriginPatterns("*")
- .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
+ .allowedMethods(CORS_MAPPINGS_ALLOWED_METHODS)
Review Comment:
I'd like it~ 👍
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/WebMvcConfig.java:
##########
@@ -54,7 +55,7 @@ public void addCorsMappings(CorsRegistry registry) {
registry
.addMapping("/**")
.allowedOriginPatterns("*")
- .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
+ .allowedMethods(CORS_MAPPINGS_ALLOWED_METHODS)
Review Comment:
I'd like it~ 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]