From 9aecbc873beb88ae3ec51b2d2d2982364d31c8f8 Mon Sep 17 00:00:00 2001 From: fuchanghai <‘2875334588@qq.com’> Date: Fri, 14 Oct 2022 16:27:58 +0800 Subject: [PATCH 01/14] [improvement] add springdoc-openapi-ui --- dolphinscheduler-api/pom.xml | 4 + dolphinscheduler-bom/pom.xml | 7 + dolphinscheduler-dist/release-docs/LICENSE | 1 + .../licenses/LICENSE-springdoc-openapi-ui.txt | 201 ++++++++++++++++++ tools/dependencies/known-dependencies.txt | 1 + 5 files changed, 214 insertions(+) create mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-ui.txt diff --git a/dolphinscheduler-api/pom.xml b/dolphinscheduler-api/pom.xml index 7e03f01b6ebf..61fe0b4ab414 100644 --- a/dolphinscheduler-api/pom.xml +++ b/dolphinscheduler-api/pom.xml @@ -195,6 +195,10 @@ test + + org.springdoc + springdoc-openapi-ui + diff --git a/dolphinscheduler-bom/pom.xml b/dolphinscheduler-bom/pom.xml index aacfc896f15b..ea9124e2916a 100644 --- a/dolphinscheduler-bom/pom.xml +++ b/dolphinscheduler-bom/pom.xml @@ -98,6 +98,7 @@ 1.31 4.1.1 2.17.282 + 1.6.9 @@ -753,6 +754,12 @@ datasync ${datasync.version} + + + org.springdoc + springdoc-openapi-ui + ${springdoc-openapi-ui.version} + diff --git a/dolphinscheduler-dist/release-docs/LICENSE b/dolphinscheduler-dist/release-docs/LICENSE index 2ad573a24115..ef14fc1b55d5 100644 --- a/dolphinscheduler-dist/release-docs/LICENSE +++ b/dolphinscheduler-dist/release-docs/LICENSE @@ -377,6 +377,7 @@ The text of each license is also included at licenses/LICENSE-[project].txt. spring-context-support 5.3.13: https://mvnrepository.com/artifact/org.springframework/spring-context-support/5.3.13, Apache 2.0 spring-core 5.3.22: https://mvnrepository.com/artifact/org.springframework/spring-core/5.3.22, Apache 2.0 spring-expression 5.3.13: https://mvnrepository.com/artifact/org.springframework/spring-expression/5.3.13, Apache 2.0 + springdoc-openapi-ui 1.6.9: https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui/1.6.9, Apache 2.0 springfox-core 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-core/3.0.0, Apache 2.0 springfox-schema 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-schema/3.0.0, Apache 2.0 springfox-spi 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-spi/3.0.0, Apache 2.0 diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-ui.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-ui.txt new file mode 100644 index 000000000000..835428fbaa90 --- /dev/null +++ b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-ui.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/tools/dependencies/known-dependencies.txt b/tools/dependencies/known-dependencies.txt index 9a6c44d58453..304b63887187 100644 --- a/tools/dependencies/known-dependencies.txt +++ b/tools/dependencies/known-dependencies.txt @@ -318,6 +318,7 @@ spring-security-rsa-1.0.10.RELEASE.jar spring-tx-5.3.22.jar spring-web-5.3.22.jar spring-webmvc-5.3.22.jar +springdoc-openapi-ui-1.6.9.jar springfox-bean-validators-3.0.0.jar springfox-boot-starter-3.0.0.jar springfox-core-3.0.0.jar From d193dccc66d6dc40b3c77df69065cf6cdf766875 Mon Sep 17 00:00:00 2001 From: fuchanghai <1105596917@qq.com> Date: Sat, 15 Oct 2022 19:57:21 +0800 Subject: [PATCH 02/14] [improvement-#12266]remove swagger-v2 dependencies. and update annotation --- dolphinscheduler-api/pom.xml | 4 +- .../api/configuration/AppConfiguration.java | 2 +- .../configuration/OpenAPIConfiguration.java | 93 +---- .../OpenAPITranslationConfiguration.java | 55 +-- .../api/controller/AccessTokenController.java | 65 ++-- .../controller/AccessTokenV2Controller.java | 16 +- .../api/controller/AlertGroupController.java | 93 +++-- .../AlertPluginInstanceController.java | 73 ++-- .../api/controller/AuditLogController.java | 32 +- .../api/controller/ClusterController.java | 79 ++--- .../controller/DataAnalysisController.java | 52 +-- .../api/controller/DataQualityController.java | 64 ++-- .../api/controller/DataSourceController.java | 123 ++++--- .../api/controller/EnvironmentController.java | 84 +++-- .../api/controller/ExecutorController.java | 170 +++++---- .../api/controller/FavTaskController.java | 36 +- .../controller/K8sNamespaceController.java | 92 +++-- .../api/controller/LoggerController.java | 63 ++-- .../api/controller/LoginController.java | 26 +- .../api/controller/MonitorController.java | 22 +- .../ProcessDefinitionController.java | 335 +++++++++--------- .../controller/ProcessInstanceController.java | 195 +++++----- .../ProcessTaskRelationController.java | 113 +++--- .../ProcessTaskRelationV2Controller.java | 34 +- .../api/controller/ProjectController.java | 102 +++--- .../api/controller/ProjectV2Controller.java | 94 +++-- .../api/controller/QueueController.java | 62 ++-- .../api/controller/QueueV2Controller.java | 51 ++- .../api/controller/ResourcesController.java | 302 ++++++++-------- .../api/controller/ScheduleV2Controller.java | 38 +- .../api/controller/SchedulerController.java | 145 ++++---- .../controller/TaskDefinitionController.java | 175 +++++---- .../TaskDefinitionV2Controller.java | 46 ++- .../api/controller/TaskGroupController.java | 130 ++++--- .../controller/TaskInstanceController.java | 77 ++-- .../api/controller/TenantController.java | 72 ++-- .../api/controller/UiPluginController.java | 30 +- .../api/controller/UsersController.java | 206 ++++++----- .../controller/WorkFlowLineageController.java | 47 ++- .../api/controller/WorkerGroupController.java | 60 ++-- .../api/controller/WorkflowV2Controller.java | 38 +- .../api/dto/CreateTokenRequest.java | 10 +- .../api/dto/PageQueryDto.java | 10 +- .../api/dto/project/ProjectCreateRequest.java | 6 +- .../api/dto/project/ProjectQueryRequest.java | 10 +- .../api/dto/project/ProjectUpdateRequest.java | 12 +- .../api/dto/queue/QueueCreateRequest.java | 10 +- .../api/dto/queue/QueueQueryRequest.java | 11 +- .../api/dto/queue/QueueUpdateRequest.java | 13 +- .../api/dto/queue/QueueVerifyRequest.java | 10 +- .../dto/schedule/ScheduleCreateRequest.java | 26 +- .../dto/schedule/ScheduleFilterRequest.java | 12 +- .../dto/schedule/ScheduleUpdateRequest.java | 24 +- .../api/dto/task/TaskCreateRequest.java | 44 +-- .../api/dto/task/TaskFilterRequest.java | 12 +- .../api/dto/task/TaskUpdateRequest.java | 42 +-- .../TaskRelationCreateRequest.java | 10 +- .../TaskRelationDeleteRequest.java | 4 +- .../TaskRelationFilterRequest.java | 12 +- .../TaskRelationUpdateUpstreamRequest.java | 6 +- .../dto/workflow/WorkflowCreateRequest.java | 20 +- .../dto/workflow/WorkflowFilterRequest.java | 14 +- .../dto/workflow/WorkflowUpdateRequest.java | 20 +- .../src/main/resources/application.yaml | 4 + 64 files changed, 1875 insertions(+), 2063 deletions(-) diff --git a/dolphinscheduler-api/pom.xml b/dolphinscheduler-api/pom.xml index 61fe0b4ab414..a070bb8d1e27 100644 --- a/dolphinscheduler-api/pom.xml +++ b/dolphinscheduler-api/pom.xml @@ -134,10 +134,10 @@ spring-context - + org.hibernate.validator diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java index d67163581019..5cfb11ad72c0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java @@ -103,7 +103,7 @@ public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(loginInterceptor()) .addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN) .excludePathPatterns(LOGIN_PATH_PATTERN, REGISTER_PATH_PATTERN, - "/swagger-resources/**", "/webjars/**", "/v3/api-docs/**", "/api-docs/**", + "/swagger-resources/**", "/webjars/**", "/v3/api-docs/**", "/api-docs/**","/swagger-ui.html", "/doc.html", "/swagger-ui/**", "*.html", "/ui/**", "/error"); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java index deab4dd3455c..1c89f7b5b5df 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java @@ -16,33 +16,19 @@ */ package org.apache.dolphinscheduler.api.configuration; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider; -import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; -import java.lang.reflect.Field; -import java.util.List; -import java.util.stream.Collectors; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import org.springdoc.core.GroupedOpenApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; -import org.springframework.util.ReflectionUtils; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; /** - * * swager2 config class - * */ @Configuration @ConditionalOnWebApplication @@ -50,73 +36,20 @@ public class OpenAPIConfiguration implements WebMvcConfigurer { @Bean - public Docket createV1RestApi() { - return new Docket(DocumentationType.OAS_30) - .groupName("v1(current)") - .apiInfo(apiV1Info()) - .select() - .apis(RequestHandlerSelectors.basePackage("org.apache.dolphinscheduler.api.controller")) - .paths(PathSelectors.any().and(PathSelectors.ant("/v2/**").negate())) - .build(); - } - - private ApiInfo apiV1Info() { - return new ApiInfoBuilder() - .title("Dolphin Scheduler Api Docs") - .description("Dolphin Scheduler Api Docs") - .version("V1") - .build(); + public OpenAPI apiV1Info() { + return new OpenAPI() + .info(new Info() + .title("Dolphin Scheduler Api Docs") + .description("Dolphin Scheduler Api Docs") + .version("V1")); } @Bean - public Docket createV2RestApi() { - return new Docket(DocumentationType.OAS_30) - .groupName("v2") - .apiInfo(apiV2Info()) - .select() - .apis(RequestHandlerSelectors.basePackage("org.apache.dolphinscheduler.api.controller")) - .paths(PathSelectors.any().and(PathSelectors.ant("/v2/**"))) - .build(); - } - - private ApiInfo apiV2Info() { - return new ApiInfoBuilder() - .title("Dolphin Scheduler Api Docs") - .description("Dolphin Scheduler Api Docs") - .version("V2") + public GroupedOpenApi publicApi() { + return GroupedOpenApi.builder() + .group("v1") + .pathsToMatch("/**") .build(); } - @Bean - public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() { - return new BeanPostProcessor() { - - @Override - public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) { - customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); - } - return bean; - } - - private void customizeSpringfoxHandlerMappings(List mappings) { - List copy = mappings.stream() - .filter(mapping -> mapping.getPatternParser() == null) - .collect(Collectors.toList()); - mappings.clear(); - mappings.addAll(copy); - } - - @SuppressWarnings("unchecked") - private List getHandlerMappings(Object bean) { - try { - Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings"); - field.setAccessible(true); - return (List) field.get(bean); - } catch (IllegalArgumentException | IllegalAccessException e) { - throw new IllegalStateException(e); - } - } - }; - } } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java index 4e1c67bd0be7..0a6a81535ba7 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java @@ -16,31 +16,10 @@ */ package org.apache.dolphinscheduler.api.configuration; -import static java.util.stream.Collectors.toList; -import static java.util.stream.Collectors.toSet; -import springfox.documentation.service.Operation; -import springfox.documentation.service.RequestParameter; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spi.service.OperationBuilderPlugin; -import springfox.documentation.spi.service.contexts.OperationContext; - -import java.util.Collection; -import java.util.Locale; -import java.util.Set; - -import lombok.RequiredArgsConstructor; - -import org.springframework.context.MessageSource; -import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; -import org.springframework.stereotype.Component; - -@Component public class OpenAPITranslationConfiguration { - @Component + /*@Component @RequiredArgsConstructor @Order(Ordered.LOWEST_PRECEDENCE) public static class TranslationOperationBuilderPlugin implements OperationBuilderPlugin { @@ -57,32 +36,32 @@ public void apply(OperationContext context) { Locale locale = LocaleContextHolder.getLocale(); Operation operation = context.operationBuilder().build(); String notes = operation.getNotes(); - notes = messageSource.getMessage(notes, null, notes, locale); + notes = messageSource.getMessage(notes, null, description, locale); Set tags = operation.getTags().stream() .map(tag -> messageSource.getMessage(tag, null, tag, locale)) .collect(toSet()); Collection parameters = operation.getRequestParameters().stream() - .map(it -> new RequestParameter( - it.getName(), - it.getIn(), - messageSource.getMessage(it.getDescription(), null, it.getDescription(), locale), - it.getRequired(), - it.getDeprecated(), - it.getHidden(), - it.getParameterSpecification(), - it.getScalarExample(), - it.getExamples(), - it.getPrecedence(), - it.getExtensions(), - it.getParameterIndex())) - .collect(toList()); + .map(it -> new RequestParameter( + it.getName(), + it.getIn(), + messageSource.getMessage(it.getDescription(), null, it.getDescription(), locale), + it.getRequired(), + it.getDeprecated(), + it.getHidden(), + it.getParameterSpecification(), + it.getScalarExample(), + it.getExamples(), + it.getPrecedence(), + it.getExtensions(), + it.getParameterIndex())) + .collect(toList()); context.operationBuilder() .notes(notes) .requestParameters(parameters) .tags(tags); } - } + }*/ } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java index 8201eedfe26c..627a1215e871 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java @@ -24,6 +24,12 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ACCESSTOKEN_LIST_PAGING_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ACCESS_TOKEN_ERROR; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AccessTokenService; @@ -32,7 +38,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -49,15 +54,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; /** * access token controller */ -@Api(tags = "ACCESS_TOKEN_TAG") +@Tag(name = "ACCESS_TOKEN_TAG") @RestController @RequestMapping("/access-tokens") public class AccessTokenController extends BaseController { @@ -74,17 +75,17 @@ public class AccessTokenController extends BaseController { * @param token token string (if it is absent, it will be automatically generated) * @return create result state code */ - @ApiOperation(value = "createToken", notes = "CREATE_TOKEN_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "expireTime", value = "EXPIRE_TIME", required = true, dataTypeClass = String.class, example = "2021-12-31 00:00:00"), - @ApiImplicitParam(name = "token", value = "TOKEN", required = false, dataTypeClass = String.class, example = "xxxx") + @Operation(summary = "createToken", description = "CREATE_TOKEN_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class), required = true), + @Parameter(name = "expireTime", description = "EXPIRE_TIME", schema = @Schema(implementation = String.class), required = true, example = "2021-12-31 00:00:00"), + @Parameter(name = "token", description = "TOKEN", required = false, schema = @Schema(implementation = String.class), example = "xxxx") }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ACCESS_TOKEN_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createToken(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createToken(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "expireTime") String expireTime, @RequestParam(value = "token", required = false) String token) { @@ -100,7 +101,7 @@ public Result createToken(@ApiIgnore @RequestAttribute(value = Constants.SESSION * @param expireTime expire time * @return token string */ - @ApiIgnore + @Parameter(hidden = true) @PostMapping(value = "/generate") @ResponseStatus(HttpStatus.CREATED) @ApiException(GENERATE_TOKEN_ERROR) @@ -121,17 +122,17 @@ public Result generateToken(@RequestAttribute(value = Constants.SESSION_USER) Us * @param pageSize page size * @return token list of page number and page size */ - @ApiOperation(value = "queryAccessTokenList", notes = "QUERY_ACCESS_TOKEN_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryAccessTokenList", description = "QUERY_ACCESS_TOKEN_LIST_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class), example = "1"), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class), example = "20") }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ACCESSTOKEN_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAccessTokenList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAccessTokenList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize) { @@ -152,15 +153,15 @@ public Result queryAccessTokenList(@ApiIgnore @RequestAttribute(value = Constant * @param userId user id * @return token list for specified user */ - @ApiOperation(value = "queryAccessTokenByUser", notes = "QUERY_ACCESS_TOKEN_BY_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", dataTypeClass = int.class) + @Operation(summary = "queryAccessTokenByUser", description = "QUERY_ACCESS_TOKEN_BY_USER_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class)) }) @GetMapping(value = "/user/{userId}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ACCESSTOKEN_BY_USER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAccessTokenByUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAccessTokenByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("userId") Integer userId) { Map result = this.accessTokenService.queryAccessTokenByUser(loginUser, userId); return this.returnDataList(result); @@ -173,12 +174,12 @@ public Result queryAccessTokenByUser(@ApiIgnore @RequestAttribute(value = Consta * @param id token id * @return delete result code */ - @ApiIgnore + @Parameter(hidden = true) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ACCESS_TOKEN_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result delAccessTokenById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result delAccessTokenById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { Map result = accessTokenService.delAccessTokenById(loginUser, id); return returnDataList(result); @@ -194,18 +195,18 @@ public Result delAccessTokenById(@ApiIgnore @RequestAttribute(value = Constants. * @param token token string (if it is absent, it will be automatically generated) * @return updated access token entity */ - @ApiOperation(value = "updateToken", notes = "UPDATE_TOKEN_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "TOKEN_ID", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "expireTime", value = "EXPIRE_TIME", required = true, dataTypeClass = String.class, example = "2021-12-31 00:00:00"), - @ApiImplicitParam(name = "token", value = "TOKEN", required = false, dataTypeClass = String.class, example = "xxxx") + @Operation(summary = "updateToken", description = "UPDATE_TOKEN_NOTES") + @Parameters({ + @Parameter(name = "id", description = "TOKEN_ID", required = true, schema = @Schema(implementation = int.class)), + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class)), + @Parameter(name = "expireTime", description = "EXPIRE_TIME", required = true, schema = @Schema(implementation = String.class), example = "2021-12-31 00:00:00"), + @Parameter(name = "token", description = "TOKEN", required = false, schema = @Schema(implementation = String.class), example = "xxxx") }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ACCESS_TOKEN_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateToken(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateToken(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "userId") int userId, @RequestParam(value = "expireTime") String expireTime, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java index ee3f3c4b1ca4..214983b440a2 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java @@ -19,6 +19,10 @@ import static org.apache.dolphinscheduler.api.enums.Status.CREATE_ACCESS_TOKEN_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.CreateTokenRequest; import org.apache.dolphinscheduler.api.dto.CreateTokenResponse; @@ -28,7 +32,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -39,14 +42,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; /** * access token controller */ -@Api(tags = "ACCESS_TOKEN_TAG") +@Tag(name = "ACCESS_TOKEN_TAG") @RestController @RequestMapping("/v2/access-tokens") public class AccessTokenV2Controller extends BaseController { @@ -61,13 +61,13 @@ public class AccessTokenV2Controller extends BaseController { * @param createTokenRequest createTokenRequest * @return CreateTokenResponse CreateTokenResponse */ - @ApiOperation(value = "createTokenV2", notes = "CREATE_TOKEN_V2") + @Operation(summary = "createTokenV2", description = "CREATE_TOKEN_V2") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) - @ApiImplicitParam(name = "createTokenRequest", value = "createTokenRequest", required = true, dataTypeClass = CreateTokenRequest.class) + @Parameter(name = "createTokenRequest", description = "createTokenRequest", required = true, schema =@Schema( implementation = CreateTokenRequest.class)) @ApiException(CREATE_ACCESS_TOKEN_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public CreateTokenResponse createToken(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public CreateTokenResponse createToken(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody CreateTokenRequest createTokenRequest) { Result result = accessTokenService.createToken(loginUser, createTokenRequest.getUserId(), diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java index 853336b3b716..dec344f26285 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java @@ -24,6 +24,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERTGROUP_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_GROUP_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -33,34 +38,20 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; -import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; /** * alert group controller */ -@Api(tags = "ALERT_GROUP_TAG") +@Tag(name = "ALERT_GROUP_TAG") @RestController @RequestMapping("/alert-groups") public class AlertGroupController extends BaseController { @@ -78,17 +69,17 @@ public class AlertGroupController extends BaseController { * @param description description * @return create result code */ - @ApiOperation(value = "createAlertgroup", notes = "CREATE_ALERT_GROUP_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "groupName", value = "GROUP_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "alertInstanceIds", value = "alertInstanceIds", required = true, dataTypeClass = String.class) + @Operation(summary = "createAlertgroup", description = "CREATE_ALERT_GROUP_NOTES") + @Parameters({ + @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "DESC", schema = @Schema( implementation = String.class)), + @Parameter(name = "alertInstanceIds", description = "alertInstanceIds", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ALERT_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createAlertgroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createAlertgroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "groupName") String groupName, @RequestParam(value = "description", required = false) String description, @RequestParam(value = "alertInstanceIds") String alertInstanceIds) { @@ -103,12 +94,12 @@ public Result createAlertgroup(@ApiIgnore @RequestAttribute(value = Constants.SE * @param loginUser login user * @return alert group list */ - @ApiOperation(value = "listAlertgroupById", notes = "QUERY_ALERT_GROUP_LIST_NOTES") + @Operation(summary = "listAlertgroupById", description = "QUERY_ALERT_GROUP_LIST_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ALL_ALERTGROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result list(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result list(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = alertGroupService.queryAlertgroup(loginUser); return returnDataList(result); @@ -123,17 +114,17 @@ public Result list(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) * @param pageSize page size * @return alert group list page */ - @ApiOperation(value = "queryAlertGroupListPaging", notes = "QUERY_ALERT_GROUP_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryAlertGroupListPaging", description = "QUERY_ALERT_GROUP_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(LIST_PAGING_ALERT_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result listPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result listPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) { @@ -152,15 +143,15 @@ public Result listPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_ * @return one alert group */ - @ApiOperation(value = "queryAlertGroupById", notes = "QUERY_ALERT_GROUP_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ALERT_GROUP_ID", dataTypeClass = int.class, example = "1") + @Operation(summary = "queryAlertGroupById", description = "QUERY_ALERT_GROUP_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "ALERT_GROUP_ID", schema =@Schema( implementation = int.class, example = "1")) }) @PostMapping(value = "/query") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ALERT_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAlertGroupById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAlertGroupById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("id") Integer id) { Map result = alertGroupService.queryAlertGroupById(loginUser, id); @@ -176,18 +167,18 @@ public Result queryAlertGroupById(@ApiIgnore @RequestAttribute(value = Constants * @param description description * @return update result code */ - @ApiOperation(value = "updateAlertgroup", notes = "UPDATE_ALERT_GROUP_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ALERT_GROUP_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "groupName", value = "GROUP_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "alertInstanceIds", value = "alertInstanceIds", required = true, dataTypeClass = String.class) + @Operation(summary = "updateAlertgroup", description = "UPDATE_ALERT_GROUP_NOTES") + @Parameters({ + @Parameter(name = "id", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "alertInstanceIds", description = "alertInstanceIds", required = true, schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ALERT_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateAlertgroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateAlertgroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "groupName") String groupName, @RequestParam(value = "description", required = false) String description, @@ -205,15 +196,15 @@ public Result updateAlertgroup(@ApiIgnore @RequestAttribute(value = Constants.SE * @param id alert group id * @return delete result code */ - @ApiOperation(value = "delAlertgroupById", notes = "DELETE_ALERT_GROUP_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ALERT_GROUP_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "delAlertgroupById", description = "DELETE_ALERT_GROUP_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ALERT_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result delAlertgroupById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result delAlertgroupById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { Map result = alertGroupService.delAlertgroupById(loginUser, id); return returnDataList(result); @@ -226,14 +217,14 @@ public Result delAlertgroupById(@ApiIgnore @RequestAttribute(value = Constants.S * @param groupName group name * @return check result code */ - @ApiOperation(value = "verifyGroupName", notes = "VERIFY_ALERT_GROUP_NAME_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "groupName", value = "GROUP_NAME", required = true, dataTypeClass = String.class), + @Operation(summary = "verifyGroupName", description = "VERIFY_ALERT_GROUP_NAME_NOTES") + @Parameters({ + @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema =@Schema( implementation = String.class)), }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyGroupName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyGroupName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "groupName") String groupName) { boolean exist = alertGroupService.existGroupName(groupName); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java index af805aa7e931..7be67984bbd1 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java @@ -24,6 +24,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_PLUGIN_INSTANCE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -33,8 +38,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.slf4j.Logger; @@ -52,15 +55,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; /** * alert plugin instance controller */ -@Api(tags = "ALERT_PLUGIN_INSTANCE_TAG") +@Tag(name = "ALERT_PLUGIN_INSTANCE_TAG") @RestController @RequestMapping("alert-plugin-instances") public class AlertPluginInstanceController extends BaseController { @@ -79,17 +78,17 @@ public class AlertPluginInstanceController extends BaseController { * @param pluginInstanceParams instance params * @return result */ - @ApiOperation(value = "createAlertPluginInstance", notes = "CREATE_ALERT_PLUGIN_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pluginDefineId", value = "ALERT_PLUGIN_DEFINE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataTypeClass = String.class, example = "DING TALK"), - @ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataTypeClass = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS") + @Operation(summary = "createAlertPluginInstance", description = "CREATE_ALERT_PLUGIN_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "pluginDefineId", description = "ALERT_PLUGIN_DEFINE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "instanceName", description = "ALERT_PLUGIN_INSTANCE_NAME", required = true, schema =@Schema( implementation = String.class, example = "DING TALK")), + @Parameter(name = "pluginInstanceParams", description = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, schema =@Schema( implementation = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS")) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "pluginDefineId") int pluginDefineId, @RequestParam(value = "instanceName") String instanceName, @RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) { @@ -107,17 +106,17 @@ public Result createAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Con * @param pluginInstanceParams instance params * @return result */ - @ApiOperation(value = "updateAlertPluginInstance", notes = "UPDATE_ALERT_PLUGIN_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "alertPluginInstanceId", value = "ALERT_PLUGIN_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "instanceName", value = "ALERT_PLUGIN_INSTANCE_NAME", required = true, dataTypeClass = String.class, example = "DING TALK"), - @ApiImplicitParam(name = "pluginInstanceParams", value = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, dataTypeClass = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS") + @Operation(summary = "updateAlertPluginInstance", description = "UPDATE_ALERT_PLUGIN_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "alertPluginInstanceId", description = "ALERT_PLUGIN_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "instanceName", description = "ALERT_PLUGIN_INSTANCE_NAME", required = true, schema =@Schema( implementation = String.class, example = "DING TALK")), + @Parameter(name = "pluginInstanceParams", description = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, schema =@Schema( implementation = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS")) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "instanceName") String instanceName, @RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) { @@ -133,15 +132,15 @@ public Result updateAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Con * @param id id * @return result */ - @ApiOperation(value = "deleteAlertPluginInstance", notes = "DELETE_ALERT_PLUGIN_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ALERT_PLUGIN_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteAlertPluginInstance", description = "DELETE_ALERT_PLUGIN_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "ALERT_PLUGIN_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { Map result = alertPluginInstanceService.delete(loginUser, id); @@ -155,12 +154,12 @@ public Result deleteAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Con * @param id alert plugin instance id * @return result */ - @ApiOperation(value = "getAlertPluginInstance", notes = "GET_ALERT_PLUGIN_INSTANCE_NOTES") + @Operation(summary = "getAlertPluginInstance", description = "GET_ALERT_PLUGIN_INSTANCE_NOTES") @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(GET_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result getAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) { Map result = alertPluginInstanceService.get(loginUser, id); return returnDataList(result); @@ -172,12 +171,12 @@ public Result getAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Consta * @param loginUser login user * @return result */ - @ApiOperation(value = "queryAlertPluginInstanceList", notes = "QUERY_ALL_ALERT_PLUGIN_INSTANCE_NOTES") + @Operation(summary = "queryAlertPluginInstanceList", description = "QUERY_ALL_ALERT_PLUGIN_INSTANCE_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result getAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = alertPluginInstanceService.queryAll(); return returnDataList(result); } @@ -189,14 +188,14 @@ public Result getAlertPluginInstance(@ApiIgnore @RequestAttribute(value = Consta * @param alertInstanceName alert instance name * @return check result code */ - @ApiOperation(value = "verifyAlertInstanceName", notes = "VERIFY_ALERT_INSTANCE_NAME_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "alertInstanceName", value = "ALERT_INSTANCE_NAME", required = true, dataTypeClass = String.class), + @Operation(summary = "verifyAlertInstanceName", description = "VERIFY_ALERT_INSTANCE_NAME_NOTES") + @Parameters({ + @Parameter(name = "alertInstanceName", description = "ALERT_INSTANCE_NAME", required = true, schema =@Schema( implementation = String.class)), }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyGroupName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyGroupName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "alertInstanceName") String alertInstanceName) { boolean exist = alertPluginInstanceService.checkExistPluginInstanceName(alertInstanceName); @@ -217,17 +216,17 @@ public Result verifyGroupName(@ApiIgnore @RequestAttribute(value = Constants.SES * @param pageSize page size * @return alert plugin instance list page */ - @ApiOperation(value = "queryAlertPluginInstanceListPaging", notes = "QUERY_ALERT_PLUGIN_INSTANCE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryAlertPluginInstanceListPaging", description = "QUERY_ALERT_PLUGIN_INSTANCE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result listPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result listPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java index 4af94c8e7b1a..ac4b17fd3b92 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java @@ -19,6 +19,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_AUDIT_LOG_LIST_PAGING; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AuditService; @@ -28,7 +33,6 @@ import org.apache.dolphinscheduler.common.enums.AuditResourceType; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -39,12 +43,8 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -@Api(tags = "AUDIT_LOG_TAG") +@Tag(name = "AUDIT_LOG_TAG") @RestController @RequestMapping("projects/audit") public class AuditLogController extends BaseController { @@ -65,21 +65,21 @@ public class AuditLogController extends BaseController { * @param pageSize page size * @return audit log content */ - @ApiOperation(value = "queryAuditLogListPaging", notes = "QUERY_AUDIT_LOG") - @ApiImplicitParams({ - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "resourceType", value = "RESOURCE_TYPE", dataTypeClass = AuditResourceType.class), - @ApiImplicitParam(name = "operationType", value = "OPERATION_TYPE", dataTypeClass = AuditOperationType.class), - @ApiImplicitParam(name = "userName", value = "USER_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryAuditLogListPaging", description = "QUERY_AUDIT_LOG") + @Parameters({ + @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "resourceType", description = "RESOURCE_TYPE", schema =@Schema( implementation = AuditResourceType.class)), + @Parameter(name = "operationType", description = "OPERATION_TYPE", schema =@Schema( implementation = AuditOperationType.class)), + @Parameter(name = "userName", description = "USER_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping(value = "/audit-log-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUDIT_LOG_LIST_PAGING) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAuditLogListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAuditLogListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam(value = "resourceType", required = false) AuditResourceType resourceType, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java index e247688ec79f..160c4c5906c5 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java @@ -24,6 +24,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_CLUSTER_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_CLUSTER_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ClusterService; @@ -32,7 +37,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -46,15 +50,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * cluster controller */ -@Api(tags = "CLUSTER_TAG") +@Tag(name = "CLUSTER_TAG") @RestController @RequestMapping("cluster") public class ClusterController extends BaseController { @@ -71,17 +70,17 @@ public class ClusterController extends BaseController { * @param description description * @return returns an error if it exists */ - @ApiOperation(value = "createCluster", notes = "CREATE_CLUSTER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "CLUSTER_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "config", value = "CONFIG", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "CLUSTER_DESC", dataTypeClass = String.class) + @Operation(summary = "createCluster", description = "CREATE_CLUSTER_NOTES") + @Parameters({ + @Parameter(name = "name", description = "CLUSTER_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "config", description = "CONFIG", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "CLUSTER_DESC", schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_CLUSTER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("name") String name, @RequestParam("config") String config, @RequestParam(value = "description", required = false) String description) { @@ -100,18 +99,18 @@ public Result createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param description description * @return update result code */ - @ApiOperation(value = "updateCluster", notes = "UPDATE_CLUSTER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "CLUSTER_CODE", required = true, dataTypeClass = long.class, example = "100"), - @ApiImplicitParam(name = "name", value = "CLUSTER_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "config", value = "CLUSTER_CONFIG", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "CLUSTER_DESC", dataTypeClass = String.class), + @Operation(summary = "updateCluster", description = "UPDATE_CLUSTER_NOTES") + @Parameters({ + @Parameter(name = "code", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), + @Parameter(name = "name", description = "CLUSTER_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "config", description = "CLUSTER_CONFIG", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "CLUSTER_DESC", schema =@Schema( implementation = String.class)), }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_CLUSTER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateCluster(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateCluster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("code") Long code, @RequestParam("name") String name, @RequestParam("config") String config, @@ -126,15 +125,15 @@ public Result updateCluster(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param clusterCode cluster code * @return cluster detail information */ - @ApiOperation(value = "queryClusterByCode", notes = "QUERY_CLUSTER_BY_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "clusterCode", value = "CLUSTER_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "queryClusterByCode", description = "QUERY_CLUSTER_BY_CODE_NOTES") + @Parameters({ + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/query-by-code") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CLUSTER_BY_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryClusterByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryClusterByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("clusterCode") Long clusterCode) { Map result = clusterService.queryClusterByCode(clusterCode); @@ -149,17 +148,17 @@ public Result queryClusterByCode(@ApiIgnore @RequestAttribute(value = Constants. * @param pageNo page number * @return cluster list which the login user have permission to see */ - @ApiOperation(value = "queryClusterListPaging", notes = "QUERY_CLUSTER_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1") + @Operation(summary = "queryClusterListPaging", description = "QUERY_CLUSTER_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CLUSTER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryClusterListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryClusterListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNo") Integer pageNo) { @@ -180,15 +179,15 @@ public Result queryClusterListPaging(@ApiIgnore @RequestAttribute(value = Consta * @param clusterCode cluster code * @return delete result code */ - @ApiOperation(value = "deleteClusterByCode", notes = "DELETE_CLUSTER_BY_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "clusterCode", value = "CLUSTER_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "deleteClusterByCode", description = "DELETE_CLUSTER_BY_CODE_NOTES") + @Parameters({ + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_CLUSTER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteCluster(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteCluster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("clusterCode") Long clusterCode) { Map result = clusterService.deleteClusterByCode(loginUser, clusterCode); @@ -201,12 +200,12 @@ public Result deleteCluster(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param loginUser login user * @return all cluster list */ - @ApiOperation(value = "queryAllClusterList", notes = "QUERY_ALL_CLUSTER_LIST_NOTES") + @Operation(summary = "queryAllClusterList", description = "QUERY_ALL_CLUSTER_LIST_NOTES") @GetMapping(value = "/query-cluster-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CLUSTER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllClusterList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryAllClusterList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = clusterService.queryAllClusterList(); return returnDataList(result); } @@ -218,15 +217,15 @@ public Result queryAllClusterList(@ApiIgnore @RequestAttribute(value = Constants * @param clusterName cluster name * @return true if the cluster name not exists, otherwise return false */ - @ApiOperation(value = "verifyCluster", notes = "VERIFY_CLUSTER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "clusterName", value = "CLUSTER_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyCluster", description = "VERIFY_CLUSTER_NOTES") + @Parameters({ + @Parameter(name = "clusterName", description = "CLUSTER_NAME", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/verify-cluster") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_CLUSTER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyCluster(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyCluster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "clusterName") String clusterName) { Map result = clusterService.verifyCluster(clusterName); return returnDataList(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java index f4cd5f80935e..b10cf2d914bc 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java @@ -23,6 +23,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUEUE_COUNT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.TASK_INSTANCE_STATE_COUNT_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.DataAnalysisService; @@ -30,7 +35,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -43,15 +47,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; /** * data analysis controller */ -@Api(tags = "DATA_ANALYSIS_TAG") +@Tag(name = "DATA_ANALYSIS_TAG") @RestController @RequestMapping("projects/analysis") public class DataAnalysisController extends BaseController { @@ -68,17 +68,17 @@ public class DataAnalysisController extends BaseController { * @param projectCode project code * @return task instance count data */ - @ApiOperation(value = "countTaskState", notes = "COUNT_TASK_STATE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", dataTypeClass = long.class, example = "100") + @Operation(summary = "countTaskState", description = "COUNT_TASK_STATE_NOTES") + @Parameters({ + @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/task-state-count") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_INSTANCE_STATE_COUNT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result countTaskState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result countTaskState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "endDate", required = false) String endDate, @RequestParam(value = "projectCode", required = false, defaultValue = "0") long projectCode) { @@ -97,17 +97,17 @@ public Result countTaskState(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param projectCode project code * @return process instance data */ - @ApiOperation(value = "countProcessInstanceState", notes = "COUNT_PROCESS_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", dataTypeClass = long.class, example = "100") + @Operation(summary = "countProcessInstanceState", description = "COUNT_PROCESS_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/process-state-count") @ResponseStatus(HttpStatus.OK) @ApiException(COUNT_PROCESS_INSTANCE_STATE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result countProcessInstanceState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result countProcessInstanceState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "endDate", required = false) String endDate, @RequestParam(value = "projectCode", required = false, defaultValue = "0") long projectCode) { @@ -124,15 +124,15 @@ public Result countProcessInstanceState(@ApiIgnore @RequestAttribute(value = Con * @param projectCode project code * @return definition count in project code */ - @ApiOperation(value = "countDefinitionByUser", notes = "COUNT_PROCESS_DEFINITION_BY_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", dataTypeClass = long.class, example = "100") + @Operation(summary = "countDefinitionByUser", description = "COUNT_PROCESS_DEFINITION_BY_USER_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/define-user-count") @ResponseStatus(HttpStatus.OK) @ApiException(COUNT_PROCESS_DEFINITION_USER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result countDefinitionByUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result countDefinitionByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "projectCode", required = false, defaultValue = "0") long projectCode) { Map result = dataAnalysisService.countDefinitionByUser(loginUser, projectCode); @@ -145,12 +145,12 @@ public Result countDefinitionByUser(@ApiIgnore @RequestAttribute(value = Constan * @param loginUser login user * @return command state of user projects */ - @ApiOperation(value = "countCommandState", notes = "COUNT_COMMAND_STATE_NOTES") + @Operation(summary = "countCommandState", description = "COUNT_COMMAND_STATE_NOTES") @GetMapping(value = "/command-state-count") @ResponseStatus(HttpStatus.OK) @ApiException(COMMAND_STATE_COUNT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result countCommandState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result countCommandState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = dataAnalysisService.countCommandState(loginUser); return returnDataList(result); @@ -162,12 +162,12 @@ public Result countCommandState(@ApiIgnore @RequestAttribute(value = Constants.S * @param loginUser login user * @return queue state count */ - @ApiOperation(value = "countQueueState", notes = "COUNT_QUEUE_STATE_NOTES") + @Operation(summary = "countQueueState", description = "COUNT_QUEUE_STATE_NOTES") @GetMapping(value = "/queue-count") @ResponseStatus(HttpStatus.OK) @ApiException(QUEUE_COUNT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result countQueueState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result countQueueState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = dataAnalysisService.countQueueState(loginUser); return returnDataList(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java index 9b4e3712408f..ad18d3c5e177 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java @@ -23,6 +23,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_RULE_LIST_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_RULE_LIST_PAGING_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.DqExecuteResultService; import org.apache.dolphinscheduler.api.service.DqRuleService; @@ -31,7 +36,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -44,15 +48,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; /** * data quality controller */ -@Api(tags = "DATA_QUALITY_SERVICE") +@Tag(name = "DATA_QUALITY_SERVICE") @RestController @RequestMapping("/data-quality") public class DataQualityController extends BaseController { @@ -68,9 +68,9 @@ public class DataQualityController extends BaseController { * @param ruleId ruleId * @return from-create json */ - @ApiOperation(value = "getRuleFormCreateJson", notes = "GET_RULE_FORM_CREATE_JSON_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "ruleId", value = "RULE_ID", dataTypeClass = int.class, example = "1") + @Operation(summary = "getRuleFormCreateJson", description = "GET_RULE_FORM_CREATE_JSON_NOTES") + @Parameters({ + @Parameter(name = "ruleId", description = "RULE_ID", schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping(value = "/getRuleFormCreateJson") @ResponseStatus(HttpStatus.OK) @@ -89,19 +89,19 @@ public Result getRuleFormCreateJsonById(@RequestParam(value = "ruleId") int rule * @param pageSize page size * @return rule page */ - @ApiOperation(value = "queryRuleListPaging", notes = "QUERY_RULE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "ruleType", value = "RULE_TYPE", dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", dataTypeClass = int.class, example = "10") + @Operation(summary = "queryRuleListPaging", description = "QUERY_RULE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "ruleType", description = "RULE_TYPE", schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", schema =@Schema( implementation = int.class, example = "10")) }) @GetMapping(value = "/rule/page") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RULE_LIST_PAGING_ERROR) - public Result queryRuleListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryRuleListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "ruleType", required = false) Integer ruleType, @RequestParam(value = "startDate", required = false) String startTime, @@ -121,7 +121,7 @@ public Result queryRuleListPaging(@ApiIgnore @RequestAttribute(value = Constants * query all rule list * @return rule list */ - @ApiOperation(value = "queryRuleList", notes = "QUERY_RULE_LIST_NOTES") + @Operation(summary = "queryRuleList", description = "QUERY_RULE_LIST_NOTES") @GetMapping(value = "/ruleList") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RULE_LIST_ERROR) @@ -143,20 +143,20 @@ public Result queryRuleList() { * @param pageSize pageSize * @return */ - @ApiOperation(value = "queryExecuteResultListPaging", notes = "QUERY_EXECUTE_RESULT_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "ruleType", value = "RULE_TYPE", dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "state", value = "STATE", dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", dataTypeClass = int.class, example = "10") + @Operation(summary = "queryExecuteResultListPaging", description = "QUERY_EXECUTE_RESULT_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "ruleType", description = "RULE_TYPE", schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "state", description = "STATE", schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", schema =@Schema( implementation = int.class, example = "10")) }) @GetMapping(value = "/result/page") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_EXECUTE_RESULT_LIST_PAGING_ERROR) - public Result queryExecuteResultListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryExecuteResultListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "ruleType", required = false) Integer ruleType, @RequestParam(value = "state", required = false) Integer state, @@ -180,9 +180,9 @@ public Result queryExecuteResultListPaging(@ApiIgnore @RequestAttribute(value = * @param datasourceId datasourceId * @return result */ - @ApiOperation(value = "getDatasourceOptionsById", notes = "GET_DATASOURCE_OPTIONS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "datasourceId", value = "DATA_SOURCE_ID", dataTypeClass = int.class, example = "1") + @Operation(summary = "getDatasourceOptionsById", description = "GET_DATASOURCE_OPTIONS_NOTES") + @Parameters({ + @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping(value = "/getDatasourceOptionsById") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java index 3d9961e99bc5..5fc0de1273e6 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java @@ -30,6 +30,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_DATASOURCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_DATASOURCE_NAME_FAILURE; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -44,8 +49,6 @@ import org.apache.dolphinscheduler.spi.datasource.ConnectionParam; import org.apache.dolphinscheduler.spi.enums.DbType; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -62,16 +65,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * data source controller */ -@Api(tags = "DATA_SOURCE_TAG") +@Tag(name = "DATA_SOURCE_TAG") @RestController @RequestMapping("datasources") public class DataSourceController extends BaseController { @@ -87,13 +84,13 @@ public class DataSourceController extends BaseController { * example: {"type":"MYSQL","name":"txx","note":"","host":"localhost","port":3306,"principal":"","javaSecurityKrb5Conf":"","loginUserKeytabUsername":"","loginUserKeytabPath":"","userName":"root","password":"xxx","database":"ds","connectType":"","other":{"serverTimezone":"GMT-8"},"id":2,"testFlag":0,"bindTestId":1} * @return create result code */ - @ApiOperation(value = "createDataSource", notes = "CREATE_DATA_SOURCE_NOTES") + @Operation(summary = "createDataSource", description = "CREATE_DATA_SOURCE_NOTES") @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_DATASOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "dataSourceParam", value = "DATA_SOURCE_PARAM", required = true) @RequestBody String jsonStr) { + public Result createDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "dataSourceParam", description = "DATA_SOURCE_PARAM", required = true) @RequestBody String jsonStr) { BaseDataSourceParamDTO dataSourceParam = DataSourceUtils.buildDatasourceParam(jsonStr); return dataSourceService.createDataSource(loginUser, dataSourceParam); } @@ -107,16 +104,16 @@ public Result createDataSource(@ApiIgnore @RequestAttribute(value = Constants.SE * example: {"type":"MYSQL","name":"txx","note":"","host":"localhost","port":3306,"principal":"","javaSecurityKrb5Conf":"","loginUserKeytabUsername":"","loginUserKeytabPath":"","userName":"root","password":"xxx","database":"ds","connectType":"","other":{"serverTimezone":"GMT-8"},"id":2,"testFlag":0,"bindTestId":1} * @return update result code */ - @ApiOperation(value = "updateDataSource", notes = "UPDATE_DATA_SOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "DATA_SOURCE_ID", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "dataSourceParam", value = "DATA_SOURCE_PARAM", required = true, dataTypeClass = BaseDataSourceParamDTO.class) + @Operation(summary = "updateDataSource", description = "UPDATE_DATA_SOURCE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class)), + @Parameter(name = "dataSourceParam", description = "DATA_SOURCE_PARAM", required = true, schema =@Schema( implementation = BaseDataSourceParamDTO.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_DATASOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") Integer id, @RequestBody String jsonStr) { BaseDataSourceParamDTO dataSourceParam = DataSourceUtils.buildDatasourceParam(jsonStr); @@ -131,16 +128,16 @@ public Result updateDataSource(@ApiIgnore @RequestAttribute(value = Constants.SE * @param id datasource id * @return data source detail */ - @ApiOperation(value = "queryDataSource", notes = "QUERY_DATA_SOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "DATA_SOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "queryDataSource", description = "QUERY_DATA_SOURCE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { Map result = dataSourceService.queryDataSource(id); @@ -154,16 +151,16 @@ public Result queryDataSource(@ApiIgnore @RequestAttribute(value = Constants.SES * @param type data source type * @return data source list page */ - @ApiOperation(value = "queryDataSourceList", notes = "QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "DB_TYPE", required = true, dataType = "DbType"), - @ApiImplicitParam(name = "testFlag", value = "DB_TEST_FLAG", required = true, dataType = "DbTestFlag") + @Operation(summary = "queryDataSourceList", description = "QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES") + @Parameters({ + @Parameter(name = "type", description = "DB_TYPE", required = true, schema = @Schema (implementation = DbType.class)), + @Parameter(name = "testFlag", description = "DB_TEST_FLAG", required = true, schema = @Schema (implementation = int.class)) }) @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryDataSourceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryDataSourceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("type") DbType type, @RequestParam("testFlag") int testFlag) { Map result = dataSourceService.queryDataSourceList(loginUser, type.ordinal(), testFlag); @@ -179,17 +176,17 @@ public Result queryDataSourceList(@ApiIgnore @RequestAttribute(value = Constants * @param pageSize page size * @return data source list page */ - @ApiOperation(value = "queryDataSourceListPaging", notes = "QUERY_DATA_SOURCE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryDataSourceListPaging", description = "QUERY_DATA_SOURCE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryDataSourceListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryDataSourceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) { @@ -209,12 +206,12 @@ public Result queryDataSourceListPaging(@ApiIgnore @RequestAttribute(value = Con * example: {"type":"MYSQL","name":"txx","note":"","host":"localhost","port":3306,"principal":"","javaSecurityKrb5Conf":"","loginUserKeytabUsername":"","loginUserKeytabPath":"","userName":"root","password":"xxx","database":"ds","connectType":"","other":{"serverTimezone":"GMT-8"},"id":2} * @return connect result code */ - @ApiOperation(value = "connectDataSource", notes = "CONNECT_DATA_SOURCE_NOTES") + @Operation(summary = "connectDataSource", description = "CONNECT_DATA_SOURCE_NOTES") @PostMapping(value = "/connect") @ResponseStatus(HttpStatus.OK) @ApiException(CONNECT_DATASOURCE_FAILURE) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result connectDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result connectDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "dataSourceParam") @RequestBody String jsonStr) { BaseDataSourceParamDTO dataSourceParam = DataSourceUtils.buildDatasourceParam(jsonStr); DataSourceUtils.checkDatasourceParam(dataSourceParam); @@ -229,15 +226,15 @@ public Result connectDataSource(@ApiIgnore @RequestAttribute(value = Constants.S * @param id data source id * @return connect result code */ - @ApiOperation(value = "connectionTest", notes = "CONNECT_DATA_SOURCE_TEST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "DATA_SOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "connectionTest", description = "CONNECT_DATA_SOURCE_TEST_NOTES") + @Parameters({ + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/connect-test") @ResponseStatus(HttpStatus.OK) @ApiException(CONNECTION_TEST_FAILURE) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result connectionTest(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result connectionTest(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { return dataSourceService.connectionTest(id); } @@ -249,15 +246,15 @@ public Result connectionTest(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param id datasource id * @return delete result */ - @ApiOperation(value = "deleteDataSource", notes = "DELETE_DATA_SOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "DATA_SOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteDataSource", description = "DELETE_DATA_SOURCE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_DATA_SOURCE_FAILURE) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { return dataSourceService.delete(loginUser, id); } @@ -269,15 +266,15 @@ public Result deleteDataSource(@ApiIgnore @RequestAttribute(value = Constants.SE * @param name data source name * @return true if data source name not exists.otherwise return false */ - @ApiOperation(value = "verifyDataSourceName", notes = "VERIFY_DATA_SOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "DATA_SOURCE_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyDataSourceName", description = "VERIFY_DATA_SOURCE_NOTES") + @Parameters({ + @Parameter(name = "name", description = "DATA_SOURCE_NAME", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_DATASOURCE_NAME_FAILURE) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyDataSourceName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyDataSourceName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "name") String name) { return dataSourceService.verifyDataSourceName(name); } @@ -289,15 +286,15 @@ public Result verifyDataSourceName(@ApiIgnore @RequestAttribute(value = Constant * @param userId user id * @return unauthed data source result code */ - @ApiOperation(value = "unauthDatasource", notes = "UNAUTHORIZED_DATA_SOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "unauthDatasource", description = "UNAUTHORIZED_DATA_SOURCE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-datasource") @ResponseStatus(HttpStatus.OK) @ApiException(UNAUTHORIZED_DATASOURCE) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result unauthDatasource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result unauthDatasource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = dataSourceService.unauthDatasource(loginUser, userId); @@ -311,15 +308,15 @@ public Result unauthDatasource(@ApiIgnore @RequestAttribute(value = Constants.SE * @param userId user id * @return authorized result code */ - @ApiOperation(value = "authedDatasource", notes = "AUTHORIZED_DATA_SOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "authedDatasource", description = "AUTHORIZED_DATA_SOURCE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-datasource") @ResponseStatus(HttpStatus.OK) @ApiException(AUTHORIZED_DATA_SOURCE) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result authedDatasource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result authedDatasource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = dataSourceService.authedDatasource(loginUser, userId); @@ -332,19 +329,19 @@ public Result authedDatasource(@ApiIgnore @RequestAttribute(value = Constants.SE * @param loginUser login user * @return user info data */ - @ApiOperation(value = "getKerberosStartupState", notes = "GET_USER_INFO_NOTES") + @Operation(summary = "getKerberosStartupState", description = "GET_USER_INFO_NOTES") @GetMapping(value = "/kerberos-startup-state") @ResponseStatus(HttpStatus.OK) @ApiException(KERBEROS_STARTUP_STATE) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result getKerberosStartupState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result getKerberosStartupState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { // if upload resource is HDFS and kerberos startup is true , else false return success(Status.SUCCESS.getMsg(), CommonUtils.getKerberosStartupState()); } - @ApiOperation(value = "tables", notes = "GET_DATASOURCE_TABLES_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "datasourceId", value = "DATA_SOURCE_ID", required = true, dataTypeClass = int.class, example = "1") + @Operation(summary = "tables", description = "GET_DATASOURCE_TABLES_NOTES") + @Parameters({ + @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping(value = "/tables") @ResponseStatus(HttpStatus.OK) @@ -354,10 +351,10 @@ public Result getTables(@RequestParam("datasourceId") Integer datasourceId) { return returnDataList(result); } - @ApiOperation(value = "tableColumns", notes = "GET_DATASOURCE_TABLE_COLUMNS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "datasourceId", value = "DATA_SOURCE_ID", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "tableName", value = "TABLE_NAME", required = true, dataTypeClass = String.class, example = "test") + @Operation(summary = "tableColumns", description = "GET_DATASOURCE_TABLE_COLUMNS_NOTES") + @Parameters({ + @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "tableName", description = "TABLE_NAME", required = true, schema =@Schema( implementation = String.class, example = "test")) }) @GetMapping(value = "/tableColumns") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java index fb1bf113801a..05f57a77f7df 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java @@ -24,6 +24,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ENVIRONMENT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_ENVIRONMENT_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.EnvironmentService; @@ -32,8 +37,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -46,15 +49,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * environment controller */ -@Api(tags = "ENVIRONMENT_TAG") +@Tag(name = "ENVIRONMENT_TAG") @RestController @RequestMapping("environment") public class EnvironmentController extends BaseController { @@ -71,18 +69,18 @@ public class EnvironmentController extends BaseController { * @param description description * @return returns an error if it exists */ - @ApiOperation(value = "createEnvironment", notes = "CREATE_ENVIRONMENT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "ENVIRONMENT_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "config", value = "CONFIG", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "ENVIRONMENT_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "workerGroups", value = "WORKER_GROUP_LIST", dataTypeClass = String.class) + @Operation(summary = "createEnvironment", description = "CREATE_ENVIRONMENT_NOTES") + @Parameters({ + @Parameter(name = "name", description = "ENVIRONMENT_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "config", description = "CONFIG", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "ENVIRONMENT_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "workerGroups", description = "WORKER_GROUP_LIST", schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_ENVIRONMENT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createEnvironment(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("name") String name, @RequestParam("config") String config, @RequestParam(value = "description", required = false) String description, @@ -103,19 +101,19 @@ public Result createEnvironment(@ApiIgnore @RequestAttribute(value = Constants.S * @param description description * @return update result code */ - @ApiOperation(value = "updateEnvironment", notes = "UPDATE_ENVIRONMENT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "ENVIRONMENT_CODE", required = true, dataTypeClass = long.class, example = "100"), - @ApiImplicitParam(name = "name", value = "ENVIRONMENT_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "config", value = "ENVIRONMENT_CONFIG", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "ENVIRONMENT_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "workerGroups", value = "WORKER_GROUP_LIST", dataTypeClass = String.class) + @Operation(summary = "updateEnvironment", description = "UPDATE_ENVIRONMENT_NOTES") + @Parameters({ + @Parameter(name = "code", description = "ENVIRONMENT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), + @Parameter(name = "name", description = "ENVIRONMENT_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "config", description = "ENVIRONMENT_CONFIG", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "ENVIRONMENT_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "workerGroups", description = "WORKER_GROUP_LIST", schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_ENVIRONMENT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateEnvironment(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("code") Long code, @RequestParam("name") String name, @RequestParam("config") String config, @@ -132,15 +130,15 @@ public Result updateEnvironment(@ApiIgnore @RequestAttribute(value = Constants.S * @param environmentCode environment code * @return environment detail information */ - @ApiOperation(value = "queryEnvironmentByCode", notes = "QUERY_ENVIRONMENT_BY_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "queryEnvironmentByCode", description = "QUERY_ENVIRONMENT_BY_CODE_NOTES") + @Parameters({ + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/query-by-code") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ENVIRONMENT_BY_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryEnvironmentByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryEnvironmentByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("environmentCode") Long environmentCode) { Map result = environmentService.queryEnvironmentByCode(environmentCode); @@ -155,17 +153,17 @@ public Result queryEnvironmentByCode(@ApiIgnore @RequestAttribute(value = Consta * @param pageNo page number * @return environment list which the login user have permission to see */ - @ApiOperation(value = "queryEnvironmentListPaging", notes = "QUERY_ENVIRONMENT_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1") + @Operation(summary = "queryEnvironmentListPaging", description = "QUERY_ENVIRONMENT_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ENVIRONMENT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryEnvironmentListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryEnvironmentListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNo") Integer pageNo) { @@ -186,15 +184,15 @@ public Result queryEnvironmentListPaging(@ApiIgnore @RequestAttribute(value = Co * @param environmentCode environment code * @return delete result code */ - @ApiOperation(value = "deleteEnvironmentByCode", notes = "DELETE_ENVIRONMENT_BY_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "deleteEnvironmentByCode", description = "DELETE_ENVIRONMENT_BY_CODE_NOTES") + @Parameters({ + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_ENVIRONMENT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteEnvironment(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("environmentCode") Long environmentCode) { Map result = environmentService.deleteEnvironmentByCode(loginUser, environmentCode); @@ -207,12 +205,12 @@ public Result deleteEnvironment(@ApiIgnore @RequestAttribute(value = Constants.S * @param loginUser login user * @return all environment list */ - @ApiOperation(value = "queryAllEnvironmentList", notes = "QUERY_ALL_ENVIRONMENT_LIST_NOTES") + @Operation(summary = "queryAllEnvironmentList", description = "QUERY_ALL_ENVIRONMENT_LIST_NOTES") @GetMapping(value = "/query-environment-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_ENVIRONMENT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllEnvironmentList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryAllEnvironmentList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = environmentService.queryAllEnvironmentList(loginUser); return returnDataList(result); } @@ -224,15 +222,15 @@ public Result queryAllEnvironmentList(@ApiIgnore @RequestAttribute(value = Const * @param environmentName environment name * @return true if the environment name not exists, otherwise return false */ - @ApiOperation(value = "verifyEnvironment", notes = "VERIFY_ENVIRONMENT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "environmentName", value = "ENVIRONMENT_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyEnvironment", description = "VERIFY_ENVIRONMENT_NOTES") + @Parameters({ + @Parameter(name = "environmentName", description = "ENVIRONMENT_NAME", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/verify-environment") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_ENVIRONMENT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyEnvironment(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyEnvironment(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "environmentName") String environmentName) { Map result = environmentService.verifyEnvironment(environmentName); return returnDataList(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java index f672702b8546..12f37015943d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java @@ -23,6 +23,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_EXECUTING_WORKFLOW_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.START_PROCESS_INSTANCE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.ExecuteType; import org.apache.dolphinscheduler.api.enums.Status; @@ -41,8 +46,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.remote.dto.WorkflowExecuteDto; -import springfox.documentation.annotations.ApiIgnore; - import org.apache.commons.lang3.StringUtils; import java.text.MessageFormat; @@ -66,16 +69,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * executor controller */ -@Api(tags = "EXECUTOR_TAG") +@Tag(name = "EXECUTOR_TAG") @RestController @RequestMapping("projects/{projectCode}/executors") public class ExecutorController extends BaseController { @@ -106,32 +103,32 @@ public class ExecutorController extends BaseController { * @param testFlag testFlag * @return start process result code */ - @ApiOperation(value = "startProcessInstance", notes = "RUN_PROCESS_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100"), - @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", required = true, dataType = "String", example = "2022-04-06 00:00:00,2022-04-06 00:00:00"), - @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", required = true, dataType = "FailureStrategy"), - @ApiImplicitParam(name = "startNodeList", value = "START_NODE_LIST", dataType = "String"), - @ApiImplicitParam(name = "taskDependType", value = "TASK_DEPEND_TYPE", dataType = "TaskDependType"), - @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataType = "CommandType"), - @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", required = true, dataType = "WarningType"), - @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataType = "Int", example = "100"), - @ApiImplicitParam(name = "runMode", value = "RUN_MODE", dataType = "RunMode"), - @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority"), - @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataType = "String", example = "default"), - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataType = "Long", example = "-1"), - @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType = "Int", example = "100"), - @ApiImplicitParam(name = "expectedParallelismNumber", value = "EXPECTED_PARALLELISM_NUMBER", dataType = "Int", example = "8"), - @ApiImplicitParam(name = "dryRun", value = "DRY_RUN", dataType = "Int", example = "0"), - @ApiImplicitParam(name = "testFlag", value = "TEST_FLAG", dataType = "Int", example = "0"), - @ApiImplicitParam(name = "complementDependentMode", value = "COMPLEMENT_DEPENDENT_MODE", dataType = "complementDependentMode") + @Operation(summary = "startProcessInstance", description = "RUN_PROCESS_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = Long.class), example = "100"), + @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", required = true, schema =@Schema( implementation = String.class), example = "2022-04-06 00:00:00,2022-04-06 00:00:00"), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema =@Schema( implementation = FailureStrategy.class)), + @Parameter(name = "startNodeList", description = "START_NODE_LIST", schema =@Schema( implementation = String.class)), + @Parameter(name = "taskDependType", description = "TASK_DEPEND_TYPE", schema =@Schema( implementation = TaskDependType.class)), + @Parameter(name = "execType", description = "COMMAND_TYPE", schema =@Schema( implementation = CommandType.class)), + @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema =@Schema( implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "runMode", description = "RUN_MODE", schema =@Schema( implementation = RunMode.class)), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", required = true, schema =@Schema( implementation = Priority.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = Long.class, example = "-1")), + @Parameter(name = "timeout", description = "TIMEOUT", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "expectedParallelismNumber", description = "EXPECTED_PARALLELISM_NUMBER", schema =@Schema( implementation = int.class , example = "8")), + @Parameter(name = "dryRun", description = "DRY_RUN", schema =@Schema( implementation = int.class, example = "0")), + @Parameter(name = "testFlag", description = "TEST_FLAG", schema =@Schema( implementation = int.class, example = "0")), + @Parameter(name = "complementDependentMode", description = "COMPLEMENT_DEPENDENT_MODE", schema =@Schema( implementation = ComplementDependentMode.class)) }) @PostMapping(value = "start-process-instance") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result startProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result startProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode") long processDefinitionCode, @RequestParam(value = "scheduleTime") String scheduleTime, @RequestParam(value = "failureStrategy") FailureStrategy failureStrategy, @@ -194,32 +191,32 @@ public Result startProcessInstance(@ApiIgnore @RequestAttribute(value = Constant * @param testFlag testFlag * @return start process result code */ - @ApiOperation(value = "batchStartProcessInstance", notes = "BATCH_RUN_PROCESS_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processDefinitionCodes", value = "PROCESS_DEFINITION_CODES", required = true, dataType = "String", example = "1,2,3"), - @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", required = true, dataType = "String", example = "2022-04-06 00:00:00,2022-04-06 00:00:00"), - @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", required = true, dataType = "FailureStrategy"), - @ApiImplicitParam(name = "startNodeList", value = "START_NODE_LIST", dataType = "String"), - @ApiImplicitParam(name = "taskDependType", value = "TASK_DEPEND_TYPE", dataType = "TaskDependType"), - @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataType = "CommandType"), - @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", required = true, dataType = "WarningType"), - @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", required = true, dataType = "Int", example = "100"), - @ApiImplicitParam(name = "runMode", value = "RUN_MODE", dataType = "RunMode"), - @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority"), - @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataType = "String", example = "default"), - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataType = "Long", example = "-1"), - @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType = "Int", example = "100"), - @ApiImplicitParam(name = "expectedParallelismNumber", value = "EXPECTED_PARALLELISM_NUMBER", dataType = "Int", example = "8"), - @ApiImplicitParam(name = "dryRun", value = "DRY_RUN", dataType = "Int", example = "0"), - @ApiImplicitParam(name = "testFlag", value = "TEST_FLAG", dataType = "Int", example = "0"), - @ApiImplicitParam(name = "complementDependentMode", value = "COMPLEMENT_DEPENDENT_MODE", dataType = "complementDependentMode") + @Operation(summary = "batchStartProcessInstance", description = "BATCH_RUN_PROCESS_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "processDefinitionCodes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "1,2,3")), + @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", required = true, schema =@Schema( implementation = String.class, example = "2022-04-06 00:00:00,2022-04-06 00:00:00")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema =@Schema( implementation = FailureStrategy.class)), + @Parameter(name = "startNodeList", description = "START_NODE_LIST", schema =@Schema( implementation = String.class)), + @Parameter(name = "taskDependType", description = "TASK_DEPEND_TYPE", schema =@Schema( implementation = TaskDependType.class)), + @Parameter(name = "execType", description = "COMMAND_TYPE", schema =@Schema( implementation = CommandType.class)), + @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema =@Schema( implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "runMode", description = "RUN_MODE", schema =@Schema( implementation = RunMode.class)), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", required = true, schema =@Schema( implementation = Priority.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = Long.class, example = "-1")), + @Parameter(name = "timeout", description = "TIMEOUT", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "expectedParallelismNumber", description = "EXPECTED_PARALLELISM_NUMBER", schema =@Schema( implementation = int.class, example = "8")), + @Parameter(name = "dryRun", description = "DRY_RUN", schema =@Schema( implementation = int.class, example = "0")), + @Parameter(name = "testFlag", description = "TEST_FLAG", schema =@Schema( implementation = int.class, example = "0")), + @Parameter(name = "complementDependentMode", description = "COMPLEMENT_DEPENDENT_MODE", schema =@Schema( implementation = ComplementDependentMode.class)) }) @PostMapping(value = "batch-start-process-instance") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result batchStartProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result batchStartProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCodes") String processDefinitionCodes, @RequestParam(value = "scheduleTime") String scheduleTime, @RequestParam(value = "failureStrategy") FailureStrategy failureStrategy, @@ -272,9 +269,10 @@ public Result batchStartProcessInstance(@ApiIgnore @RequestAttribute(value = Con logger.error("Process definition start failed, projectCode:{}, processDefinitionCode:{}.", projectCode, processDefinitionCode); startFailedProcessDefinitionCodeList.add(String.valueOf(processDefinitionCode)); - } else + } else { logger.info("Start process definition complete, projectCode:{}, processDefinitionCode:{}.", projectCode, processDefinitionCode); + } } if (!startFailedProcessDefinitionCodeList.isEmpty()) { @@ -294,21 +292,21 @@ public Result batchStartProcessInstance(@ApiIgnore @RequestAttribute(value = Con * @param executeType execute type * @return execute result code */ - @ApiOperation(value = "execute", notes = "EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "executeType", value = "EXECUTE_TYPE", required = true, dataTypeClass = ExecuteType.class) + @Operation(summary = "execute", description = "EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "executeType", description = "EXECUTE_TYPE", required = true, schema =@Schema( implementation = ExecuteType.class)) }) @PostMapping(value = "/execute") @ResponseStatus(HttpStatus.OK) @ApiException(EXECUTE_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result execute(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("processInstanceId") Integer processInstanceId, - @RequestParam("executeType") ExecuteType executeType) { - logger.info("Start to execute process instance, projectCode:{}, processInstanceId:{}.", projectCode, - processInstanceId); + @RequestParam("executeType") ExecuteType executeType + ) { + logger.info("Start to execute process instance, projectCode:{}, processInstanceId:{}.", projectCode, processInstanceId); Map result = execService.execute(loginUser, projectCode, processInstanceId, executeType); return returnDataList(result); } @@ -322,11 +320,11 @@ public Result execute(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USE * @param executeType execute type * @return execute result code */ - @ApiOperation(value = "batchExecute", notes = "BATCH_EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "processInstanceIds", value = "PROCESS_INSTANCE_IDS", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "executeType", value = "EXECUTE_TYPE", required = true, dataTypeClass = ExecuteType.class) + @Operation(summary = "batchExecute", description = "BATCH_EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = int.class)), + @Parameter(name = "processInstanceIds", description = "PROCESS_INSTANCE_IDS", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "executeType", description = "EXECUTE_TYPE", required = true, schema =@Schema( implementation = ExecuteType.class)) }) @PostMapping(value = "/batch-execute") @ResponseStatus(HttpStatus.OK) @@ -373,9 +371,9 @@ public Result batchExecute(@RequestAttribute(value = Constants.SESSION_USER) Use * @param processDefinitionCode process definition code * @return check result code */ - @ApiOperation(value = "startCheckProcessDefinition", notes = "START_CHECK_PROCESS_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "startCheckProcessDefinition", description = "START_CHECK_PROCESS_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @PostMapping(value = "/start-check") @ResponseStatus(HttpStatus.OK) @@ -389,9 +387,9 @@ public Result startCheckProcessDefinition(@RequestParam(value = "processDefiniti /** * query execute data of processInstance from master */ - @ApiOperation(value = "queryExecutingWorkflow", notes = "QUERY_WORKFLOW_EXECUTE_DATA") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "queryExecutingWorkflow", description = "QUERY_WORKFLOW_EXECUTE_DATA") + @Parameters({ + @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/query-executing-workflow") @ResponseStatus(HttpStatus.OK) @@ -414,25 +412,25 @@ public Result queryExecutingWorkflow(@RequestParam("id") Integer processInstance * @param workerGroup worker group * @return start task result code */ - @ApiOperation(value = "startTaskInstance", notes = "RUN_TASK_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "version", value = "VERSION", dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", required = true, dataTypeClass = FailureStrategy.class), - @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataTypeClass = CommandType.class), - @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", required = true, dataTypeClass = WarningType.class), - @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataTypeClass = String.class, example = "default"), - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataTypeClass = long.class, example = "-1"), - @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "dryRun", value = "DRY_RUN", dataTypeClass = int.class, example = "0"), + @Operation(summary = "startTaskInstance", description = "RUN_TASK_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "version", description = "VERSION", schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema =@Schema( implementation = FailureStrategy.class)), + @Parameter(name = "execType", description = "COMMAND_TYPE", schema =@Schema( implementation = CommandType.class)), + @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema =@Schema( implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class, example = "-1")), + @Parameter(name = "timeout", description = "TIMEOUT", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "dryRun", description = "DRY_RUN", schema =@Schema( implementation = int.class, example = "0")), }) @PostMapping(value = "/task-instance/{code}/start") @ResponseStatus(HttpStatus.OK) @ApiException(START_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result startStreamTaskInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, - @ApiParam(name = "code", value = "TASK_CODE", required = true) @PathVariable long code, + public Result startStreamTaskInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, + @Parameter(name = "code", description = "TASK_CODE", required = true) @PathVariable long code, @RequestParam(value = "version", required = true) int version, @RequestParam(value = "warningGroupId", required = false, defaultValue = "0") Integer warningGroupId, @RequestParam(value = "workerGroup", required = false, defaultValue = "default") String workerGroup, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java index fb54b67283e9..69d5b6f0c302 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java @@ -17,10 +17,9 @@ package org.apache.dolphinscheduler.api.controller; -import static org.apache.dolphinscheduler.api.enums.Status.ADD_TASK_TYPE_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_TYPE_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.LIST_TASK_TYPE_ERROR; - +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.FavTaskDto; import org.apache.dolphinscheduler.api.enums.Status; @@ -29,13 +28,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; - -import springfox.documentation.annotations.ApiIgnore; - -import java.util.List; - -import javax.annotation.Resource; - import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -46,13 +38,17 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import javax.annotation.Resource; +import java.util.List; + +import static org.apache.dolphinscheduler.api.enums.Status.ADD_TASK_TYPE_ERROR; +import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_TYPE_ERROR; +import static org.apache.dolphinscheduler.api.enums.Status.LIST_TASK_TYPE_ERROR; /** * fav controller */ -@Api(tags = "FAVOURITE") +@Tag(name = "FAVOURITE") @RestController @RequestMapping("/favourite") public class FavTaskController extends BaseController { @@ -66,12 +62,12 @@ public class FavTaskController extends BaseController { * @param loginUser login user * @return task type list */ - @ApiOperation(value = "listTaskType", notes = "LIST_TASK_TYPE") + @Operation(summary = "listTaskType", description = "LIST_TASK_TYPE") @GetMapping(value = "/taskTypes") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_TASK_TYPE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result listTaskType(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result listTaskType(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { List favTaskList = favTaskService.getFavTaskList(loginUser); return success(Status.SUCCESS.getMsg(), favTaskList); } @@ -82,12 +78,12 @@ public Result listTaskType(@ApiIgnore @RequestAttribute(value = Constants.SESSIO * @param loginUser login user * @return */ - @ApiOperation(value = "deleteTaskType", notes = "DELETE_TASK_TYPE") + @Operation(summary = "deleteTaskType", description = "DELETE_TASK_TYPE") @DeleteMapping(value = "/{taskName}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_TYPE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteFavTask(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteFavTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("taskName") String taskName) { boolean b = favTaskService.deleteFavTask(loginUser, taskName); return success(b); @@ -99,12 +95,12 @@ public Result deleteFavTask(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param loginUser login user * @return */ - @ApiOperation(value = "addTaskType", notes = "ADD_TASK_TYPE") + @Operation(summary = "addTaskType", description = "ADD_TASK_TYPE") @PostMapping(value = "/{taskName}") @ResponseStatus(HttpStatus.OK) @ApiException(ADD_TASK_TYPE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result addFavTask(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result addFavTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("taskName") String taskName) { int i = favTaskService.addFavTask(loginUser, taskName); return success(i > 0); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java index 9e95fd0e0937..d8822f055e53 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java @@ -26,6 +26,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_K8S_NAMESPACE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_K8S_NAMESPACE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.K8sNamespaceService; @@ -35,8 +40,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.List; import java.util.Map; @@ -52,15 +55,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * k8s namespace controller */ -@Api(tags = "K8S_NAMESPACE_TAG") +@Tag(name = "K8S_NAMESPACE_TAG") @RestController @RequestMapping("/k8s-namespace") public class K8sNamespaceController extends BaseController { @@ -77,17 +75,17 @@ public class K8sNamespaceController extends BaseController { * @param pageNo page number * @return namespace list which the login user have permission to see */ - @ApiOperation(value = "queryNamespaceListPaging", notes = "QUERY_NAMESPACE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1") + @Operation(summary = "queryNamespaceListPaging", description = "QUERY_NAMESPACE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_K8S_NAMESPACE_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryNamespaceListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryNamespaceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNo") Integer pageNo) { @@ -111,18 +109,18 @@ public Result queryNamespaceListPaging(@ApiIgnore @RequestAttribute(value = Cons * @param limitsMemory max memory * @return */ - @ApiOperation(value = "createK8sNamespace", notes = "CREATE_NAMESPACE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "namespace", value = "NAMESPACE", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "clusterCode", value = "CLUSTER_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "limits_cpu", value = "LIMITS_CPU", required = false, dataTypeClass = double.class), - @ApiImplicitParam(name = "limits_memory", value = "LIMITS_MEMORY", required = false, dataTypeClass = int.class) + @Operation(summary = "createK8sNamespace", description = "CREATE_NAMESPACE_NOTES") + @Parameters({ + @Parameter(name = "namespace", description = "NAMESPACE", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "limits_cpu", description = "LIMITS_CPU", required = false, schema =@Schema( implementation = double.class)), + @Parameter(name = "limits_memory", description = "LIMITS_MEMORY", required = false, schema =@Schema( implementation = int.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_K8S_NAMESPACE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createNamespace(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "namespace") String namespace, @RequestParam(value = "clusterCode") Long clusterCode, @RequestParam(value = "limitsCpu", required = false) Double limitsCpu, @@ -141,17 +139,17 @@ public Result createNamespace(@ApiIgnore @RequestAttribute(value = Constants.SES * @param limitsMemory max memory * @return */ - @ApiOperation(value = "updateK8sNamespace", notes = "UPDATE_NAMESPACE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "K8S_NAMESPACE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "userName", value = "OWNER", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "limitsCpu", value = "LIMITS_CPU", required = false, dataTypeClass = double.class), - @ApiImplicitParam(name = "limitsMemory", value = "LIMITS_MEMORY", required = false, dataTypeClass = int.class)}) + @Operation(summary = "updateK8sNamespace", description = "UPDATE_NAMESPACE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "K8S_NAMESPACE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "userName", description = "OWNER", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "limitsCpu", description = "LIMITS_CPU", required = false, schema =@Schema( implementation = double.class)), + @Parameter(name = "limitsMemory", description = "LIMITS_MEMORY", required = false, schema =@Schema( implementation = int.class))}) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_K8S_NAMESPACE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateNamespace(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "userName", required = false) String userName, @RequestParam(value = "tag", required = false) String tag, @@ -170,16 +168,16 @@ public Result updateNamespace(@ApiIgnore @RequestAttribute(value = Constants.SES * @param clusterCode cluster code * @return true if the k8s and namespace not exists, otherwise return false */ - @ApiOperation(value = "verifyNamespaceK8s", notes = "VERIFY_NAMESPACE_K8S_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "namespace", value = "NAMESPACE", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "clusterCode", value = "CLUSTER_CODE", required = true, dataTypeClass = long.class), + @Operation(summary = "verifyNamespaceK8s", description = "VERIFY_NAMESPACE_K8S_NOTES") + @Parameters({ + @Parameter(name = "namespace", description = "NAMESPACE", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class)), }) @PostMapping(value = "/verify") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_K8S_NAMESPACE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyNamespace(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "namespace") String namespace, @RequestParam(value = "clusterCode") Long clusterCode) { @@ -193,15 +191,15 @@ public Result verifyNamespace(@ApiIgnore @RequestAttribute(value = Constants.SES * @param id namespace id * @return delete result code */ - @ApiOperation(value = "delNamespaceById", notes = "DELETE_NAMESPACE_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "NAMESPACE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "delNamespaceById", description = "DELETE_NAMESPACE_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "NAMESPACE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_K8S_NAMESPACE_BY_ID_ERROR) @AccessLogAnnotation - public Result delNamespaceById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result delNamespaceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) { Map result = k8sNamespaceService.deleteNamespaceById(loginUser, id); return returnDataList(result); @@ -214,15 +212,15 @@ public Result delNamespaceById(@ApiIgnore @RequestAttribute(value = Constants.SE * @param userId user id * @return the namespaces which user have not permission to see */ - @ApiOperation(value = "queryUnauthorizedNamespace", notes = "QUERY_UNAUTHORIZED_NAMESPACE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", dataTypeClass = int.class, example = "100") + @Operation(summary = "queryUnauthorizedNamespace", description = "QUERY_UNAUTHORIZED_NAMESPACE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-namespace") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UNAUTHORIZED_NAMESPACE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUnauthorizedNamespace(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUnauthorizedNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = k8sNamespaceService.queryUnauthorizedNamespace(loginUser, userId); return returnDataList(result); @@ -235,15 +233,15 @@ public Result queryUnauthorizedNamespace(@ApiIgnore @RequestAttribute(value = Co * @param userId user id * @return namespaces which the user have permission to see */ - @ApiOperation(value = "queryAuthorizedNamespace", notes = "QUERY_AUTHORIZED_NAMESPACE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", dataTypeClass = int.class, example = "100") + @Operation(summary = "queryAuthorizedNamespace", description = "QUERY_AUTHORIZED_NAMESPACE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-namespace") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_NAMESPACE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAuthorizedNamespace(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAuthorizedNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = k8sNamespaceService.queryAuthorizedNamespace(loginUser, userId); return returnDataList(result); @@ -255,12 +253,12 @@ public Result queryAuthorizedNamespace(@ApiIgnore @RequestAttribute(value = Cons * @param loginUser login user * @return namespace list */ - @ApiOperation(value = "queryAvailableNamespaceList", notes = "QUERY_AVAILABLE_NAMESPACE_LIST_NOTES") + @Operation(summary = "queryAvailableNamespaceList", description = "QUERY_AVAILABLE_NAMESPACE_LIST_NOTES") @GetMapping(value = "/available-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_CAN_USE_K8S_NAMESPACE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAvailableNamespaceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryAvailableNamespaceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { List result = k8sNamespaceService.queryNamespaceAvailable(loginUser); return success(result); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java index 6c9d49c75c25..23c1d953adc2 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java @@ -20,6 +20,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_INSTANCE_LOG_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.LoggerService; @@ -28,8 +33,6 @@ import org.apache.dolphinscheduler.dao.entity.ResponseTaskLog; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; @@ -43,16 +46,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * logger controller */ -@Api(tags = "LOGGER_TAG") +@Tag(name = "LOGGER_TAG") @RestController @RequestMapping("/log") public class LoggerController extends BaseController { @@ -69,17 +66,17 @@ public class LoggerController extends BaseController { * @param limit limit * @return task log content */ - @ApiOperation(value = "queryLog", notes = "QUERY_TASK_INSTANCE_LOG_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "taskInstanceId", value = "TASK_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "queryLog", description = "QUERY_TASK_INSTANCE_LOG_NOTES") + @Parameters({ + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/detail") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_INSTANCE_LOG_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryLog(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "taskInstanceId") int taskInstanceId, @RequestParam(value = "skipLineNum") int skipNum, @RequestParam(value = "limit") int limit) { @@ -93,15 +90,15 @@ public Result queryLog(@ApiIgnore @RequestAttribute(value = Con * @param taskInstanceId task instance id * @return log file content */ - @ApiOperation(value = "downloadTaskLog", notes = "DOWNLOAD_TASK_INSTANCE_LOG_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "taskInstanceId", value = "TASK_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "downloadTaskLog", description = "DOWNLOAD_TASK_INSTANCE_LOG_NOTES") + @Parameters({ + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/download-log") @ResponseBody @ApiException(DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ResponseEntity downloadTaskLog(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "taskInstanceId") int taskInstanceId) { byte[] logBytes = loggerService.getLogBytes(taskInstanceId); return ResponseEntity @@ -121,19 +118,19 @@ public ResponseEntity downloadTaskLog(@ApiIgnore @RequestAttribute(value = Const * @param limit limit * @return task log content */ - @ApiOperation(value = "queryLogInSpecifiedProject", notes = "QUERY_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskInstanceId", value = "TASK_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "queryLogInSpecifiedProject", description = "QUERY_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{projectCode}/detail") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_INSTANCE_LOG_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryLog(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskInstanceId") int taskInstanceId, @RequestParam(value = "skipLineNum") int skipNum, @RequestParam(value = "limit") int limit) { @@ -148,17 +145,17 @@ public Result queryLog(@ApiIgnore @RequestAttribute(value = Constants.SE * @param taskInstanceId task instance id * @return log file content */ - @ApiOperation(value = "downloadTaskLogInSpecifiedProject", notes = "DOWNLOAD_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskInstanceId", value = "TASK_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "downloadTaskLogInSpecifiedProject", description = "DOWNLOAD_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{projectCode}/download-log") @ResponseBody @ApiException(DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ResponseEntity downloadTaskLog(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskInstanceId") int taskInstanceId) { byte[] logBytes = loggerService.getLogBytes(loginUser, projectCode, taskInstanceId); return ResponseEntity diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java index 097493a4f5b0..ca503e69f058 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java @@ -21,6 +21,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.SIGN_OUT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.USER_LOGIN_FAILURE; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -30,8 +35,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; @@ -48,15 +51,10 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * login controller */ -@Api(tags = "LOGIN_TAG") +@Tag(name = "LOGIN_TAG") @RestController @RequestMapping("") public class LoginController extends BaseController { @@ -76,10 +74,10 @@ public class LoginController extends BaseController { * @param response response * @return login result */ - @ApiOperation(value = "login", notes = "LOGIN_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userName", value = "USER_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "userPassword", value = "USER_PASSWORD", required = true, dataTypeClass = String.class) + @Operation(summary = "login", description = "LOGIN_NOTES") + @Parameters({ + @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/login") @ApiException(USER_LOGIN_FAILURE) @@ -124,11 +122,11 @@ public Result login(@RequestParam(value = "userName") String userName, * @param request request * @return sign out result */ - @ApiOperation(value = "signOut", notes = "SIGNOUT_NOTES") + @Operation(summary = "signOut", description = "SIGNOUT_NOTES") @PostMapping(value = "/signOut") @ApiException(SIGN_OUT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "request"}) - public Result signOut(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result signOut(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, HttpServletRequest request) { String ip = getClientIpAddress(request); sessionService.signOut(ip, loginUser); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java index 1acbc99a40f3..6a09639a8e87 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java @@ -21,6 +21,9 @@ import static org.apache.dolphinscheduler.api.enums.Status.LIST_WORKERS_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_DATABASE_STATE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.MonitorService; @@ -28,8 +31,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -40,13 +41,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - /** * monitor controller */ -@Api(tags = "MONITOR_TAG") +@Tag(name = "MONITOR_TAG") @RestController @RequestMapping("/monitor") public class MonitorController extends BaseController { @@ -60,12 +58,12 @@ public class MonitorController extends BaseController { * @param loginUser login user * @return master list */ - @ApiOperation(value = "listMaster", notes = "MASTER_LIST_NOTES") + @Operation(summary = "listMaster", description = "MASTER_LIST_NOTES") @GetMapping(value = "/masters") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_MASTERS_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result listMaster(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result listMaster(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = monitorService.queryMaster(loginUser); return returnDataList(result); } @@ -76,12 +74,12 @@ public Result listMaster(@ApiIgnore @RequestAttribute(value = Constants.SESSION_ * @param loginUser login user * @return worker information list */ - @ApiOperation(value = "listWorker", notes = "WORKER_LIST_NOTES") + @Operation(summary = "listWorker", description = "WORKER_LIST_NOTES") @GetMapping(value = "/workers") @ResponseStatus(HttpStatus.OK) @ApiException(LIST_WORKERS_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result listWorker(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result listWorker(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = monitorService.queryWorker(loginUser); return returnDataList(result); } @@ -92,12 +90,12 @@ public Result listWorker(@ApiIgnore @RequestAttribute(value = Constants.SESSION_ * @param loginUser login user * @return data base state */ - @ApiOperation(value = "queryDatabaseState", notes = "QUERY_DATABASE_STATE_NOTES") + @Operation(summary = "queryDatabaseState", description = "QUERY_DATABASE_STATE_NOTES") @GetMapping(value = "/databases") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATABASE_STATE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryDatabaseState(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryDatabaseState(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = monitorService.queryDatabaseState(loginUser); return returnDataList(result); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java index dc29875ec460..4411f45b5555 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java @@ -35,6 +35,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_DEFINITION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -48,8 +53,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import javax.servlet.http.HttpServletResponse; @@ -71,16 +74,10 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * process definition controller */ -@Api(tags = "PROCESS_DEFINITION_TAG") +@Tag(name = "PROCESS_DEFINITION_TAG") @RestController @RequestMapping("projects/{projectCode}/process-definition") public class ProcessDefinitionController extends BaseController { @@ -106,19 +103,19 @@ public class ProcessDefinitionController extends BaseController { * @param otherParamsJson otherParamsJson handle other params * @return create result code */ - @ApiOperation(value = "createProcessDefinition", notes = "CREATE_PROCESS_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "locations", value = "PROCESS_DEFINITION_LOCATIONS", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "PROCESS_DEFINITION_DESC", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "otherParamsJson", value = "OTHER_PARAMS_JSON", required = false, dataTypeClass = String.class) + @Operation(summary = "createProcessDefinition", description = "CREATE_PROCESS_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "locations", description = "PROCESS_DEFINITION_LOCATIONS", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result createProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @RequestParam(value = "description", required = false) String description, @RequestParam(value = "globalParams", required = false, defaultValue = "[]") String globalParams, @@ -144,17 +141,17 @@ public Result createProcessDefinition(@ApiIgnore @RequestAttribute(value = Const * @param targetProjectCode target project code * @return copy result code */ - @ApiOperation(value = "batchCopyByCodes", notes = "COPY_PROCESS_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codes", value = "PROCESS_DEFINITION_CODES", required = true, dataTypeClass = String.class, example = "3,4"), - @ApiImplicitParam(name = "targetProjectCode", value = "TARGET_PROJECT_CODE", required = true, dataTypeClass = long.class, example = "123") + @Operation(summary = "batchCopyByCodes", description = "COPY_PROCESS_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "3,4")), + @Parameter(name = "targetProjectCode", description = "TARGET_PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "123")) }) @PostMapping(value = "/batch-copy") @ResponseStatus(HttpStatus.OK) @ApiException(BATCH_COPY_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result copyProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result copyProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "codes", required = true) String codes, @RequestParam(value = "targetProjectCode", required = true) long targetProjectCode) { return returnDataList( @@ -170,17 +167,17 @@ public Result copyProcessDefinition(@ApiIgnore @RequestAttribute(value = Constan * @param targetProjectCode target project code * @return move result code */ - @ApiOperation(value = "batchMoveByCodes", notes = "MOVE_PROCESS_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codes", value = "PROCESS_DEFINITION_CODES", required = true, dataTypeClass = String.class, example = "3,4"), - @ApiImplicitParam(name = "targetProjectCode", value = "TARGET_PROJECT_CODE", required = true, dataTypeClass = long.class, example = "123") + @Operation(summary = "batchMoveByCodes", description = "MOVE_PROCESS_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "3,4")), + @Parameter(name = "targetProjectCode", description = "TARGET_PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "123")) }) @PostMapping(value = "/batch-move") @ResponseStatus(HttpStatus.OK) @ApiException(BATCH_MOVE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result moveProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result moveProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "codes", required = true) String codes, @RequestParam(value = "targetProjectCode", required = true) long targetProjectCode) { return returnDataList( @@ -195,17 +192,17 @@ public Result moveProcessDefinition(@ApiIgnore @RequestAttribute(value = Constan * @param name name * @return true if process definition name not exists, otherwise false */ - @ApiOperation(value = "verify-name", notes = "VERIFY_PROCESS_DEFINITION_NAME_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = false, dataTypeClass = Long.class), + @Operation(summary = "verify-name", description = "VERIFY_PROCESS_DEFINITION_NAME_NOTES") + @Parameters({ + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = false, schema =@Schema( implementation = Long.class)), }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyProcessDefinitionName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result verifyProcessDefinitionName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @RequestParam(value = "code", required = false, defaultValue = "0") long processDefinitionCode) { Map result = processDefinitionService.verifyProcessDefinitionName(loginUser, projectCode, name, @@ -230,21 +227,21 @@ public Result verifyProcessDefinitionName(@ApiIgnore @RequestAttribute(value = C * @param otherParamsJson otherParamsJson handle other params * @return update result code */ - @ApiOperation(value = "update", notes = "UPDATE_PROCESS_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "123456789"), - @ApiImplicitParam(name = "locations", value = "PROCESS_DEFINITION_LOCATIONS", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "PROCESS_DEFINITION_DESC", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "releaseState", value = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, dataTypeClass = ReleaseState.class), - @ApiImplicitParam(name = "otherParamsJson", value = "OTHER_PARAMS_JSON", required = false, dataTypeClass = String.class) + @Operation(summary = "update", description = "UPDATE_PROCESS_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), + @Parameter(name = "locations", description = "PROCESS_DEFINITION_LOCATIONS", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, schema =@Schema( implementation = ReleaseState.class)), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result updateProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @PathVariable(value = "code", required = true) long code, @RequestParam(value = "description", required = false) String description, @@ -283,18 +280,18 @@ public Result updateProcessDefinition(@ApiIgnore @RequestAttribute(value = Const * @param code the process definition code * @return the process definition version list */ - @ApiOperation(value = "queryVersions", notes = "QUERY_PROCESS_DEFINITION_VERSIONS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1") + @Operation(summary = "queryVersions", description = "QUERY_PROCESS_DEFINITION_VERSIONS_NOTES") + @Parameters({ + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")) }) @GetMapping(value = "/{code}/versions") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_VERSIONS_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProcessDefinitionVersions(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryProcessDefinitionVersions(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "pageNo") int pageNo, @RequestParam(value = "pageSize") int pageSize, @PathVariable(value = "code") long code) { @@ -318,17 +315,17 @@ public Result queryProcessDefinitionVersions(@ApiIgnore @RequestAttribute(value * @param version the version user want to switch * @return switch version result code */ - @ApiOperation(value = "switchVersion", notes = "SWITCH_PROCESS_DEFINITION_VERSION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1"), - @ApiImplicitParam(name = "version", value = "VERSION", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "switchVersion", description = "SWITCH_PROCESS_DEFINITION_VERSION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(SWITCH_PROCESS_DEFINITION_VERSION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result switchProcessDefinitionVersion(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result switchProcessDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @PathVariable(value = "version") int version) { Map result = @@ -345,17 +342,17 @@ public Result switchProcessDefinitionVersion(@ApiIgnore @RequestAttribute(value * @param version the process definition version user want to delete * @return delete version result code */ - @ApiOperation(value = "deleteVersion", notes = "DELETE_PROCESS_DEFINITION_VERSION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1"), - @ApiImplicitParam(name = "version", value = "VERSION", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteVersion", description = "DELETE_PROCESS_DEFINITION_VERSION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROCESS_DEFINITION_VERSION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteProcessDefinitionVersion(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteProcessDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @PathVariable(value = "version") int version) { Map result = @@ -372,18 +369,18 @@ public Result deleteProcessDefinitionVersion(@ApiIgnore @RequestAttribute(value * @param releaseState release state * @return release result code */ - @ApiOperation(value = "release", notes = "RELEASE_PROCESS_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "123456789"), - @ApiImplicitParam(name = "releaseState", value = "PROCESS_DEFINITION_RELEASE", required = true, dataTypeClass = ReleaseState.class), + @Operation(summary = "release", description = "RELEASE_PROCESS_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), + @Parameter(name = "releaseState", description = "PROCESS_DEFINITION_RELEASE", required = true, schema =@Schema( implementation = ReleaseState.class)), }) @PostMapping(value = "/{code}/release") @ResponseStatus(HttpStatus.OK) @ApiException(RELEASE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result releaseProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result releaseProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code, @RequestParam(value = "releaseState", required = true) ReleaseState releaseState) { Map result = @@ -399,16 +396,16 @@ public Result releaseProcessDefinition(@ApiIgnore @RequestAttribute(value = Cons * @param code process definition code * @return process definition detail */ - @ApiOperation(value = "queryProcessDefinitionByCode", notes = "QUERY_PROCESS_DEFINITION_BY_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "123456789") + @Operation(summary = "queryProcessDefinitionByCode", description = "QUERY_PROCESS_DEFINITION_BY_CODE_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProcessDefinitionByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryProcessDefinitionByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code) { Map result = processDefinitionService.queryProcessDefinitionByCode(loginUser, projectCode, code); @@ -423,16 +420,16 @@ public Result queryProcessDefinitionByCode(@ApiIgnore @RequestAttribute(value = * @param name process definition name * @return process definition detail */ - @ApiOperation(value = "queryProcessDefinitionByName", notes = "QUERY_PROCESS_DEFINITION_BY_NAME_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "queryProcessDefinitionByName", description = "QUERY_PROCESS_DEFINITION_BY_NAME_NOTES") + @Parameters({ + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/query-by-name") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProcessDefinitionByName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryProcessDefinitionByName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("name") String name) { Map result = processDefinitionService.queryProcessDefinitionByName(loginUser, projectCode, name); @@ -446,13 +443,13 @@ public Result queryProcessDefinitionByName(@ApiIgnore @Reques * @param projectCode project code * @return process definition list */ - @ApiOperation(value = "queryList", notes = "QUERY_PROCESS_DEFINITION_LIST_NOTES") + @Operation(summary = "queryList", description = "QUERY_PROCESS_DEFINITION_LIST_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProcessDefinitionList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode) { + public Result queryProcessDefinitionList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = processDefinitionService.queryProcessDefinitionList(loginUser, projectCode); return returnDataList(result); } @@ -464,13 +461,13 @@ public Result queryProcessDefinitionList(@ApiIgnore @RequestAttribute(value = Co * @param projectCode project code * @return process definition list */ - @ApiOperation(value = "querySimpleList", notes = "QUERY_PROCESS_DEFINITION_SIMPLE_LIST_NOTES") + @Operation(summary = "querySimpleList", description = "QUERY_PROCESS_DEFINITION_SIMPLE_LIST_NOTES") @GetMapping(value = "/simple-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProcessDefinitionSimpleList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode) { + public Result queryProcessDefinitionSimpleList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = processDefinitionService.queryProcessDefinitionSimpleList(loginUser, projectCode); return returnDataList(result); } @@ -487,21 +484,21 @@ public Result queryProcessDefinitionSimpleList(@ApiIgnore @RequestAttribute(valu * @param userId user id * @return process definition page */ - @ApiOperation(value = "queryListPaging", notes = "QUERY_PROCESS_DEFINITION_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "userId", value = "USER_ID", required = false, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "otherParamsJson", value = "OTHER_PARAMS_JSON", required = false, dataTypeClass = String.class) + @Operation(summary = "queryListPaging", description = "QUERY_PROCESS_DEFINITION_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "userId", description = "USER_ID", required = false, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result> queryProcessDefinitionListPaging( - @ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + @Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "otherParamsJson", required = false) String otherParamsJson, @RequestParam(value = "userId", required = false, defaultValue = "0") Integer userId, @@ -529,17 +526,17 @@ public Result> queryProcessDefinitionListPaging( * @param limit limit * @return tree view json data */ - @ApiOperation(value = "viewTree", notes = "VIEW_TREE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "100"), - @ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "viewTree", description = "VIEW_TREE_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{code}/view-tree") @ResponseStatus(HttpStatus.OK) @ApiException(ENCAPSULATION_TREEVIEW_STRUCTURE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") long code, @RequestParam("limit") Integer limit) { Map result = processDefinitionService.viewTree(loginUser, projectCode, code, limit); @@ -554,15 +551,15 @@ public Result viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_US * @param code process definition code * @return task list */ - @ApiOperation(value = "getTasksByDefinitionCode", notes = "GET_TASK_LIST_BY_DEFINITION_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "getTasksByDefinitionCode", description = "GET_TASK_LIST_BY_DEFINITION_CODE_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/{code}/tasks") @ResponseStatus(HttpStatus.OK) @ApiException(GET_TASKS_LIST_BY_PROCESS_DEFINITION_ID_ERROR) - public Result getNodeListByDefinitionCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result getNodeListByDefinitionCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") long code) { Map result = processDefinitionService.getTaskNodeListByDefinitionCode(loginUser, projectCode, code); @@ -577,15 +574,15 @@ public Result getNodeListByDefinitionCode(@ApiIgnore @RequestAttribute(value = C * @param codes process definition codes * @return node list data */ - @ApiOperation(value = "getTaskListByDefinitionCodes", notes = "GET_TASK_LIST_BY_DEFINITION_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codes", value = "PROCESS_DEFINITION_CODES", required = true, dataTypeClass = String.class, example = "100,200,300") + @Operation(summary = "getTaskListByDefinitionCodes", description = "GET_TASK_LIST_BY_DEFINITION_CODE_NOTES") + @Parameters({ + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "100,200,300")) }) @GetMapping(value = "/batch-query-tasks") @ResponseStatus(HttpStatus.OK) @ApiException(GET_TASKS_LIST_BY_PROCESS_DEFINITION_ID_ERROR) - public Result getNodeListMapByDefinitionCodes(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result getNodeListMapByDefinitionCodes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("codes") String codes) { Map result = processDefinitionService.getNodeListMapByDefinitionCodes(loginUser, projectCode, codes); @@ -599,15 +596,15 @@ public Result getNodeListMapByDefinitionCodes(@ApiIgnore @RequestAttribute(value * @param projectCode project code * @return process definition list data */ - @ApiOperation(value = "getProcessListByProjectCode", notes = "GET_PROCESS_LIST_BY_PROCESS_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "getProcessListByProjectCode", description = "GET_PROCESS_LIST_BY_PROCESS_CODE_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/query-process-definition-list") @ResponseStatus(HttpStatus.OK) @ApiException(GET_TASKS_LIST_BY_PROCESS_DEFINITION_ID_ERROR) - public Result getProcessListByProjectCodes(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode) { + public Result getProcessListByProjectCodes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = processDefinitionService.queryProcessDefinitionListByProjectCode(projectCode); return returnDataList(result); } @@ -619,16 +616,16 @@ public Result getProcessListByProjectCodes(@ApiIgnore @RequestAttribute(value = * @param projectCode project code * @return process definition list data */ - @ApiOperation(value = "getTaskListByProcessDefinitionCode", notes = "GET_TASK_LIST_BY_PROCESS_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class, example = "100"), - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "100"), + @Operation(summary = "getTaskListByProcessDefinitionCode", description = "GET_TASK_LIST_BY_PROCESS_CODE_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), }) @GetMapping(value = "/query-task-definition-list") @ResponseStatus(HttpStatus.OK) @ApiException(GET_TASKS_LIST_BY_PROCESS_DEFINITION_ID_ERROR) - public Result getTaskListByProcessDefinitionCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result getTaskListByProcessDefinitionCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode") Long processDefinitionCode) { Map result = processDefinitionService .queryTaskDefinitionListByProcessDefinitionCode(projectCode, processDefinitionCode); @@ -643,16 +640,16 @@ public Result getTaskListByProcessDefinitionCode(@ApiIgnore @RequestAttribute(va * @param code process definition code * @return delete result code */ - @ApiOperation(value = "deleteByCode", notes = "DELETE_PROCESS_DEFINITION_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteByCode", description = "DELETE_PROCESS_DEFINITION_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROCESS_DEFINE_BY_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteProcessDefinitionByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteProcessDefinitionByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("code") long code) { processDefinitionService.deleteProcessDefinitionByCode(loginUser, code); return new Result(Status.SUCCESS); @@ -666,16 +663,16 @@ public Result deleteProcessDefinitionByCode(@ApiIgnore @RequestAttribute(value = * @param codes process definition code list * @return delete result code */ - @ApiOperation(value = "batchDeleteByCodes", notes = "BATCH_DELETE_PROCESS_DEFINITION_BY_IDS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codes", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = String.class) + @Operation(summary = "batchDeleteByCodes", description = "BATCH_DELETE_PROCESS_DEFINITION_BY_IDS_NOTES") + @Parameters({ + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/batch-delete") @ResponseStatus(HttpStatus.OK) @ApiException(BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result batchDeleteProcessDefinitionByCodes(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result batchDeleteProcessDefinitionByCodes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("codes") String codes) { Map result = @@ -691,15 +688,15 @@ public Result batchDeleteProcessDefinitionByCodes(@ApiIgnore @RequestAttribute(v * @param codes process definition codes * @param response response */ - @ApiOperation(value = "batchExportByCodes", notes = "BATCH_EXPORT_PROCESS_DEFINITION_BY_CODES_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codes", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = String.class) + @Operation(summary = "batchExportByCodes", description = "BATCH_EXPORT_PROCESS_DEFINITION_BY_CODES_NOTES") + @Parameters({ + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/batch-export") @ResponseBody @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "response"}) - public void batchExportProcessDefinitionByCodes(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public void batchExportProcessDefinitionByCodes(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("codes") String codes, HttpServletResponse response) { try { @@ -716,13 +713,13 @@ public void batchExportProcessDefinitionByCodes(@ApiIgnore @RequestAttribute(val * @param projectCode project code * @return process definition list */ - @ApiOperation(value = "queryAllByProjectCode", notes = "QUERY_PROCESS_DEFINITION_All_BY_PROJECT_CODE_NOTES") + @Operation(summary = "queryAllByProjectCode", description = "QUERY_PROCESS_DEFINITION_All_BY_PROJECT_CODE_NOTES") @GetMapping(value = "/all") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllProcessDefinitionByProjectCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode) { + public Result queryAllProcessDefinitionByProjectCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = processDefinitionService.queryAllProcessDefinitionByProjectCode(loginUser, projectCode); return returnDataList(result); @@ -736,15 +733,15 @@ public Result queryAllProcessDefinitionByProjectCode(@ApiIgnore @RequestAttribut * @param file resource file * @return import result code */ - @ApiOperation(value = "importProcessDefinition", notes = "IMPORT_PROCESS_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataTypeClass = MultipartFile.class) + @Operation(summary = "importProcessDefinition", description = "IMPORT_PROCESS_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema =@Schema( implementation = MultipartFile.class)) }) @PostMapping(value = "/import") @ApiException(IMPORT_PROCESS_DEFINE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "file"}) - public Result importProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result importProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("file") MultipartFile file) { Map result; if ("application/zip".equals(file.getContentType())) { @@ -768,18 +765,18 @@ public Result importProcessDefinition(@ApiIgnore @RequestAttribute(value = Const * @param scheduleJson scheduleJson * @return process definition code */ - @ApiOperation(value = "createEmptyProcessDefinition", notes = "CREATE_EMPTY_PROCESS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class, example = "123456789"), - @ApiImplicitParam(name = "description", value = "PROCESS_DEFINITION_DESC", required = false, dataTypeClass = String.class) + @Operation(summary = "createEmptyProcessDefinition", description = "CREATE_EMPTY_PROCESS_NOTES") + @Parameters({ + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/empty") @ResponseStatus(HttpStatus.OK) @ApiException(CREATE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createEmptyProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result createEmptyProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @RequestParam(value = "description", required = false) String description, @RequestParam(value = "globalParams", required = false, defaultValue = "[]") String globalParams, @@ -809,20 +806,20 @@ public Result createEmptyProcessDefinition(@ApiIgnore @RequestAttribute(value = * @param otherParamsJson otherParamsJson handle other params * @return update result code */ - @ApiOperation(value = "updateBasicInfo", notes = "UPDATE_PROCESS_DEFINITION_BASIC_INFO_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "123456789"), - @ApiImplicitParam(name = "description", value = "PROCESS_DEFINITION_DESC", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "releaseState", value = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, dataTypeClass = ReleaseState.class), - @ApiImplicitParam(name = "otherParamsJson", value = "OTHER_PARAMS_JSON", required = false, dataTypeClass = String.class) + @Operation(summary = "updateBasicInfo", description = "UPDATE_PROCESS_DEFINITION_BASIC_INFO_NOTES") + @Parameters({ + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, schema =@Schema( implementation = ReleaseState.class)), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{code}/basic-info") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateProcessDefinitionBasicInfo(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result updateProcessDefinitionBasicInfo(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "name", required = true) String name, @PathVariable(value = "code", required = true) long code, @RequestParam(value = "description", required = false) String description, @@ -857,18 +854,18 @@ public Result updateProcessDefinitionBasicInfo(@ApiIgnore @RequestAttribute(valu * @param releaseState releaseState * @return update result code */ - @ApiOperation(value = "releaseWorkflowAndSchedule", notes = "RELEASE_WORKFLOW_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "code", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "123456789"), - @ApiImplicitParam(name = "releaseState", value = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, dataTypeClass = ReleaseState.class) + @Operation(summary = "releaseWorkflowAndSchedule", description = "RELEASE_WORKFLOW_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, schema =@Schema( implementation = ReleaseState.class)) }) @PostMapping(value = "/{code}/release-workflow") @ResponseStatus(HttpStatus.OK) @ApiException(RELEASE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result releaseWorkflowAndSchedule(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result releaseWorkflowAndSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code, @RequestParam(value = "releaseState", required = true, defaultValue = "OFFLINE") ReleaseState releaseState) { return returnDataList( diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java index ebc5edde85ac..af9b0a82fe17 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java @@ -17,17 +17,12 @@ package org.apache.dolphinscheduler.api.controller; -import static org.apache.dolphinscheduler.api.enums.Status.BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.DELETE_PROCESS_INSTANCE_BY_ID_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.ENCAPSULATION_PROCESS_INSTANCE_GANTT_STRUCTURE_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PARENT_PROCESS_INSTANCE_DETAIL_INFO_BY_SUB_PROCESS_INSTANCE_ID_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_INSTANCE_ALL_VARIABLES_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_INSTANCE_BY_ID_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.QUERY_SUB_PROCESS_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_INSTANCE_ERROR; - +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.commons.lang3.StringUtils; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -35,13 +30,14 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus; +import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.User; -import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; - -import springfox.documentation.annotations.ApiIgnore; - -import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; import java.io.IOException; import java.text.MessageFormat; @@ -50,31 +46,12 @@ import java.util.List; import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import static org.apache.dolphinscheduler.api.enums.Status.*; /** * process instance controller */ -@Api(tags = "PROCESS_INSTANCE_TAG") +@Tag(name = "PROCESS_INSTANCE_TAG") @RestController @RequestMapping("/projects/{projectCode}/process-instances") public class ProcessInstanceController extends BaseController { @@ -100,24 +77,24 @@ public class ProcessInstanceController extends BaseController { * @param otherParamsJson otherParamsJson handle other params * @return process instance list */ - @ApiOperation(value = "queryProcessInstanceListPaging", notes = "QUERY_PROCESS_INSTANCE_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processDefineCode", value = "PROCESS_DEFINITION_CODE", dataTypeClass = long.class, example = "100"), - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "executorName", value = "EXECUTOR_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "stateType", value = "EXECUTION_STATUS", dataTypeClass = WorkflowExecutionStatus.class), - @ApiImplicitParam(name = "host", value = "HOST", dataTypeClass = String.class), - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10") + @Operation(summary = "queryProcessInstanceListPaging", description = "QUERY_PROCESS_INSTANCE_LIST_NOTES") + @Parameters({ + @Parameter(name = "processDefineCode", description = "PROCESS_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "100")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema =@Schema( implementation = WorkflowExecutionStatus.class)), + @Parameter(name = "host", description = "HOST", schema =@Schema( implementation = String.class)), + @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProcessInstanceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryProcessInstanceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefineCode", required = false, defaultValue = "0") long processDefineCode, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam(value = "executorName", required = false) String executorName, @@ -148,16 +125,16 @@ public Result queryProcessInstanceList(@ApiIgnore @RequestAttribute(value = Cons * @param id process instance id * @return task list for the process instance */ - @ApiOperation(value = "queryTaskListByProcessId", notes = "QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "queryTaskListByProcessId", description = "QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/tasks") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTaskListByProcessId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryTaskListByProcessId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) throws IOException { Map result = processInstanceService.queryTaskListByProcessId(loginUser, projectCode, id); return returnDataList(result); @@ -177,24 +154,24 @@ public Result queryTaskListByProcessId(@ApiIgnore @RequestAttribute(value = Cons * @param tenantCode tenantCode * @return update result code */ - @ApiOperation(value = "updateProcessInstance", notes = "UPDATE_PROCESS_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "taskRelationJson", value = "TASK_RELATION_JSON", dataTypeClass = String.class), - @ApiImplicitParam(name = "taskDefinitionJson", value = "TASK_DEFINITION_JSON", dataTypeClass = String.class), - @ApiImplicitParam(name = "id", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME", dataTypeClass = String.class), - @ApiImplicitParam(name = "syncDefine", value = "SYNC_DEFINE", required = true, dataTypeClass = boolean.class, example = "false"), - @ApiImplicitParam(name = "globalParams", value = "PROCESS_GLOBAL_PARAMS", dataTypeClass = String.class, example = "[]"), - @ApiImplicitParam(name = "locations", value = "PROCESS_INSTANCE_LOCATIONS", dataTypeClass = String.class), - @ApiImplicitParam(name = "timeout", value = "PROCESS_TIMEOUT", dataTypeClass = int.class, example = "0"), - @ApiImplicitParam(name = "tenantCode", value = "TENANT_CODE", dataTypeClass = String.class, example = "default") + @Operation(summary = "updateProcessInstance", description = "UPDATE_PROCESS_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "taskRelationJson", description = "TASK_RELATION_JSON", schema =@Schema( implementation = String.class)), + @Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", schema =@Schema( implementation = String.class)), + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", schema =@Schema( implementation = String.class)), + @Parameter(name = "syncDefine", description = "SYNC_DEFINE", required = true, schema =@Schema( implementation = boolean.class, example = "false")), + @Parameter(name = "globalParams", description = "PROCESS_GLOBAL_PARAMS", schema =@Schema( implementation = String.class, example = "[]")), + @Parameter(name = "locations", description = "PROCESS_INSTANCE_LOCATIONS", schema =@Schema( implementation = String.class)), + @Parameter(name = "timeout", description = "PROCESS_TIMEOUT", schema =@Schema( implementation = int.class, example = "0")), + @Parameter(name = "tenantCode", description = "TENANT_CODE", schema =@Schema( implementation = String.class, example = "default")) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROCESS_INSTANCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result updateProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskRelationJson", required = true) String taskRelationJson, @RequestParam(value = "taskDefinitionJson", required = true) String taskDefinitionJson, @PathVariable(value = "id") Integer id, @@ -218,16 +195,16 @@ public Result updateProcessInstance(@ApiIgnore @RequestAttribute(value = Constan * @param id process instance id * @return process instance detail */ - @ApiOperation(value = "queryProcessInstanceById", notes = "QUERY_PROCESS_INSTANCE_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "queryProcessInstanceById", description = "QUERY_PROCESS_INSTANCE_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_INSTANCE_BY_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProcessInstanceById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryProcessInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { Map result = processInstanceService.queryProcessInstanceById(loginUser, projectCode, id); return returnDataList(result); @@ -243,18 +220,18 @@ public Result queryProcessInstanceById(@ApiIgnore @RequestAttribute(value = Cons * @param endTime end time * @return list of process instance */ - @ApiOperation(value = "queryTopNLongestRunningProcessInstance", notes = "QUERY_TOPN_LONGEST_RUNNING_PROCESS_INSTANCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "size", value = "PROCESS_INSTANCE_SIZE", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "startTime", value = "PROCESS_INSTANCE_START_TIME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "endTime", value = "PROCESS_INSTANCE_END_TIME", required = true, dataTypeClass = String.class), + @Operation(summary = "queryTopNLongestRunningProcessInstance", description = "QUERY_TOPN_LONGEST_RUNNING_PROCESS_INSTANCE_NOTES") + @Parameters({ + @Parameter(name = "size", description = "PROCESS_INSTANCE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "startTime", description = "PROCESS_INSTANCE_START_TIME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "endTime", description = "PROCESS_INSTANCE_END_TIME", required = true, schema =@Schema( implementation = String.class)), }) @GetMapping(value = "/top-n") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_INSTANCE_BY_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTopNLongestRunningProcessInstance(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryTopNLongestRunningProcessInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("size") Integer size, @RequestParam(value = "startTime", required = true) String startTime, @RequestParam(value = "endTime", required = true) String endTime) { @@ -272,16 +249,16 @@ public Result queryTopNLongestRunningProcessInstance(@ApiIgnore * @param id process instance id * @return delete result code */ - @ApiOperation(value = "deleteProcessInstanceById", notes = "DELETE_PROCESS_INSTANCE_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteProcessInstanceById", description = "DELETE_PROCESS_INSTANCE_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROCESS_INSTANCE_BY_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteProcessInstanceById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteProcessInstanceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { Map result = processInstanceService.deleteProcessInstanceById(loginUser, projectCode, id); return returnDataList(result); @@ -295,16 +272,16 @@ public Result deleteProcessInstanceById(@ApiIgnore @RequestAttr * @param taskId task id * @return sub process instance detail */ - @ApiOperation(value = "querySubProcessInstanceByTaskCode", notes = "QUERY_SUBPROCESS_INSTANCE_BY_TASK_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "taskCode", value = "TASK_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "querySubProcessInstanceByTaskCode", description = "QUERY_SUBPROCESS_INSTANCE_BY_TASK_CODE_NOTES") + @Parameters({ + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/query-sub-by-parent") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_SUB_PROCESS_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result querySubProcessInstanceByTaskId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result querySubProcessInstanceByTaskId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("taskId") Integer taskId) { Map result = processInstanceService.querySubProcessInstanceByTaskId(loginUser, projectCode, taskId); @@ -319,16 +296,16 @@ public Result querySubProcessInstanceByTaskId(@ApiIgnore @RequestAttribute(value * @param subId sub process id * @return parent instance detail */ - @ApiOperation(value = "queryParentInstanceBySubId", notes = "QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "subId", value = "SUB_PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "queryParentInstanceBySubId", description = "QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES") + @Parameters({ + @Parameter(name = "subId", description = "SUB_PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/query-parent-by-sub") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PARENT_PROCESS_INSTANCE_DETAIL_INFO_BY_SUB_PROCESS_INSTANCE_ID_ERROR) @AccessLogAnnotation - public Result queryParentInstanceBySubId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryParentInstanceBySubId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("subId") Integer subId) { Map result = processInstanceService.queryParentInstanceBySubId(loginUser, projectCode, subId); return returnDataList(result); @@ -341,16 +318,16 @@ public Result queryParentInstanceBySubId(@ApiIgnore @RequestAttribute(value = Co * @param id process instance id * @return variables data */ - @ApiOperation(value = "viewVariables", notes = "QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "viewVariables", description = "QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES") + @Parameters({ + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/view-variables") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_INSTANCE_ALL_VARIABLES_ERROR) @AccessLogAnnotation - public Result viewVariables(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result viewVariables(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { Map result = processInstanceService.viewVariables(projectCode, id); return returnDataList(result); @@ -364,16 +341,16 @@ public Result viewVariables(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param id process instance id * @return gantt tree data */ - @ApiOperation(value = "vieGanttTree", notes = "VIEW_GANTT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "PROCESS_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "vieGanttTree", description = "VIEW_GANTT_NOTES") + @Parameters({ + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/view-gantt") @ResponseStatus(HttpStatus.OK) @ApiException(ENCAPSULATION_PROCESS_INSTANCE_GANTT_STRUCTURE_ERROR) @AccessLogAnnotation - public Result viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) throws Exception { Map result = processInstanceService.viewGantt(projectCode, id); return returnDataList(result); @@ -388,10 +365,10 @@ public Result viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_US * @param processInstanceIds process instance id * @return delete result code */ - @ApiOperation(value = "batchDeleteProcessInstanceByIds", notes = "BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "processInstanceIds", value = "PROCESS_INSTANCE_IDS", required = true, dataTypeClass = String.class), + @Operation(summary = "batchDeleteProcessInstanceByIds", description = "BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = int.class)), + @Parameter(name = "processInstanceIds", description = "PROCESS_INSTANCE_IDS", required = true, schema =@Schema( implementation = String.class)), }) @PostMapping(value = "/batch-delete") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java index 89d2766b7d34..31e8cc393f89 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java @@ -23,6 +23,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_PROCESS_RELATION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_PROCESS_RELATION_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProcessTaskRelationService; @@ -30,8 +35,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.HashMap; import java.util.Map; @@ -47,16 +50,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * process task relation controller */ -@Api(tags = "PROCESS_TASK_RELATION_TAG") +@Tag(name = "PROCESS_TASK_RELATION_TAG") @RestController @RequestMapping("projects/{projectCode}/process-task-relation") public class ProcessTaskRelationController extends BaseController { @@ -74,19 +71,19 @@ public class ProcessTaskRelationController extends BaseController { * @param postTaskCode postTaskCode * @return create result code */ - @ApiOperation(value = "save", notes = "CREATE_PROCESS_TASK_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "preTaskCode", value = "PRE_TASK_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "postTaskCode", value = "POST_TASK_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "save", description = "CREATE_PROCESS_TASK_RELATION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "preTaskCode", description = "PRE_TASK_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "postTaskCode", description = "POST_TASK_CODE", required = true, schema =@Schema( implementation = long.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_TASK_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createProcessTaskRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result createProcessTaskRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "processDefinitionCode", required = true) long processDefinitionCode, @RequestParam(name = "preTaskCode", required = true) long preTaskCode, @RequestParam(name = "postTaskCode", required = true) long postTaskCode) { @@ -111,18 +108,18 @@ public Result createProcessTaskRelation(@ApiIgnore @RequestAttribute(value = Con * @param taskCode the post task code * @return delete result code */ - @ApiOperation(value = "deleteRelation", notes = "DELETE_PROCESS_TASK_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskCode", value = "TASK_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "deleteRelation", description = "DELETE_PROCESS_TASK_RELATION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) }) @DeleteMapping(value = "/{taskCode}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteTaskProcessRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteTaskProcessRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "processDefinitionCode", required = true) long processDefinitionCode, @PathVariable("taskCode") long taskCode) { return returnDataList(processTaskRelationService.deleteTaskProcessRelation(loginUser, projectCode, @@ -138,18 +135,18 @@ public Result deleteTaskProcessRelation(@ApiIgnore @RequestAttribute(value = Con * @param taskCode the post task code * @return delete result code */ - @ApiOperation(value = "deleteUpstreamRelation", notes = "DELETE_UPSTREAM_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "preTaskCodes", value = "PRE_TASK_CODES", required = true, dataTypeClass = String.class, example = "1,2"), - @ApiImplicitParam(name = "taskCode", value = "TASK_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "deleteUpstreamRelation", description = "DELETE_UPSTREAM_RELATION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "preTaskCodes", description = "PRE_TASK_CODES", required = true, schema =@Schema( implementation = String.class, example = "1,2")), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) }) @DeleteMapping(value = "/{taskCode}/upstream") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteUpstreamRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteUpstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "preTaskCodes", required = true) String preTaskCodes, @PathVariable("taskCode") long taskCode) { return returnDataList( @@ -165,18 +162,18 @@ public Result deleteUpstreamRelation(@ApiIgnore @RequestAttribute(value = Consta * @param taskCode the pre task code * @return delete result code */ - @ApiOperation(value = "deleteDownstreamRelation", notes = "DELETE_DOWNSTREAM_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "postTaskCodes", value = "POST_TASK_CODES", required = true, dataTypeClass = String.class, example = "1,2"), - @ApiImplicitParam(name = "taskCode", value = "TASK_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "deleteDownstreamRelation", description = "DELETE_DOWNSTREAM_RELATION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "postTaskCodes", description = "POST_TASK_CODES", required = true, schema =@Schema( implementation = String.class, example = "1,2")), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) }) @DeleteMapping(value = "/{taskCode}/downstream") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteDownstreamRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteDownstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(name = "postTaskCodes", required = true) String postTaskCodes, @PathVariable("taskCode") long taskCode) { return returnDataList( @@ -191,17 +188,17 @@ public Result deleteDownstreamRelation(@ApiIgnore @RequestAttribute(value = Cons * @param taskCode current task code (post task code) * @return process task relation list */ - @ApiOperation(value = "queryUpstreamRelation", notes = "QUERY_UPSTREAM_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskCode", value = "TASK_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "queryUpstreamRelation", description = "QUERY_UPSTREAM_RELATION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) }) @GetMapping(value = "/{taskCode}/upstream") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_PROCESS_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUpstreamRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryUpstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("taskCode") long taskCode) { return returnDataList(processTaskRelationService.queryUpstreamRelation(loginUser, projectCode, taskCode)); } @@ -214,17 +211,17 @@ public Result queryUpstreamRelation(@ApiIgnore @RequestAttribute(value = Constan * @param taskCode pre task code * @return process task relation list */ - @ApiOperation(value = "queryDownstreamRelation", notes = "QUERY_DOWNSTREAM_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskCode", value = "TASK_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "queryDownstreamRelation", description = "QUERY_DOWNSTREAM_RELATION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) }) @GetMapping(value = "/{taskCode}/downstream") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_PROCESS_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryDownstreamRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryDownstreamRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("taskCode") long taskCode) { return returnDataList(processTaskRelationService.queryDownstreamRelation(loginUser, projectCode, taskCode)); } @@ -239,19 +236,19 @@ public Result queryDownstreamRelation(@ApiIgnore @RequestAttribute(value = Const * @param postTaskCode post task code * @return delete result code */ - @ApiOperation(value = "deleteEdge", notes = "DELETE_EDGE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "preTaskCode", value = "PRE_TASK_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "postTaskCode", value = "POST_TASK_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "deleteEdge", description = "DELETE_EDGE_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "preTaskCode", description = "PRE_TASK_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "postTaskCode", description = "POST_TASK_CODE", required = true, schema =@Schema( implementation = long.class)) }) @DeleteMapping(value = "/{processDefinitionCode}/{preTaskCode}/{postTaskCode}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_EDGE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteEdge(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteEdge(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable long processDefinitionCode, @PathVariable long preTaskCode, @PathVariable long postTaskCode) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java index 832646758180..512cdab05f7f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java @@ -21,6 +21,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_PROCESS_RELATION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_UPSTREAM_TASK_PROCESS_RELATION_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationCreateRequest; import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationDeleteRequest; @@ -32,8 +37,6 @@ import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.List; import org.springframework.beans.factory.annotation.Autowired; @@ -48,15 +51,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * process task relation controller */ -@Api(tags = "PROCESS_TASK_RELATION_TAG") +@Tag(name = "PROCESS_TASK_RELATION_TAG") @RestController @RequestMapping("v2/relations") public class ProcessTaskRelationV2Controller extends BaseController { @@ -71,12 +69,12 @@ public class ProcessTaskRelationV2Controller extends BaseController { * @param TaskRelationCreateRequest process task definition json contains the object you want to create * @return Result object created */ - @ApiOperation(value = "create", notes = "CREATE_PROCESS_TASK_RELATION_NOTES") + @Operation(summary = "create", description = "CREATE_PROCESS_TASK_RELATION_NOTES") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_TASK_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createTaskRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createTaskRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody TaskRelationCreateRequest TaskRelationCreateRequest) { ProcessTaskRelation processTaskRelation = processTaskRelationService.createProcessTaskRelationV2(loginUser, TaskRelationCreateRequest); @@ -90,15 +88,15 @@ public Result createTaskRelation(@ApiIgnore @RequestAttribu * @param codePair code pair you want to delete the task relation, use `upstream,downstream` as example, will delete exists relation upstream -> downstream, throw error if not exists * @return delete result code */ - @ApiOperation(value = "delete", notes = "DELETE_PROCESS_TASK_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code-pair", value = "TASK_DEFINITION_CODE", dataTypeClass = long.class, example = "123456,78901", required = true) + @Operation(summary = "delete", description = "DELETE_PROCESS_TASK_RELATION_NOTES") + @Parameters({ + @Parameter(name = "code-pair", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456,78901", required = true)) }) @DeleteMapping(value = "/{code-pair}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_PROCESS_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteTaskRelation(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteTaskRelation(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code-pair") String codePair) { TaskRelationDeleteRequest taskRelationDeleteRequest = new TaskRelationDeleteRequest(codePair); processTaskRelationService.deleteTaskProcessRelationV2(loginUser, taskRelationDeleteRequest.getUpstreamCode(), @@ -114,15 +112,15 @@ public Result deleteTaskRelation(@ApiIgnore @RequestAttribute(value = Constants. * @param taskRelationUpdateUpstreamRequest workflowUpdateRequest * @return ResourceResponse object updated */ - @ApiOperation(value = "update", notes = "UPDATE_PROCESS_TASK_RELATION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "DOWMSTREAM_TASK_DEFINITION_CODE", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "update", description = "UPDATE_PROCESS_TASK_RELATION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "DOWMSTREAM_TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_UPSTREAM_TASK_PROCESS_RELATION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result> updateUpstreamTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result> updateUpstreamTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody TaskRelationUpdateUpstreamRequest taskRelationUpdateUpstreamRequest) { List processTaskRelations = processTaskRelationService diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java index 14c2cde3ee61..9acdee155857 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java @@ -27,6 +27,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_UNAUTHORIZED_PROJECT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProjectService; @@ -35,8 +40,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -52,15 +55,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * project controller */ -@Api(tags = "PROJECT_TAG") +@Tag(name = "PROJECT_TAG") @RestController @RequestMapping("projects") public class ProjectController extends BaseController { @@ -78,16 +76,16 @@ public class ProjectController extends BaseController { * @param description description * @return returns an error if it exists */ - @ApiOperation(value = "create", notes = "CREATE_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectName", value = "PROJECT_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "PROJECT_DESC", dataTypeClass = String.class) + @Operation(summary = "create", description = "CREATE_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "projectName", description = "PROJECT_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "PROJECT_DESC", schema =@Schema( implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectName") String projectName, @RequestParam(value = "description", required = false) String description) { return projectService.createProject(loginUser, projectName, description); @@ -102,18 +100,18 @@ public Result createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param description description * @return update result code */ - @ApiOperation(value = "update", notes = "UPDATE_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROJECT_CODE", dataTypeClass = long.class, example = "123456"), - @ApiImplicitParam(name = "projectName", value = "PROJECT_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "PROJECT_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "userName", value = "USER_NAME", dataTypeClass = String.class), + @Operation(summary = "update", description = "UPDATE_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456")), + @Parameter(name = "projectName", description = "PROJECT_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "PROJECT_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "userName", description = "USER_NAME", schema =@Schema( implementation = String.class)), }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestParam("projectName") String projectName, @RequestParam(value = "description", required = false) String description, @@ -128,15 +126,15 @@ public Result updateProject(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param code project code * @return project detail information */ - @ApiOperation(value = "queryProjectByCode", notes = "QUERY_PROJECT_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROJECT_CODE", dataTypeClass = long.class, example = "123456") + @Operation(summary = "queryProjectByCode", description = "QUERY_PROJECT_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456")) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROJECT_DETAILS_BY_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProjectByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryProjectByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") long code) { return projectService.queryByCode(loginUser, code); } @@ -150,17 +148,17 @@ public Result queryProjectByCode(@ApiIgnore @RequestAttribute(value = Constants. * @param pageNo page number * @return project list which the login user have permission to see */ - @ApiOperation(value = "queryProjectListPaging", notes = "QUERY_PROJECT_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1") + @Operation(summary = "queryProjectListPaging", description = "QUERY_PROJECT_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProjectListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryProjectListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNo") Integer pageNo) { @@ -182,15 +180,15 @@ public Result queryProjectListPaging(@ApiIgnore @RequestAttribute(value = Consta * @param code project code * @return delete result code */ - @ApiOperation(value = "delete", notes = "DELETE_PROJECT_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROJECT_CODE", dataTypeClass = long.class, example = "123456") + @Operation(summary = "delete", description = "DELETE_PROJECT_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456")) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { return projectService.deleteProject(loginUser, code); } @@ -202,15 +200,15 @@ public Result deleteProject(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param userId user id * @return the projects which user have not permission to see */ - @ApiOperation(value = "queryUnauthorizedProject", notes = "QUERY_UNAUTHORIZED_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", dataTypeClass = int.class, example = "100") + @Operation(summary = "queryUnauthorizedProject", description = "QUERY_UNAUTHORIZED_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UNAUTHORIZED_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUnauthorizedProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUnauthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { return projectService.queryUnauthorizedProject(loginUser, userId); } @@ -222,15 +220,15 @@ public Result queryUnauthorizedProject(@ApiIgnore @RequestAttribute(value = Cons * @param userId user id * @return projects which the user have permission to see, Except for items created by this user */ - @ApiOperation(value = "queryAuthorizedProject", notes = "QUERY_AUTHORIZED_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", dataTypeClass = int.class, example = "100") + @Operation(summary = "queryAuthorizedProject", description = "QUERY_AUTHORIZED_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_PROJECT) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAuthorizedProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAuthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { return projectService.queryAuthorizedProject(loginUser, userId); } @@ -242,15 +240,15 @@ public Result queryAuthorizedProject(@ApiIgnore @RequestAttribute(value = Consta * @param projectCode project code * @return users who have permission for the specified project */ - @ApiOperation(value = "queryAuthorizedUser", notes = "QUERY_AUTHORIZED_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", dataTypeClass = long.class, example = "100") + @Operation(summary = "queryAuthorizedUser", description = "QUERY_AUTHORIZED_USER_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) }) @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_USER) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAuthorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAuthorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectCode") Long projectCode) { return projectService.queryAuthorizedUser(loginUser, projectCode); } @@ -261,12 +259,12 @@ public Result queryAuthorizedUser(@ApiIgnore @RequestAttribute(value = Constants * @param loginUser login user * @return projects which the user create and authorized */ - @ApiOperation(value = "queryProjectCreatedAndAuthorizedByUser", notes = "QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_NOTES") + @Operation(summary = "queryProjectCreatedAndAuthorizedByUser", description = "QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_NOTES") @GetMapping(value = "/created-and-authed") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryProjectCreatedAndAuthorizedByUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryProjectCreatedAndAuthorizedByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return projectService.queryProjectCreatedAndAuthorizedByUser(loginUser); } @@ -276,12 +274,12 @@ public Result queryProjectCreatedAndAuthorizedByUser(@ApiIgnore @RequestAttribut * @param loginUser login user * @return all project list */ - @ApiOperation(value = "queryAllProjectList", notes = "QUERY_ALL_PROJECT_LIST_NOTES") + @Operation(summary = "queryAllProjectList", description = "QUERY_ALL_PROJECT_LIST_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllProjectList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryAllProjectList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return projectService.queryAllProjectList(loginUser); } @@ -291,12 +289,12 @@ public Result queryAllProjectList(@ApiIgnore @RequestAttribute(value = Constants * @param loginUser login user * @return all project list */ - @ApiOperation(value = "queryAllProjectListForDependent", notes = "QUERY_ALL_PROJECT_LIST_FOR_DEPENDENT_NOTES") + @Operation(summary = "queryAllProjectListForDependent", description = "QUERY_ALL_PROJECT_LIST_FOR_DEPENDENT_NOTES") @GetMapping(value = "/list-dependent") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllProjectListForDependent(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryAllProjectListForDependent(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return projectService.queryAllProjectListForDependent(); } } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java index b167f9b47e96..610be8208c77 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java @@ -27,6 +27,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_UNAUTHORIZED_PROJECT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.project.ProjectCreateRequest; import org.apache.dolphinscheduler.api.dto.project.ProjectCreateResponse; @@ -45,8 +50,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; @@ -61,15 +64,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * project controller */ -@Api(tags = "PROJECT_TAG") +@Tag(name = "PROJECT_TAG") @RestController @RequestMapping("/v2/projects") public class ProjectV2Controller extends BaseController { @@ -84,12 +82,12 @@ public class ProjectV2Controller extends BaseController { * @param projectCreateRequest projectCreateRequest * @return ProjectResponse ProjectResponse */ - @ApiOperation(value = "create", notes = "CREATE_PROJECT_NOTES") + @Operation(summary = "create", description = "CREATE_PROJECT_NOTES") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectCreateResponse createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ProjectCreateResponse createProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody ProjectCreateRequest projectCreateRequest) { Result result = projectService.createProject(loginUser, projectCreateRequest.getProjectName(), projectCreateRequest.getDescription()); @@ -104,12 +102,12 @@ public ProjectCreateResponse createProject(@ApiIgnore @RequestAttribute(value = * @param projectUpdateReq projectUpdateRequest * @return result Result */ - @ApiOperation(value = "update", notes = "UPDATE_PROJECT_NOTES") + @Operation(summary = "update", description = "UPDATE_PROJECT_NOTES") @PutMapping(value = "/{code}", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectUpdateResponse updateProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ProjectUpdateResponse updateProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody ProjectUpdateRequest projectUpdateReq) { Result result = projectService.update(loginUser, code, projectUpdateReq.getProjectName(), @@ -124,15 +122,15 @@ public ProjectUpdateResponse updateProject(@ApiIgnore @RequestAttribute(value = * @param code project code * @return project detail information */ - @ApiOperation(value = "queryProjectByCode", notes = "QUERY_PROJECT_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROJECT_CODE", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "queryProjectByCode", description = "QUERY_PROJECT_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROJECT_DETAILS_BY_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectQueryResponse queryProjectByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ProjectQueryResponse queryProjectByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") long code) { Result result = projectService.queryByCode(loginUser, code); return new ProjectQueryResponse(result); @@ -145,17 +143,17 @@ public ProjectQueryResponse queryProjectByCode(@ApiIgnore @RequestAttribute(valu * @param projectQueryReq projectQueryReq * @return project list which the login user have permission to see */ - @ApiOperation(value = "queryProjectListPaging", notes = "QUERY_PROJECT_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class, example = "test"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1") + @Operation(summary = "queryProjectListPaging", description = "QUERY_PROJECT_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class, example = "test")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectListPagingResponse queryProjectListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ProjectListPagingResponse queryProjectListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, ProjectQueryRequest projectQueryReq) { Result result = checkPageParams(projectQueryReq.getPageNo(), projectQueryReq.getPageSize()); if (!result.checkResult()) { @@ -174,15 +172,15 @@ public ProjectListPagingResponse queryProjectListPaging(@ApiIgnore @RequestAttri * @param code project code * @return delete result code */ - @ApiOperation(value = "delete", notes = "DELETE_PROJECT_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "PROJECT_CODE", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "delete", description = "DELETE_PROJECT_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectDeleteResponse deleteProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ProjectDeleteResponse deleteProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { Result result = projectService.deleteProject(loginUser, code); return new ProjectDeleteResponse(result); @@ -195,15 +193,15 @@ public ProjectDeleteResponse deleteProject(@ApiIgnore @RequestAttribute(value = * @param userId user id * @return the projects which user have not permission to see */ - @ApiOperation(value = "queryUnauthorizedProject", notes = "QUERY_UNAUTHORIZED_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", dataTypeClass = int.class, example = "100", required = true) + @Operation(summary = "queryUnauthorizedProject", description = "QUERY_UNAUTHORIZED_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100", required = true)) }) @GetMapping(value = "/unauth-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UNAUTHORIZED_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectListResponse queryUnauthorizedProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ProjectListResponse queryUnauthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Result result = projectService.queryUnauthorizedProject(loginUser, userId); return new ProjectListResponse(result); @@ -216,15 +214,15 @@ public ProjectListResponse queryUnauthorizedProject(@ApiIgnore @RequestAttribute * @param userId user id * @return projects which the user have permission to see, Except for items created by this user */ - @ApiOperation(value = "queryAuthorizedProject", notes = "QUERY_AUTHORIZED_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", dataTypeClass = int.class, example = "100", required = true) + @Operation(summary = "queryAuthorizedProject", description = "QUERY_AUTHORIZED_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100", required = true)) }) @GetMapping(value = "/authed-project") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_PROJECT) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectListResponse queryAuthorizedProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ProjectListResponse queryAuthorizedProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Result result = projectService.queryAuthorizedProject(loginUser, userId); return new ProjectListResponse(result); @@ -237,15 +235,15 @@ public ProjectListResponse queryAuthorizedProject(@ApiIgnore @RequestAttribute(v * @param projectCode project code * @return users who have permission for the specified project */ - @ApiOperation(value = "queryAuthorizedUser", notes = "QUERY_AUTHORIZED_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", dataTypeClass = long.class, example = "100", required = true) + @Operation(summary = "queryAuthorizedUser", description = "QUERY_AUTHORIZED_USER_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100", required = true)) }) @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_USER) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public UserListResponse queryAuthorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public UserListResponse queryAuthorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectCode") Long projectCode) { Result result = projectService.queryAuthorizedUser(loginUser, projectCode); return new UserListResponse(result); @@ -257,15 +255,15 @@ public UserListResponse queryAuthorizedUser(@ApiIgnore @RequestAttribute(value = * @param loginUser login user * @return projects which the user create and authorized */ - @ApiOperation(value = "queryProjectCreatedAndAuthorizedByUser", notes = "QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "loginUser", value = "LOGIN_USER", dataTypeClass = Object.class, example = "\"{id:100}\"", required = true) + @Operation(summary = "queryProjectCreatedAndAuthorizedByUser", description = "QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "loginUser", description = "LOGIN_USER", schema =@Schema( implementation = Object.class, example = "\"{id:100}\"", required = true)) }) @GetMapping(value = "/created-and-authed") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectListResponse queryProjectCreatedAndAuthorizedByUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public ProjectListResponse queryProjectCreatedAndAuthorizedByUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = projectService.queryProjectCreatedAndAuthorizedByUser(loginUser); return new ProjectListResponse(result); } @@ -276,15 +274,15 @@ public ProjectListResponse queryProjectCreatedAndAuthorizedByUser(@ApiIgnore @Re * @param loginUser login user * @return all project list */ - @ApiOperation(value = "queryAllProjectList", notes = "QUERY_ALL_PROJECT_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "loginUser", value = "LOGIN_USER", dataTypeClass = Object.class, example = "\"{id:100}\"", required = true) + @Operation(summary = "queryAllProjectList", description = "QUERY_ALL_PROJECT_LIST_NOTES") + @Parameters({ + @Parameter(name = "loginUser", description = "LOGIN_USER", schema =@Schema( implementation = Object.class, example = "\"{id:100}\"", required = true)) }) @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectListResponse queryAllProjectList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public ProjectListResponse queryAllProjectList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = projectService.queryAllProjectList(loginUser); return new ProjectListResponse(result); } @@ -295,12 +293,12 @@ public ProjectListResponse queryAllProjectList(@ApiIgnore @RequestAttribute(valu * @param loginUser login user * @return all project list */ - @ApiOperation(value = "queryAllProjectListForDependent", notes = "QUERY_ALL_PROJECT_LIST_FOR_DEPENDENT_NOTES") + @Operation(summary = "queryAllProjectListForDependent", description = "QUERY_ALL_PROJECT_LIST_FOR_DEPENDENT_NOTES") @GetMapping(value = "/list-dependent") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ProjectListResponse queryAllProjectListForDependent(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public ProjectListResponse queryAllProjectListForDependent(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = projectService.queryAllProjectListForDependent(); return new ProjectListResponse(result); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java index d71760be1103..241ff219544e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java @@ -22,6 +22,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_QUEUE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_QUEUE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.QueueService; @@ -30,8 +35,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.GetMapping; @@ -44,15 +47,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * queue controller */ -@Api(tags = "QUEUE_TAG") +@Tag(name = "QUEUE_TAG") @RestController @RequestMapping("/queues") public class QueueController extends BaseController { @@ -66,12 +64,12 @@ public class QueueController extends BaseController { * @param loginUser login user * @return queue list */ - @ApiOperation(value = "queryList", notes = "QUERY_QUEUE_LIST_NOTES") + @Operation(summary = "queryList", description = "QUERY_QUEUE_LIST_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { return queueService.queryList(loginUser); } @@ -84,17 +82,17 @@ public Result queryList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_U * @param pageSize page size * @return queue list */ - @ApiOperation(value = "queryQueueListPaging", notes = "QUERY_QUEUE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryQueueListPaging", description = "QUERY_QUEUE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryQueueListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryQueueListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize) { @@ -116,16 +114,16 @@ public Result queryQueueListPaging(@ApiIgnore @RequestAttribute(value = Constant * @param queueName queue name * @return create result */ - @ApiOperation(value = "createQueue", notes = "CREATE_QUEUE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "queue", value = "YARN_QUEUE_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "queueName", value = "QUEUE_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "createQueue", description = "CREATE_QUEUE_NOTES") + @Parameters({ + @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_QUEUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queue") String queue, @RequestParam(value = "queueName") String queueName) { return queueService.createQueue(loginUser, queue, queueName); @@ -140,17 +138,17 @@ public Result createQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION * @param queueName queue name * @return update result code */ - @ApiOperation(value = "updateQueue", notes = "UPDATE_QUEUE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "QUEUE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "queue", value = "YARN_QUEUE_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "queueName", value = "QUEUE_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "updateQueue", description = "UPDATE_QUEUE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_QUEUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "queue") String queue, @RequestParam(value = "queueName") String queueName) { @@ -165,16 +163,16 @@ public Result updateQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION * @param queueName queue name * @return true if the queue name not exists, otherwise return false */ - @ApiOperation(value = "verifyQueue", notes = "VERIFY_QUEUE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "queue", value = "YARN_QUEUE_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "queueName", value = "QUEUE_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyQueue", description = "VERIFY_QUEUE_NOTES") + @Parameters({ + @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/verify") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_QUEUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queue") String queue, @RequestParam(value = "queueName") String queueName) { return queueService.verifyQueue(queue, queueName); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java index ec87292fbaf2..2d5cde2028c9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java @@ -22,6 +22,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_QUEUE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_QUEUE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.queue.QueueCreateRequest; import org.apache.dolphinscheduler.api.dto.queue.QueueCreateResponse; @@ -36,10 +41,8 @@ import org.apache.dolphinscheduler.api.service.QueueService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; -import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; - -import springfox.documentation.annotations.ApiIgnore; +import org.apache.dolphinscheduler.dao.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -53,15 +56,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * queue controller */ -@Api(tags = "QUEUE_TAG") +@Tag(name = "QUEUE_TAG") @RestController @RequestMapping("/v2/queues") public class QueueV2Controller extends BaseController { @@ -75,12 +73,12 @@ public class QueueV2Controller extends BaseController { * @param loginUser login user * @return queue list */ - @ApiOperation(value = "queryList", notes = "QUERY_QUEUE_LIST_NOTES") + @Operation(summary = "queryList", description = "QUERY_QUEUE_LIST_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public QueueListResponse queryList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public QueueListResponse queryList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Result result = queueService.queryList(loginUser); return new QueueListResponse(result); } @@ -92,17 +90,17 @@ public QueueListResponse queryList(@ApiIgnore @RequestAttribute(value = Constant * @param queueQueryRequest queueQueryRequest * @return queue list */ - @ApiOperation(value = "queryQueueListPaging", notes = "QUERY_QUEUE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryQueueListPaging", description = "QUERY_QUEUE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_QUEUE_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public QueueListPagingResponse queryQueueListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public QueueListPagingResponse queryQueueListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, QueueQueryRequest queueQueryRequest) { Result result = checkPageParams(queueQueryRequest.getPageNo(), queueQueryRequest.getPageSize()); if (!result.checkResult()) { @@ -122,12 +120,12 @@ public QueueListPagingResponse queryQueueListPaging(@ApiIgnore @RequestAttribute * @param queueCreateRequest queueCreateRequest * @return create result */ - @ApiOperation(value = "createQueue", notes = "CREATE_QUEUE_NOTES") + @Operation(summary = "createQueue", description = "CREATE_QUEUE_NOTES") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_QUEUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public QueueCreateResponse createQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public QueueCreateResponse createQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody QueueCreateRequest queueCreateRequest) { Result result = queueService.createQueue(loginUser, queueCreateRequest.getQueue(), queueCreateRequest.getQueueName()); @@ -142,17 +140,16 @@ public QueueCreateResponse createQueue(@ApiIgnore @RequestAttribute(value = Cons * @param queueUpdateRequest queueUpdateRequest * @return update result code */ - @ApiOperation(value = "updateQueue", notes = "UPDATE_QUEUE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "QUEUE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "updateQueue", description = "UPDATE_QUEUE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @PutMapping(value = "/{id}", consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_QUEUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public QueueUpdateResponse updateQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable(value = "id") int id, - @RequestBody QueueUpdateRequest queueUpdateRequest) { + public QueueUpdateResponse updateQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @PathVariable(value = "id") int id, @RequestBody QueueUpdateRequest queueUpdateRequest) { Result result = queueService.updateQueue(loginUser, id, queueUpdateRequest.getQueue(), queueUpdateRequest.getQueueName()); return new QueueUpdateResponse(result); @@ -165,12 +162,12 @@ public QueueUpdateResponse updateQueue(@ApiIgnore @RequestAttribute(value = Cons * @param queueVerifyRequest queueVerifyRequest * @return true if the queue name not exists, otherwise return false */ - @ApiOperation(value = "verifyQueue", notes = "VERIFY_QUEUE_NOTES") + @Operation(summary = "verifyQueue", description = "VERIFY_QUEUE_NOTES") @PostMapping(value = "/verify", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_QUEUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public QueueVerifyResponse verifyQueue(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public QueueVerifyResponse verifyQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody QueueVerifyRequest queueVerifyRequest) { Result result = queueService.verifyQueue(queueVerifyRequest.getQueue(), queueVerifyRequest.getQueueName()); return new QueueVerifyResponse(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java index 55ca04a1a0f7..aabfca069387 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java @@ -41,6 +41,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.VIEW_RESOURCE_FILE_ON_LINE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VIEW_UDF_FUNCTION_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ResourcesService; @@ -53,8 +58,6 @@ import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; import org.apache.dolphinscheduler.spi.enums.ResourceType; -import springfox.documentation.annotations.ApiIgnore; - import org.apache.commons.lang3.StringUtils; import java.util.Map; @@ -79,15 +82,10 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * resources controller */ -@Api(tags = "RESOURCES_TAG") +@Tag(name = "RESOURCES_TAG") @RestController @RequestMapping("resources") public class ResourcesController extends BaseController { @@ -108,18 +106,18 @@ public class ResourcesController extends BaseController { * @param currentDir current directory * @return create result code */ - @ApiOperation(value = "createDirectory", notes = "CREATE_RESOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class), - @ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENT_DIR", required = true, dataTypeClass = String.class) + @Operation(summary = "createDirectory", description = "CREATE_RESOURCE_NOTES") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), + @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/directory") @ApiException(CREATE_RESOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createDirectory(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createDirectory(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "name") String alias, @RequestParam(value = "description", required = false) String description, @@ -134,19 +132,19 @@ public Result createDirectory(@ApiIgnore @RequestAttribute(value = Const * * @return create result code */ - @ApiOperation(value = "createResource", notes = "CREATE_RESOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class), - @ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataTypeClass = MultipartFile.class), - @ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENT_DIR", required = true, dataTypeClass = String.class) + @Operation(summary = "createResource", description = "CREATE_RESOURCE_NOTES") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), + @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema =@Schema( implementation = MultipartFile.class)), + @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping() @ApiException(CREATE_RESOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "name") String alias, @RequestParam(value = "description", required = false) String description, @@ -168,18 +166,18 @@ public Result createResource(@ApiIgnore @RequestAttribute(value = Consta * @param file resource file * @return update result code */ - @ApiOperation(value = "updateResource", notes = "UPDATE_RESOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class), - @ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataTypeClass = MultipartFile.class) + @Operation(summary = "updateResource", description = "UPDATE_RESOURCE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), + @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema =@Schema( implementation = MultipartFile.class)) }) @PutMapping(value = "/{id}") @ApiException(UPDATE_RESOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int resourceId, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "name") String alias, @@ -196,15 +194,15 @@ public Result updateResource(@ApiIgnore @RequestAttribute(value = Consta * @param type resource type * @return resource list */ - @ApiOperation(value = "queryResourceList", notes = "QUERY_RESOURCE_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class) + @Operation(summary = "queryResourceList", description = "QUERY_RESOURCE_LIST_NOTES") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)) }) @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RESOURCES_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryResourceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryResourceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type) { Map result = resourceService.queryResourceList(loginUser, type); return returnDataList(result); @@ -220,19 +218,19 @@ public Result queryResourceList(@ApiIgnore @RequestAttribute(value = Con * @param pageSize page size * @return resource list page */ - @ApiOperation(value = "queryResourceListPaging", notes = "QUERY_RESOURCE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class), - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryResourceListPaging", description = "QUERY_RESOURCE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RESOURCES_LIST_PAGING) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryResourceListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryResourceListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "id") int id, @RequestParam("pageNo") Integer pageNo, @@ -255,15 +253,15 @@ public Result queryResourceListPaging(@ApiIgnore @RequestAttribute(value * @param resourceId resource id * @return delete result code */ - @ApiOperation(value = "deleteResource", notes = "DELETE_RESOURCE_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteResource", description = "DELETE_RESOURCE_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_RESOURCE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int resourceId) throws Exception { return resourceService.delete(loginUser, resourceId); } @@ -276,16 +274,16 @@ public Result deleteResource(@ApiIgnore @RequestAttribute(value = Consta * @param type resource type * @return true if the resource name not exists, otherwise return false */ - @ApiOperation(value = "verifyResourceName", notes = "VERIFY_RESOURCE_NAME_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class), - @ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyResourceName", description = "VERIFY_RESOURCE_NAME_NOTES") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), + @Parameter(name = "fullName", description = "RESOURCE_FULL_NAME", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_RESOURCE_BY_NAME_AND_TYPE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyResourceName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyResourceName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName") String fullName, @RequestParam(value = "type") ResourceType type) { return resourceService.verifyResourceName(fullName, type, loginUser); @@ -298,15 +296,15 @@ public Result verifyResourceName(@ApiIgnore @RequestAttribute(value = Co * @param type resource type * @return resource list */ - @ApiOperation(value = "queryResourceByProgramType", notes = "QUERY_RESOURCE_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class) + @Operation(summary = "queryResourceByProgramType", description = "QUERY_RESOURCE_LIST_NOTES") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)) }) @GetMapping(value = "/query-by-type") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_RESOURCES_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryResourceJarList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryResourceJarList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "programType", required = false) ProgramType programType) { return resourceService.queryResourceByProgramType(loginUser, type, programType); @@ -321,17 +319,17 @@ public Result queryResourceJarList(@ApiIgnore @RequestAttribute(value = * @param id resource id * @return true if the resource name not exists, otherwise return false */ - @ApiOperation(value = "queryResource", notes = "QUERY_BY_RESOURCE_NAME") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class), - @ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = false, dataTypeClass = int.class, example = "10") + @Operation(summary = "queryResource", description = "QUERY_BY_RESOURCE_NAME") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), + @Parameter(name = "fullName", description = "RESOURCE_FULL_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "id", description = "RESOURCE_ID", required = false, schema =@Schema( implementation = int.class, example = "10")) }) @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(RESOURCE_NOT_EXIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "fullName", required = false) String fullName, @PathVariable(value = "id", required = false) Integer id, @RequestParam(value = "type") ResourceType type) { @@ -348,16 +346,16 @@ public Result queryResource(@ApiIgnore @RequestAttribute(value = Constan * @param limit limit * @return resource content */ - @ApiOperation(value = "viewResource", notes = "VIEW_RESOURCE_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "viewResource", description = "VIEW_RESOURCE_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/view") @ApiException(VIEW_RESOURCE_FILE_ON_LINE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result viewResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result viewResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int resourceId, @RequestParam(value = "skipLineNum") int skipLineNum, @RequestParam(value = "limit") int limit) { @@ -369,20 +367,20 @@ public Result viewResource(@ApiIgnore @RequestAttribute(value = Constants.SESSIO * * @return create result code */ - @ApiOperation(value = "onlineCreateResource", notes = "ONLINE_CREATE_RESOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataTypeClass = ResourceType.class), - @ApiImplicitParam(name = "fileName", value = "RESOURCE_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "suffix", value = "SUFFIX", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataTypeClass = String.class) + @Operation(summary = "onlineCreateResource", description = "ONLINE_CREATE_RESOURCE_NOTES") + @Parameters({ + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), + @Parameter(name = "fileName", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "suffix", description = "SUFFIX", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "content", description = "CONTENT", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "currentDir", description = "RESOURCE_CURRENTDIR", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/online-create") @ApiException(CREATE_RESOURCE_FILE_ON_LINE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result onlineCreateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result onlineCreateResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") ResourceType type, @RequestParam(value = "fileName") String fileName, @RequestParam(value = "suffix") String fileSuffix, @@ -406,15 +404,15 @@ public Result onlineCreateResource(@ApiIgnore @RequestAttribute(value = Constant * @param content content * @return update result code */ - @ApiOperation(value = "updateResourceContent", notes = "UPDATE_RESOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataTypeClass = String.class) + @Operation(summary = "updateResourceContent", description = "UPDATE_RESOURCE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "content", description = "CONTENT", required = true, schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{id}/update-content") @ApiException(EDIT_RESOURCE_FILE_ON_LINE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateResourceContent(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateResourceContent(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int resourceId, @RequestParam(value = "content") String content) { if (StringUtils.isEmpty(content)) { @@ -431,15 +429,15 @@ public Result updateResourceContent(@ApiIgnore @RequestAttribute(value = Constan * @param resourceId resource id * @return resource content */ - @ApiOperation(value = "downloadResource", notes = "DOWNLOAD_RESOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "downloadResource", description = "DOWNLOAD_RESOURCE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/download") @ResponseBody @ApiException(DOWNLOAD_RESOURCE_FILE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public ResponseEntity downloadResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public ResponseEntity downloadResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int resourceId) throws Exception { Resource file = resourceService.downloadResource(loginUser, resourceId); if (file == null) { @@ -464,22 +462,22 @@ public ResponseEntity downloadResource(@ApiIgnore @RequestAttribute(value = Cons * @param resourceId resource id * @return create result code */ - @ApiOperation(value = "createUdfFunc", notes = "CREATE_UDF_FUNCTION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataTypeClass = UdfType.class), - @ApiImplicitParam(name = "funcName", value = "FUNC_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "className", value = "CLASS_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataTypeClass = String.class), - @ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "UDF_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "createUdfFunc", description = "CREATE_UDF_FUNCTION_NOTES") + @Parameters({ + @Parameter(name = "type", description = "UDF_TYPE", required = true, schema =@Schema( implementation = UdfType.class)), + @Parameter(name = "funcName", description = "FUNC_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "className", description = "CLASS_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "argTypes", description = "ARG_TYPES", schema =@Schema( implementation = String.class)), + @Parameter(name = "database", description = "DATABASE_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "UDF_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "resourceId", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @PostMapping(value = "/{resourceId}/udf-func") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_UDF_FUNCTION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "type") UdfType type, @RequestParam(value = "funcName") String funcName, @RequestParam(value = "className") String className, @@ -499,16 +497,16 @@ public Result createUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param id resource id * @return udf function detail */ - @ApiOperation(value = "viewUIUdfFunction", notes = "VIEW_UDF_FUNCTION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "viewUIUdfFunction", description = "VIEW_UDF_FUNCTION_NOTES") + @Parameters({ + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/udf-func") @ResponseStatus(HttpStatus.OK) @ApiException(VIEW_UDF_FUNCTION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result viewUIUdfFunction(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") int id) { return udfFuncService.queryUdfFuncDetail(loginUser, id); } @@ -527,22 +525,22 @@ public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.S * @param udfFuncId udf function id * @return update result code */ - @ApiOperation(value = "updateUdfFunc", notes = "UPDATE_UDF_FUNCTION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "UDF_ID", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataTypeClass = UdfType.class), - @ApiImplicitParam(name = "funcName", value = "FUNC_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "className", value = "CLASS_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataTypeClass = String.class), - @ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "UDF_DESC", dataTypeClass = String.class), - @ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "updateUdfFunc", description = "UPDATE_UDF_FUNCTION_NOTES") + @Parameters({ + @Parameter(name = "id", description = "UDF_ID", required = true, schema =@Schema( implementation = int.class)), + @Parameter(name = "type", description = "UDF_TYPE", required = true, schema =@Schema( implementation = UdfType.class)), + @Parameter(name = "funcName", description = "FUNC_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "className", description = "CLASS_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "argTypes", description = "ARG_TYPES", schema =@Schema( implementation = String.class)), + @Parameter(name = "database", description = "DATABASE_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "UDF_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "resourceId", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @PutMapping(value = "/{resourceId}/udf-func/{id}") @ApiException(UPDATE_UDF_FUNCTION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int udfFuncId, @RequestParam(value = "type") UdfType type, @RequestParam(value = "funcName") String funcName, @@ -564,17 +562,17 @@ public Result updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param pageSize page size * @return udf function list page */ - @ApiOperation(value = "queryUdfFuncListPaging", notes = "QUERY_UDF_FUNCTION_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryUdfFuncListPaging", description = "QUERY_UDF_FUNCTION_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping(value = "/udf-func") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_UDF_FUNCTION_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUdfFuncListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUdfFuncListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageSize") Integer pageSize) { @@ -592,15 +590,15 @@ public Result queryUdfFuncListPaging(@ApiIgnore @RequestAttribute(value * @param type resource type * @return resource list */ - @ApiOperation(value = "queryUdfFuncList", notes = "QUERY_UDF_FUNC_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataTypeClass = UdfType.class) + @Operation(summary = "queryUdfFuncList", description = "QUERY_UDF_FUNC_LIST_NOTES") + @Parameters({ + @Parameter(name = "type", description = "UDF_TYPE", required = true, schema =@Schema( implementation = UdfType.class)) }) @GetMapping(value = "/udf-func/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DATASOURCE_BY_TYPE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUdfFuncList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUdfFuncList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("type") UdfType type) { return udfFuncService.queryUdfFuncList(loginUser, type.ordinal()); } @@ -612,16 +610,16 @@ public Result queryUdfFuncList(@ApiIgnore @RequestAttribute(value = Cons * @param name name * @return true if the name can user, otherwise return false */ - @ApiOperation(value = "verifyUdfFuncName", notes = "VERIFY_UDF_FUNCTION_NAME_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "FUNC_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyUdfFuncName", description = "VERIFY_UDF_FUNCTION_NAME_NOTES") + @Parameters({ + @Parameter(name = "name", description = "FUNC_NAME", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/udf-func/verify-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_UDF_FUNCTION_NAME_ERROR) @AccessLogAnnotation - public Result verifyUdfFuncName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyUdfFuncName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "name") String name) { return udfFuncService.verifyUdfFuncByName(loginUser, name); } @@ -633,15 +631,15 @@ public Result verifyUdfFuncName(@ApiIgnore @RequestAttribute(value = Constants.S * @param udfFuncId udf function id * @return delete result code */ - @ApiOperation(value = "deleteUdfFunc", notes = "DELETE_UDF_FUNCTION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "UDF_FUNC_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteUdfFunc", description = "DELETE_UDF_FUNCTION_NOTES") + @Parameters({ + @Parameter(name = "id", description = "UDF_FUNC_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/udf-func/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_UDF_FUNCTION_ERROR) @AccessLogAnnotation - public Result deleteUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int udfFuncId) { return udfFuncService.delete(loginUser, udfFuncId); } @@ -653,15 +651,15 @@ public Result deleteUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param userId user id * @return authorized result */ - @ApiOperation(value = "authorizedFile", notes = "AUTHORIZED_FILE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "authorizedFile", description = "AUTHORIZED_FILE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-file") @ResponseStatus(HttpStatus.CREATED) @ApiException(AUTHORIZED_FILE_RESOURCE_ERROR) @AccessLogAnnotation - public Result authorizedFile(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result authorizedFile(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = resourceService.authorizedFile(loginUser, userId); return returnDataList(result); @@ -674,15 +672,15 @@ public Result authorizedFile(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param userId user id * @return unauthorized result code */ - @ApiOperation(value = "authorizeResourceTree", notes = "AUTHORIZE_RESOURCE_TREE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "authorizeResourceTree", description = "AUTHORIZE_RESOURCE_TREE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-resource-tree") @ResponseStatus(HttpStatus.CREATED) @ApiException(AUTHORIZE_RESOURCE_TREE) @AccessLogAnnotation - public Result authorizeResourceTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result authorizeResourceTree(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = resourceService.authorizeResourceTree(loginUser, userId); return returnDataList(result); @@ -695,15 +693,15 @@ public Result authorizeResourceTree(@ApiIgnore @RequestAttribute(value = Constan * @param userId user id * @return unauthorized result code */ - @ApiOperation(value = "unauthUDFFunc", notes = "UNAUTHORIZED_UDF_FUNC_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "unauthUDFFunc", description = "UNAUTHORIZED_UDF_FUNC_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-udf-func") @ResponseStatus(HttpStatus.CREATED) @ApiException(UNAUTHORIZED_UDF_FUNCTION_ERROR) @AccessLogAnnotation - public Result unauthUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result unauthUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = resourceService.unauthorizedUDFFunction(loginUser, userId); @@ -717,15 +715,15 @@ public Result unauthUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param userId user id * @return authorized result code */ - @ApiOperation(value = "authUDFFunc", notes = "AUTHORIZED_UDF_FUNC_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "authUDFFunc", description = "AUTHORIZED_UDF_FUNC_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-udf-func") @ResponseStatus(HttpStatus.CREATED) @ApiException(AUTHORIZED_UDF_FUNCTION_ERROR) @AccessLogAnnotation - public Result authorizedUDFFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result authorizedUDFFunction(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("userId") Integer userId) { Map result = resourceService.authorizedUDFFunction(loginUser, userId); return returnDataList(result); @@ -738,15 +736,15 @@ public Result authorizedUDFFunction(@ApiIgnore @RequestAttribute(value = Constan * @param id resource id * @return resource */ - @ApiOperation(value = "queryResourceById", notes = "QUERY_BY_RESOURCE_NAME") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataTypeClass = int.class, example = "10") + @Operation(summary = "queryResourceById", description = "QUERY_BY_RESOURCE_NAME") + @Parameters({ + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "10")) }) @GetMapping(value = "/{id}/query") @ResponseStatus(HttpStatus.OK) @ApiException(RESOURCE_NOT_EXIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryResourceById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryResourceById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id", required = true) Integer id) { return resourceService.queryResourceById(loginUser, id); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java index 75230a1379f9..056579612bc0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java @@ -23,6 +23,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_SCHEDULE_LIST_PAGING_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_SCHEDULE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.schedule.ScheduleCreateRequest; import org.apache.dolphinscheduler.api.dto.schedule.ScheduleFilterRequest; @@ -35,8 +40,6 @@ import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; @@ -50,15 +53,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * schedule controller */ -@Api(tags = "SCHEDULER_TAG") +@Tag(name = "SCHEDULER_TAG") @RestController @RequestMapping("/v2/schedules") public class ScheduleV2Controller extends BaseController { @@ -73,12 +71,12 @@ public class ScheduleV2Controller extends BaseController { * @param scheduleCreateRequest the new schedule object will be created * @return ResourceResponse object created */ - @ApiOperation(value = "create", notes = "CREATE_SCHEDULE_NOTES") + @Operation(summary = "create", description = "CREATE_SCHEDULE_NOTES") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_SCHEDULE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createSchedule(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody ScheduleCreateRequest scheduleCreateRequest) { Schedule schedule = schedulerService.createSchedulesV2(loginUser, scheduleCreateRequest); return Result.success(schedule); @@ -90,15 +88,15 @@ public Result createSchedule(@ApiIgnore @RequestAttribute(value = Cons * @param loginUser login user * @param id schedule object id */ - @ApiOperation(value = "delete", notes = "DELETE_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "delete", description = "DELETE_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "SCHEDULE_ID", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_SCHEDULE_BY_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteSchedule(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id) { schedulerService.deleteSchedulesById(loginUser, id); return Result.success(); @@ -112,12 +110,12 @@ public Result deleteSchedule(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param scheduleUpdateRequest the schedule object will be updated * @return result Result */ - @ApiOperation(value = "update", notes = "UPDATE_SCHEDULE_NOTES") + @Operation(summary = "update", description = "UPDATE_SCHEDULE_NOTES") @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_SCHEDULE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateSchedule(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id, @RequestBody ScheduleUpdateRequest scheduleUpdateRequest) { Schedule schedule = schedulerService.updateSchedulesV2(loginUser, id, scheduleUpdateRequest); @@ -131,12 +129,12 @@ public Result updateSchedule(@ApiIgnore @RequestAttribute(value = Cons * @param id schedule object id * @return result Result */ - @ApiOperation(value = "get", notes = "GET_SCHEDULE_BY_ID_NOTES") + @Operation(summary = "get", description = "GET_SCHEDULE_BY_ID_NOTES") @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_SCHEDULE_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result getSchedule(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result getSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id) { Schedule schedule = schedulerService.getSchedule(loginUser, id); return Result.success(schedule); @@ -149,12 +147,12 @@ public Result getSchedule(@ApiIgnore @RequestAttribute(value = Constan * @ * @return result Result */ - @ApiOperation(value = "get", notes = "QUERY_SCHEDULE_LIST_PAGING_NOTES") + @Operation(summary = "get", description = "QUERY_SCHEDULE_LIST_PAGING_NOTES") @PostMapping(value = "/filter", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_SCHEDULE_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result> filterSchedule(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result> filterSchedule(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody ScheduleFilterRequest scheduleFilterRequest) { PageInfo schedules = schedulerService.filterSchedules(loginUser, scheduleFilterRequest); return Result.success(schedules); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java index 45a815262d57..364b0e31ded7 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java @@ -27,6 +27,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_SCHEDULE_ERROR; import static org.apache.dolphinscheduler.common.Constants.SESSION_USER; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -39,8 +44,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -56,16 +59,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * scheduler controller */ -@Api(tags = "SCHEDULE_TAG") +@Tag(name = "SCHEDULE_TAG") @RestController @RequestMapping("/projects/{projectCode}/schedules") public class SchedulerController extends BaseController { @@ -92,23 +89,23 @@ public class SchedulerController extends BaseController { * @param workerGroup worker group * @return create result code */ - @ApiOperation(value = "createSchedule", notes = "CREATE_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "100"), - @ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataTypeClass = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','timezoneId':'America/Phoenix','crontab':'0 0 3/6 * * ? *'}"), - @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", dataTypeClass = WarningType.class), - @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", dataTypeClass = FailureStrategy.class), - @ApiImplicitParam(name = "workerGroupId", value = "WORKER_GROUP_ID", dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataTypeClass = long.class), - @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", dataTypeClass = Priority.class), + @Operation(summary = "createSchedule", description = "CREATE_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), + @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','timezoneId':'America/Phoenix','crontab':'0 0 3/6 * * ? *'}")), + @Parameter(name = "warningType", description = "WARNING_TYPE", schema =@Schema( implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema =@Schema( implementation = FailureStrategy.class)), + @Parameter(name = "workerGroupId", description = "WORKER_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class)), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema =@Schema( implementation = Priority.class)), }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_SCHEDULE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result createSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode") long processDefinitionCode, @RequestParam(value = "schedule") String schedule, @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, @@ -138,23 +135,23 @@ public Result createSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) * @param processInstancePriority process instance priority * @return update result code */ - @ApiOperation(value = "updateSchedule", notes = "UPDATE_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataTypeClass = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"), - @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", dataTypeClass = WarningType.class), - @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", dataTypeClass = FailureStrategy.class), - @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataTypeClass = String.class, example = "default"), - @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", dataTypeClass = Priority.class), - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataTypeClass = long.class), + @Operation(summary = "updateSchedule", description = "UPDATE_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), + @Parameter(name = "warningType", description = "WARNING_TYPE", schema =@Schema( implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema =@Schema( implementation = FailureStrategy.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema =@Schema( implementation = Priority.class)), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class)), }) @PutMapping("/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_SCHEDULE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result updateSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id, @RequestParam(value = "schedule") String schedule, @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, @@ -177,15 +174,15 @@ public Result updateSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) * @param id scheduler id * @return publish result code */ - @ApiOperation(value = "online", notes = "ONLINE_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "online", description = "ONLINE_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @PostMapping("/{id}/online") @ApiException(PUBLISH_SCHEDULE_ONLINE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result publishScheduleOnline(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result publishScheduleOnline(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { Map result = schedulerService.setScheduleState(loginUser, projectCode, id, ReleaseState.ONLINE); return returnDataList(result); @@ -199,15 +196,15 @@ public Result publishScheduleOnline(@ApiIgnore @RequestAttribute(value = SESSION * @param id schedule id * @return operation result code */ - @ApiOperation(value = "offline", notes = "OFFLINE_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "offline", description = "OFFLINE_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @PostMapping("/{id}/offline") @ApiException(OFFLINE_SCHEDULE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result offlineSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result offlineSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { Map result = @@ -226,18 +223,18 @@ public Result offlineSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) * @param searchVal search value * @return schedule list page */ - @ApiOperation(value = "queryScheduleListPaging", notes = "QUERY_SCHEDULE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processDefinitionId", value = "PROCESS_DEFINITION_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", dataTypeClass = int.class, example = "20") + @Operation(summary = "queryScheduleListPaging", description = "QUERY_SCHEDULE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "processDefinitionId", description = "PROCESS_DEFINITION_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ApiException(QUERY_SCHEDULE_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryScheduleListPaging(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryScheduleListPaging(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam long processDefinitionCode, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @@ -261,16 +258,16 @@ public Result queryScheduleListPaging(@ApiIgnore @RequestAttribute(value = SESSI * @param id scheule id * @return delete result code */ - @ApiOperation(value = "deleteScheduleById", notes = "DELETE_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "SCHEDULE_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteScheduleById", description = "DELETE_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_SCHEDULE_BY_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public Result deleteScheduleById(@RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable("id") Integer id) { schedulerService.deleteSchedulesById(loginUser, id); return new Result(Status.SUCCESS); @@ -283,12 +280,12 @@ public Result deleteScheduleById(@RequestAttribute(value = SESSION_USER) User lo * @param projectCode project code * @return schedule list */ - @ApiOperation(value = "queryScheduleList", notes = "QUERY_SCHEDULE_LIST_NOTES") + @Operation(summary = "queryScheduleList", description = "QUERY_SCHEDULE_LIST_NOTES") @PostMapping("/list") @ApiException(QUERY_SCHEDULE_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryScheduleList(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode) { + public Result queryScheduleList(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { Map result = schedulerService.queryScheduleList(loginUser, projectCode); return returnDataList(result); } @@ -300,15 +297,15 @@ public Result queryScheduleList(@ApiIgnore @RequestAttribute(value = SESSION_USE * @param schedule schedule expression * @return the next five fire time */ - @ApiOperation(value = "previewSchedule", notes = "PREVIEW_SCHEDULE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataTypeClass = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"), + @Operation(summary = "previewSchedule", description = "PREVIEW_SCHEDULE_NOTES") + @Parameters({ + @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), }) @PostMapping("/preview") @ResponseStatus(HttpStatus.CREATED) @ApiException(PREVIEW_SCHEDULE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result previewSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, + public Result previewSchedule(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, @RequestParam(value = "schedule") String schedule) { Map result = schedulerService.previewSchedule(loginUser, schedule); return returnDataList(result); @@ -328,23 +325,23 @@ public Result previewSchedule(@ApiIgnore @RequestAttribute(value = SESSION_USER) * @param processInstancePriority process instance priority * @return update result code */ - @ApiOperation(value = "updateScheduleByProcessDefinitionCode", notes = "UPDATE_SCHEDULE_BY_PROCESS_DEFINITION_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "12345678"), - @ApiImplicitParam(name = "schedule", value = "SCHEDULE", dataTypeClass = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}"), - @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE", dataTypeClass = WarningType.class), - @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID", dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "failureStrategy", value = "FAILURE_STRATEGY", dataTypeClass = FailureStrategy.class), - @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP", dataTypeClass = String.class, example = "default"), - @ApiImplicitParam(name = "processInstancePriority", value = "PROCESS_INSTANCE_PRIORITY", dataTypeClass = Priority.class), - @ApiImplicitParam(name = "environmentCode", value = "ENVIRONMENT_CODE", dataTypeClass = long.class), + @Operation(summary = "updateScheduleByProcessDefinitionCode", description = "UPDATE_SCHEDULE_BY_PROCESS_DEFINITION_CODE_NOTES") + @Parameters({ + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "12345678")), + @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), + @Parameter(name = "warningType", description = "WARNING_TYPE", schema =@Schema( implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema =@Schema( implementation = FailureStrategy.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema =@Schema( implementation = Priority.class)), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class)), }) @PutMapping("/update/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_SCHEDULE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateScheduleByProcessDefinitionCode(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result updateScheduleByProcessDefinitionCode(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long processDefinitionCode, @RequestParam(value = "schedule") String schedule, @RequestParam(value = "warningType", required = false, defaultValue = DEFAULT_WARNING_TYPE) WarningType warningType, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java index cf96586084e2..a77e4cb626e3 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java @@ -28,6 +28,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.SWITCH_TASK_DEFINITION_VERSION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_DEFINITION_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -39,8 +44,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import org.apache.commons.lang3.StringUtils; import java.util.Map; @@ -58,16 +61,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * task definition controller */ -@Api(tags = "TASK_DEFINITION_TAG") +@Tag(name = "TASK_DEFINITION_TAG") @RestController @RequestMapping("projects/{projectCode}/task-definition") public class TaskDefinitionController extends BaseController { @@ -83,17 +80,17 @@ public class TaskDefinitionController extends BaseController { * @param taskDefinitionJson task definition json * @return create result code */ - @ApiOperation(value = "save", notes = "CREATE_TASK_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskDefinitionJson", value = "TASK_DEFINITION_JSON", required = true, dataTypeClass = String.class) + @Operation(summary = "save", description = "CREATE_TASK_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result createTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "taskDefinitionJson", required = true) String taskDefinitionJson) { Map result = taskDefinitionService.createTaskDefinition(loginUser, projectCode, taskDefinitionJson); @@ -110,19 +107,19 @@ public Result createTaskDefinition(@ApiIgnore @RequestAttribute(value = Constant * @param upstreamCodes upstream task codes, sep comma * @return create result code */ - @ApiOperation(value = "saveSingle", notes = "CREATE_SINGLE_TASK_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskDefinitionJsonObj", value = "TASK_DEFINITION_JSON", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "upstreamCodes", value = "UPSTREAM_CODES", required = false, dataTypeClass = String.class) + @Operation(summary = "saveSingle", description = "CREATE_SINGLE_TASK_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema =@Schema( implementation = String.class)) }) @PostMapping("/save-single") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createTaskBindsWorkFlow(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result createTaskBindsWorkFlow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode", required = true) long processDefinitionCode, @RequestParam(value = "taskDefinitionJsonObj", required = true) String taskDefinitionJsonObj, @RequestParam(value = "upstreamCodes", required = false) String upstreamCodes) { @@ -140,18 +137,18 @@ public Result createTaskBindsWorkFlow(@ApiIgnore @RequestAttribute(value = Const * @param taskDefinitionJsonObj task definition json object * @return update result code */ - @ApiOperation(value = "update", notes = "UPDATE_TASK_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1"), - @ApiImplicitParam(name = "taskDefinitionJsonObj", value = "TASK_DEFINITION_JSON", required = true, dataTypeClass = String.class) + @Operation(summary = "update", description = "UPDATE_TASK_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), + @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result updateTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @RequestParam(value = "taskDefinitionJsonObj", required = true) String taskDefinitionJsonObj) { Map result = @@ -169,19 +166,19 @@ public Result updateTaskDefinition(@ApiIgnore @RequestAttribute(value = Constant * @param upstreamCodes upstream task codes, sep comma * @return update result code */ - @ApiOperation(value = "updateWithUpstream", notes = "UPDATE_TASK_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1"), - @ApiImplicitParam(name = "taskDefinitionJsonObj", value = "TASK_DEFINITION_JSON", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "upstreamCodes", value = "UPSTREAM_CODES", required = false, dataTypeClass = String.class) + @Operation(summary = "updateWithUpstream", description = "UPDATE_TASK_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), + @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{code}/with-upstream") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateTaskWithUpstream(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result updateTaskWithUpstream(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @RequestParam(value = "taskDefinitionJsonObj", required = true) String taskDefinitionJsonObj, @RequestParam(value = "upstreamCodes", required = false) String upstreamCodes) { @@ -201,18 +198,18 @@ public Result updateTaskWithUpstream(@ApiIgnore @RequestAttribute(value = Consta * @param code the task definition code * @return the task definition version list */ - @ApiOperation(value = "queryVersions", notes = "QUERY_TASK_DEFINITION_VERSIONS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10") + @Operation(summary = "queryVersions", description = "QUERY_TASK_DEFINITION_VERSIONS_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")) }) @GetMapping(value = "/{code}/versions") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_DEFINITION_VERSIONS_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTaskDefinitionVersions(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryTaskDefinitionVersions(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @RequestParam(value = "pageNo") int pageNo, @RequestParam(value = "pageSize") int pageSize) { @@ -232,17 +229,17 @@ public Result queryTaskDefinitionVersions(@ApiIgnore @RequestAttribute(value = C * @param version the version user want to switch * @return switch version result code */ - @ApiOperation(value = "switchVersion", notes = "SWITCH_TASK_DEFINITION_VERSION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1"), - @ApiImplicitParam(name = "version", value = "VERSION", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "switchVersion", description = "SWITCH_TASK_DEFINITION_VERSION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @GetMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(SWITCH_TASK_DEFINITION_VERSION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result switchTaskDefinitionVersion(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result switchTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @PathVariable(value = "version") int version) { Map result = taskDefinitionService.switchVersion(loginUser, projectCode, code, version); @@ -258,17 +255,17 @@ public Result switchTaskDefinitionVersion(@ApiIgnore @RequestAttribute(value = C * @param version the task definition version user want to delete * @return delete version result code */ - @ApiOperation(value = "deleteVersion", notes = "DELETE_TASK_DEFINITION_VERSION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1"), - @ApiImplicitParam(name = "version", value = "VERSION", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteVersion", description = "DELETE_TASK_DEFINITION_VERSION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_DEFINITION_VERSION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteTaskDefinitionVersion(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code, @PathVariable(value = "version") int version) { Map result = @@ -284,16 +281,16 @@ public Result deleteTaskDefinitionVersion(@ApiIgnore @RequestAttribute(value = C * @param code the task definition code * @return delete result code */ - @ApiOperation(value = "deleteTaskDefinition", notes = "DELETE_TASK_DEFINITION_BY_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1") + @Operation(summary = "deleteTaskDefinition", description = "DELETE_TASK_DEFINITION_BY_CODE_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TASK_DEFINE_BY_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteTaskDefinitionByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result deleteTaskDefinitionByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code) { taskDefinitionService.deleteTaskDefinitionByCode(loginUser, code); return new Result(Status.SUCCESS); @@ -307,16 +304,16 @@ public Result deleteTaskDefinitionByCode(@ApiIgnore @RequestAttribute(value = Co * @param code the task definition code * @return task definition detail */ - @ApiOperation(value = "queryTaskDefinitionByCode", notes = "QUERY_TASK_DEFINITION_DETAIL_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "1") + @Operation(summary = "queryTaskDefinitionByCode", description = "QUERY_TASK_DEFINITION_DETAIL_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTaskDefinitionDetail(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryTaskDefinitionDetail(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code") long code) { Map result = taskDefinitionService.queryTaskDefinitionDetail(loginUser, projectCode, code); return returnDataList(result); @@ -335,22 +332,22 @@ public Result queryTaskDefinitionDetail(@ApiIgnore @RequestAttribute(value = Con * @param pageSize page size * @return task definition page */ - @ApiOperation(value = "queryTaskDefinitionListPaging", notes = "QUERY_TASK_DEFINITION_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = false, dataTypeClass = long.class), - @ApiImplicitParam(name = "searchWorkflowName", value = "SEARCH_WORKFLOW_NAME", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "searchTaskName", value = "SEARCH_TASK_NAME", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "taskType", value = "TASK_TYPE", required = false, dataTypeClass = String.class, example = "SHELL"), - @ApiImplicitParam(name = "taskExecuteType", value = "TASK_EXECUTE_TYPE", required = false, dataTypeClass = TaskExecuteType.class, example = "STREAM"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10") + @Operation(summary = "queryTaskDefinitionListPaging", description = "QUERY_TASK_DEFINITION_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = false, schema =@Schema( implementation = long.class)), + @Parameter(name = "searchWorkflowName", description = "SEARCH_WORKFLOW_NAME", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "searchTaskName", description = "SEARCH_TASK_NAME", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "taskType", description = "TASK_TYPE", required = false, schema =@Schema( implementation = String.class, example = "SHELL")), + @Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema =@Schema( implementation = TaskExecuteType.class, example = "STREAM")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_DEFINITION_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTaskDefinitionListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryTaskDefinitionListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "searchWorkflowName", required = false) String searchWorkflowName, @RequestParam(value = "searchTaskName", required = false) String searchTaskName, @RequestParam(value = "taskType", required = false) String taskType, @@ -374,15 +371,15 @@ public Result queryTaskDefinitionListPaging(@ApiIgnore @RequestAttribute(value = * @param genNum gen num * @return task code list */ - @ApiOperation(value = "genTaskCodeList", notes = "GEN_TASK_CODE_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "genNum", value = "GEN_NUM", required = true, dataTypeClass = int.class, example = "1") + @Operation(summary = "genTaskCodeList", description = "GEN_TASK_CODE_LIST_NOTES") + @Parameters({ + @Parameter(name = "genNum", description = "GEN_NUM", required = true, schema =@Schema( implementation = int.class, example = "1")) }) @GetMapping(value = "/gen-task-codes") @ResponseStatus(HttpStatus.OK) @ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result genTaskCodeList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result genTaskCodeList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("genNum") Integer genNum) { Map result = taskDefinitionService.genTaskCodeList(genNum); return returnDataList(result); @@ -397,18 +394,18 @@ public Result genTaskCodeList(@ApiIgnore @RequestAttribute(value = Constants.SES * @param releaseState releaseState * @return update result code */ - @ApiOperation(value = "releaseTaskDefinition", notes = "RELEASE_TASK_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "123456789"), - @ApiImplicitParam(name = "releaseState", value = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, dataTypeClass = ReleaseState.class) + @Operation(summary = "releaseTaskDefinition", description = "RELEASE_TASK_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, schema =@Schema( implementation = ReleaseState.class)) }) @PostMapping(value = "/{code}/release") @ResponseStatus(HttpStatus.OK) @ApiException(RELEASE_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result releaseTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result releaseTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "code", required = true) long code, @RequestParam(value = "releaseState", required = true, defaultValue = "OFFLINE") ReleaseState releaseState) { Map result = diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java index dbd7ec15fe48..61c3168a6543 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java @@ -23,6 +23,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_DEFINITION_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.task.TaskCreateRequest; import org.apache.dolphinscheduler.api.dto.task.TaskFilterRequest; @@ -35,8 +40,6 @@ import org.apache.dolphinscheduler.dao.entity.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; @@ -50,15 +53,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * task definition controller */ -@Api(tags = "TASK_DEFINITION_TAG") +@Tag(name = "TASK_DEFINITION_TAG") @RestController @RequestMapping("v2/tasks") public class TaskDefinitionV2Controller extends BaseController { @@ -73,12 +71,12 @@ public class TaskDefinitionV2Controller extends BaseController { * @param taskCreateRequest task definition json * @return Result object created */ - @ApiOperation(value = "create", notes = "CREATE_TASK_DEFINITION_NOTES") + @Operation(summary = "create", description = "CREATE_TASK_DEFINITION_NOTES") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody TaskCreateRequest taskCreateRequest) { TaskDefinition taskDefinition = taskDefinitionService.createTaskDefinitionV2(loginUser, taskCreateRequest); return Result.success(taskDefinition); @@ -90,15 +88,15 @@ public Result createTaskDefinition(@ApiIgnore @RequestAttribute( * @param loginUser login user * @param code task definition code */ - @ApiOperation(value = "delete", notes = "DELETE_TASK_DEFINITION_VERSION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "delete", description = "DELETE_TASK_DEFINITION_VERSION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_SCHEDULE_BY_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { taskDefinitionService.deleteTaskDefinitionByCode(loginUser, code); return Result.success(); @@ -112,15 +110,15 @@ public Result deleteTaskDefinition(@ApiIgnore @RequestAttribute(value = Constant * @param taskUpdateRequest workflowUpdateRequest * @return ResourceResponse object updated */ - @ApiOperation(value = "update", notes = "UPDATE_TASK_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "update", description = "UPDATE_TASK_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody TaskUpdateRequest taskUpdateRequest) { TaskDefinition taskDefinition = @@ -135,15 +133,15 @@ public Result updateTaskDefinition(@ApiIgnore @RequestAttribute( * @param code task code of resource you want to update * @return ResourceResponse object get from condition */ - @ApiOperation(value = "get", notes = "GET_TASK_DEFINITION_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "TASK_DEFINITION_CODE", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "get", description = "GET_TASK_DEFINITION_NOTES") + @Parameters({ + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_DETAIL_OF_TASK_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result getTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result getTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { TaskDefinition taskDefinition = taskDefinitionService.getTaskDefinition(loginUser, code); return Result.success(taskDefinition); @@ -156,12 +154,12 @@ public Result getTaskDefinition(@ApiIgnore @RequestAttribute(val * @param taskFilterRequest workflowFilterRequest * @return PageResourceResponse from condition */ - @ApiOperation(value = "get", notes = "FILTER_TASK_DEFINITION_NOTES") + @Operation(summary = "get", description = "FILTER_TASK_DEFINITION_NOTES") @PostMapping(value = "/query", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result> filterTaskDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result> filterTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody TaskFilterRequest taskFilterRequest) { PageInfo taskDefinitions = taskDefinitionService.filterTaskDefinition(loginUser, taskFilterRequest); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java index 86f0b3317164..7603c46779df 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java @@ -24,6 +24,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.START_TASK_GROUP_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_GROUP_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TaskGroupQueueService; @@ -32,8 +37,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -46,15 +49,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * task group controller */ -@Api(tags = "task group") +@Tag(name = "task group") @RestController @RequestMapping("/task-group") public class TaskGroupController extends BaseController { @@ -72,19 +70,19 @@ public class TaskGroupController extends BaseController { * @param name project id * @return result and msg code */ - @ApiOperation(value = "create", notes = "CREATE_TASK_GROUP_NOTE") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", dataTypeClass = long.class), - @ApiImplicitParam(name = "description", value = "DESCRIPTION", dataTypeClass = String.class), - @ApiImplicitParam(name = "groupSize", value = "GROUPSIZE", dataTypeClass = int.class), + @Operation(summary = "create", description = "CREATE_TASK_GROUP_NOTE") + @Parameters({ + @Parameter(name = "name", description = "NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class)), + @Parameter(name = "description", description = "DESCRIPTION", schema =@Schema( implementation = String.class)), + @Parameter(name = "groupSize", description = "GROUPSIZE", schema =@Schema( implementation = int.class)), }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TASK_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("name") String name, @RequestParam(value = "projectCode", required = false, defaultValue = "0") Long projectcode, @RequestParam("description") String description, @@ -104,19 +102,19 @@ public Result createTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SES * @param name project id * @return result and msg code */ - @ApiOperation(value = "update", notes = "UPDATE_TASK_GROUP_NOTE") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "id", dataTypeClass = int.class), - @ApiImplicitParam(name = "name", value = "NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "description", value = "DESCRIPTION", dataTypeClass = String.class), - @ApiImplicitParam(name = "groupSize", value = "GROUPSIZE", dataTypeClass = int.class), + @Operation(summary = "update", description = "UPDATE_TASK_GROUP_NOTE") + @Parameters({ + @Parameter(name = "id", description = "id", schema =@Schema( implementation = int.class)), + @Parameter(name = "name", description = "NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "DESCRIPTION", schema =@Schema( implementation = String.class)), + @Parameter(name = "groupSize", description = "GROUPSIZE", schema =@Schema( implementation = int.class)), }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_TASK_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("id") Integer id, @RequestParam("name") String name, @RequestParam("description") String description, @@ -133,17 +131,17 @@ public Result updateTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SES * @param pageSize page size * @return queue list */ - @ApiOperation(value = "list-paging", notes = "QUERY_ALL_TASK_GROUP_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "name", value = "NAME", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "list-paging", description = "QUERY_ALL_TASK_GROUP_NOTES") + @Parameters({ + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "name", description = "NAME", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAllTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "status", required = false) Integer status, @RequestParam("pageNo") Integer pageNo, @@ -161,17 +159,17 @@ public Result queryAllTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.S * @param pageSize page size * @return queue list */ - @ApiOperation(value = "queryTaskGroupByStatus", notes = "QUERY_TASK_GROUP_LIST_BY_STATUS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20"), - @ApiImplicitParam(name = "status", value = "status", required = true, dataTypeClass = int.class) + @Operation(summary = "queryTaskGroupByStatus", description = "QUERY_TASK_GROUP_LIST_BY_STATUS_NOTES") + @Parameters({ + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), + @Parameter(name = "status", description = "status", required = true, schema =@Schema( implementation = int.class)) }) @GetMapping(value = "/query-list-by-status") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTaskGroupByStatus(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryTaskGroupByStatus(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "status", required = false) Integer status, @RequestParam("pageSize") Integer pageSize) { @@ -188,17 +186,17 @@ public Result queryTaskGroupByStatus(@ApiIgnore @RequestAttribute(value = Consta * @param pageSize page size * @return queue list */ - @ApiOperation(value = "queryTaskGroupByName", notes = "QUERY_TASK_GROUP_LIST_BY_PROJECT_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20"), - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = String.class) + @Operation(summary = "queryTaskGroupByName", description = "QUERY_TASK_GROUP_LIST_BY_PROJECT_ID_NOTES") + @Parameters({ + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/query-list-by-projectCode") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTaskGroupByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryTaskGroupByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam(value = "projectCode", required = false) Long projectCode, @RequestParam("pageSize") Integer pageSize) { @@ -214,15 +212,15 @@ public Result queryTaskGroupByCode(@ApiIgnore @RequestAttribute(value = Constant * @param id id * @return result */ - @ApiOperation(value = "closeTaskGroup", notes = "CLOSE_TASK_GROUP_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ID", required = true, dataTypeClass = int.class) + @Operation(summary = "closeTaskGroup", description = "CLOSE_TASK_GROUP_NOTES") + @Parameters({ + @Parameter(name = "id", description = "ID", required = true, schema =@Schema( implementation = int.class)) }) @PostMapping(value = "/close-task-group") @ResponseStatus(HttpStatus.CREATED) @ApiException(CLOSE_TASK_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result closeTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result closeTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id", required = false) Integer id) { Map result = taskGroupService.closeTaskGroup(loginUser, id); @@ -236,15 +234,15 @@ public Result closeTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param id id * @return result */ - @ApiOperation(value = "startTaskGroup", notes = "START_TASK_GROUP_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ID", required = true, dataTypeClass = int.class) + @Operation(summary = "startTaskGroup", description = "START_TASK_GROUP_NOTES") + @Parameters({ + @Parameter(name = "id", description = "ID", required = true, schema =@Schema( implementation = int.class)) }) @PostMapping(value = "/start-task-group") @ResponseStatus(HttpStatus.CREATED) @ApiException(START_TASK_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result startTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result startTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id", required = false) Integer id) { Map result = taskGroupService.startTaskGroup(loginUser, id); return returnDataList(result); @@ -257,15 +255,15 @@ public Result startTaskGroup(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param queueId task group queue id * @return result */ - @ApiOperation(value = "forceStart", notes = "WAKE_TASK_COMPULSIVELY_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "queueId", value = "TASK_GROUP_QUEUEID", required = true, dataTypeClass = int.class) + @Operation(summary = "forceStart", description = "WAKE_TASK_COMPULSIVELY_NOTES") + @Parameters({ + @Parameter(name = "queueId", description = "TASK_GROUP_QUEUEID", required = true, schema =@Schema( implementation = int.class)) }) @PostMapping(value = "/forceStart") @ResponseStatus(HttpStatus.CREATED) @ApiException(START_TASK_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result forceStart(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result forceStart(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queueId") Integer queueId) { Map result = taskGroupService.forceStartTask(loginUser, queueId); return returnDataList(result); @@ -278,16 +276,16 @@ public Result forceStart(@ApiIgnore @RequestAttribute(value = Constants.SESSION_ * @param queueId task group queue id * @return result */ - @ApiOperation(value = "modifyPriority", notes = "WAKE_TASK_COMPULSIVELY_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "queueId", value = "TASK_GROUP_QUEUEID", required = true, dataTypeClass = int.class), - @ApiImplicitParam(name = "priority", value = "TASK_GROUP_QUEUE_PRIORITY", required = true, dataTypeClass = int.class) + @Operation(summary = "modifyPriority", description = "WAKE_TASK_COMPULSIVELY_NOTES") + @Parameters({ + @Parameter(name = "queueId", description = "TASK_GROUP_QUEUEID", required = true, schema =@Schema( implementation = int.class)), + @Parameter(name = "priority", description = "TASK_GROUP_QUEUE_PRIORITY", required = true, schema =@Schema( implementation = int.class)) }) @PostMapping(value = "/modifyPriority") @ResponseStatus(HttpStatus.CREATED) @ApiException(START_TASK_GROUP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result modifyPriority(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result modifyPriority(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "queueId") Integer queueId, @RequestParam(value = "priority") Integer priority) { Map result = taskGroupService.modifyPriority(loginUser, queueId, priority); @@ -309,20 +307,20 @@ public Result modifyPriority(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param pageSize page size * @return queue list */ - @ApiOperation(value = "queryTasksByGroupId", notes = "QUERY_ALL_TASKS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "groupId", value = "GROUP_ID", required = false, dataTypeClass = int.class, example = "1", defaultValue = "-1"), - @ApiImplicitParam(name = "taskInstanceName", value = "TASK_INSTANCE_NAME", required = false, dataTypeClass = String.class, example = "taskName"), - @ApiImplicitParam(name = "processInstanceName", value = "PROCESS_INSTANCE_NAME", required = false, dataTypeClass = String.class, example = "processName"), - @ApiImplicitParam(name = "status", value = "STATUS", required = false, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryTasksByGroupId", description = "QUERY_ALL_TASKS_NOTES") + @Parameters({ + @Parameter(name = "groupId", description = "GROUP_ID", required = false, schema =@Schema( implementation = int.class, example = "1", defaultValue = "-1")), + @Parameter(name = "taskInstanceName", description = "TASK_INSTANCE_NAME", required = false, schema =@Schema( implementation = String.class, example = "taskName")), + @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", required = false, schema =@Schema( implementation = String.class, example = "processName")), + @Parameter(name = "status", description = "STATUS", required = false, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping(value = "/query-list-by-group-id") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_GROUP_QUEUE_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTasksByGroupId(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryTasksByGroupId(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "groupId", required = false, defaultValue = "-1") Integer groupId, @RequestParam(value = "taskInstanceName", required = false) String taskName, @RequestParam(value = "processInstanceName", required = false) String processName, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java index 78ab34762dc5..698d47422814 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java @@ -22,6 +22,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.TASK_SAVEPOINT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.TASK_STOP_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TaskInstanceService; @@ -32,8 +37,6 @@ import org.apache.dolphinscheduler.plugin.task.api.enums.TaskExecutionStatus; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -47,16 +50,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * task instance controller */ -@Api(tags = "TASK_INSTANCE_TAG") +@Tag(name = "TASK_INSTANCE_TAG") @RestController @RequestMapping("/projects/{projectCode}/task-instances") public class TaskInstanceController extends BaseController { @@ -81,27 +78,27 @@ public class TaskInstanceController extends BaseController { * @param taskExecuteType task execute type * @return task list page */ - @ApiOperation(value = "queryTaskListPaging", notes = "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "processInstanceId", value = "PROCESS_INSTANCE_ID", required = false, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "processInstanceName", value = "PROCESS_INSTANCE_NAME", required = false, dataTypeClass = String.class), - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "taskName", value = "TASK_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "executorName", value = "EXECUTOR_NAME", dataTypeClass = String.class), - @ApiImplicitParam(name = "stateType", value = "EXECUTION_STATUS", dataTypeClass = TaskExecutionStatus.class), - @ApiImplicitParam(name = "host", value = "HOST", dataTypeClass = String.class), - @ApiImplicitParam(name = "startDate", value = "START_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "endDate", value = "END_DATE", dataTypeClass = String.class), - @ApiImplicitParam(name = "taskExecuteType", value = "TASK_EXECUTE_TYPE", required = false, dataTypeClass = TaskExecuteType.class, example = "STREAM"), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20"), + @Operation(summary = "queryTaskListPaging", description = "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = false, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "taskName", description = "TASK_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema =@Schema( implementation = TaskExecutionStatus.class)), + @Parameter(name = "host", description = "HOST", schema =@Schema( implementation = String.class)), + @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), + @Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema =@Schema( implementation = TaskExecuteType.class, example = "STREAM")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TASK_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTaskListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result queryTaskListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processInstanceId", required = false, defaultValue = "0") Integer processInstanceId, @RequestParam(value = "processInstanceName", required = false) String processInstanceName, @RequestParam(value = "processDefinitionName", required = false) String processDefinitionName, @@ -135,16 +132,16 @@ public Result queryTaskListPaging(@ApiIgnore @RequestAttribute(value = Constants * @param id task instance id * @return the result code and msg */ - @ApiOperation(value = "force-success", notes = "FORCE_TASK_SUCCESS") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "TASK_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "12") + @Operation(summary = "force-success", description = "FORCE_TASK_SUCCESS") + @Parameters({ + @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "12")) }) @PostMapping(value = "/{id}/force-success") @ResponseStatus(HttpStatus.OK) @ApiException(FORCE_TASK_SUCCESS_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result forceTaskSuccess(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result forceTaskSuccess(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { Map result = taskInstanceService.forceTaskSuccess(loginUser, projectCode, id); return returnDataList(result); @@ -158,16 +155,16 @@ public Result forceTaskSuccess(@ApiIgnore @RequestAttribute(value = Cons * @param id task instance id * @return the result code and msg */ - @ApiOperation(value = "savepoint", notes = "TASK_SAVEPOINT") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "TASK_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "12") + @Operation(summary = "savepoint", description = "TASK_SAVEPOINT") + @Parameters({ + @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "12")) }) @PostMapping(value = "/{id}/savepoint") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_SAVEPOINT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result taskSavePoint(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result taskSavePoint(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { return taskInstanceService.taskSavePoint(loginUser, projectCode, id); } @@ -180,16 +177,16 @@ public Result taskSavePoint(@ApiIgnore @RequestAttribute(value = Constan * @param id task instance id * @return the result code and msg */ - @ApiOperation(value = "stop", notes = "TASK_STOP") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "TASK_INSTANCE_ID", required = true, dataTypeClass = int.class, example = "12") + @Operation(summary = "stop", description = "TASK_STOP") + @Parameters({ + @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "12")) }) @PostMapping(value = "/{id}/stop") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_STOP_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result stopTask(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result stopTask(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "id") Integer id) { return taskInstanceService.stopTask(loginUser, projectCode, id); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java index c0724b6d3471..2a087efd76d8 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java @@ -24,6 +24,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TENANT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_OS_TENANT_CODE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TenantService; @@ -32,8 +37,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -49,15 +52,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * tenant controller */ -@Api(tags = "TENANT_TAG") +@Tag(name = "TENANT_TAG") @RestController @RequestMapping("/tenants") public class TenantController extends BaseController { @@ -74,17 +72,17 @@ public class TenantController extends BaseController { * @param description description * @return create result code */ - @ApiOperation(value = "createTenant", notes = "CREATE_TENANT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "tenantCode", value = "TENANT_CODE", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "queueId", value = "QUEUE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "description", value = "TENANT_DESC", dataTypeClass = String.class) + @Operation(summary = "createTenant", description = "CREATE_TENANT_NOTES") + @Parameters({ + @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "queueId", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "description", description = "TENANT_DESC", schema =@Schema( implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_TENANT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createTenant(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createTenant(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "tenantCode") String tenantCode, @RequestParam(value = "queueId") int queueId, @RequestParam(value = "description", required = false) String description) throws Exception { @@ -102,17 +100,17 @@ public Result createTenant(@ApiIgnore @RequestAttribute(value = Constants.SESSIO * @param pageSize page size * @return tenant list page */ - @ApiOperation(value = "queryTenantlistPaging", notes = "QUERY_TENANT_LIST_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class), - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20") + @Operation(summary = "queryTenantlistPaging", description = "QUERY_TENANT_LIST_PAGING_NOTES") + @Parameters({ + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TENANT_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTenantlistPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryTenantlistPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) { @@ -132,12 +130,12 @@ public Result queryTenantlistPaging(@ApiIgnore @RequestAttribute(value = Constan * @param loginUser login user * @return tenant list */ - @ApiOperation(value = "queryTenantlist", notes = "QUERY_TENANT_LIST_NOTES") + @Operation(summary = "queryTenantlist", description = "QUERY_TENANT_LIST_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_TENANT_LIST_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryTenantlist(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryTenantlist(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = tenantService.queryTenantList(loginUser); return returnDataList(result); } @@ -152,18 +150,18 @@ public Result queryTenantlist(@ApiIgnore @RequestAttribute(value = Constants.SES * @param description description * @return update result code */ - @ApiOperation(value = "updateTenant", notes = "UPDATE_TENANT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "TENANT_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "tenantCode", value = "TENANT_CODE", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "queueId", value = "QUEUE_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "description", value = "TENANT_DESC", dataTypeClass = String.class) + @Operation(summary = "updateTenant", description = "UPDATE_TENANT_NOTES") + @Parameters({ + @Parameter(name = "id", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "queueId", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "description", description = "TENANT_DESC", schema =@Schema( implementation = String.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_TENANT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateTenant(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateTenant(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id, @RequestParam(value = "tenantCode") String tenantCode, @RequestParam(value = "queueId") int queueId, @@ -180,15 +178,15 @@ public Result updateTenant(@ApiIgnore @RequestAttribute(value = Constants.SESSIO * @param id tenant id * @return delete result code */ - @ApiOperation(value = "deleteTenantById", notes = "DELETE_TENANT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "TENANT_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "deleteTenantById", description = "DELETE_TENANT_NOTES") + @Parameters({ + @Parameter(name = "id", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_TENANT_BY_ID_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteTenantById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteTenantById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable(value = "id") int id) throws Exception { Map result = tenantService.deleteTenantById(loginUser, id); return returnDataList(result); @@ -201,15 +199,15 @@ public Result deleteTenantById(@ApiIgnore @RequestAttribute(value = Constants.SE * @param tenantCode tenant code * @return true if tenant code can use, otherwise return false */ - @ApiOperation(value = "verifyTenantCode", notes = "VERIFY_TENANT_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "tenantCode", value = "TENANT_CODE", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyTenantCode", description = "VERIFY_TENANT_CODE_NOTES") + @Parameters({ + @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/verify-code") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_OS_TENANT_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyTenantCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyTenantCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "tenantCode") String tenantCode) { return tenantService.verifyTenantCode(tenantCode); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java index ca960b6779a2..24e6731de9d2 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java @@ -19,6 +19,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PLUGINS_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.UiPluginService; @@ -27,8 +32,6 @@ import org.apache.dolphinscheduler.common.enums.PluginType; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -41,18 +44,13 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * ui plugin controller * Some plugins (such as alert plugin) need to provide UI interfaces to users. * We use from-creat to dynamically generate UI interfaces. Related parameters are mainly provided by pluginParams. * From-create can generate dynamic ui based on this parameter. */ -@Api(tags = "UI_PLUGINS_TAG") +@Tag(name = "UI_PLUGINS_TAG") @RestController @RequestMapping("ui-plugins") public class UiPluginController extends BaseController { @@ -60,30 +58,30 @@ public class UiPluginController extends BaseController { @Autowired UiPluginService uiPluginService; - @ApiOperation(value = "queryUiPluginsByType", notes = "QUERY_UI_PLUGINS_BY_TYPE") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pluginType", value = "pluginType", required = true, dataTypeClass = PluginType.class), + @Operation(summary = "queryUiPluginsByType", description = "QUERY_UI_PLUGINS_BY_TYPE") + @Parameters({ + @Parameter(name = "pluginType", description = "pluginType", required = true, schema =@Schema( implementation = PluginType.class)), }) @GetMapping(value = "/query-by-type") @ResponseStatus(HttpStatus.CREATED) @ApiException(QUERY_PLUGINS_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUiPluginsByType(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUiPluginsByType(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "pluginType") PluginType pluginType) { Map result = uiPluginService.queryUiPluginsByType(pluginType); return returnDataList(result); } - @ApiOperation(value = "queryUiPluginDetailById", notes = "QUERY_UI_PLUGIN_DETAIL_BY_ID") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "PLUGIN_ID", required = true, dataTypeClass = int.class, example = "100"), + @Operation(summary = "queryUiPluginDetailById", description = "QUERY_UI_PLUGIN_DETAIL_BY_ID") + @Parameters({ + @Parameter(name = "id", description = "PLUGIN_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), }) @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @ApiException(QUERY_PLUGINS_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUiPluginDetailById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUiPluginDetailById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer pluginId) { Map result = uiPluginService.queryUiPluginDetailById(pluginId); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java index 44a03483d5f0..0200993c989d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java @@ -33,6 +33,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.USER_LIST_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_USERNAME_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -42,8 +47,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -61,15 +64,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * users controller */ -@Api(tags = "USERS_TAG") +@Tag(name = "USERS_TAG") @RestController @RequestMapping("/users") public class UsersController extends BaseController { @@ -91,21 +89,21 @@ public class UsersController extends BaseController { * @param queue queue * @return create result code */ - @ApiOperation(value = "createUser", notes = "CREATE_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userName", value = "USER_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "userPassword", value = "USER_PASSWORD", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "tenantId", value = "TENANT_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "queue", value = "QUEUE", dataTypeClass = String.class), - @ApiImplicitParam(name = "email", value = "EMAIL", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "phone", value = "PHONE", dataTypeClass = String.class), - @ApiImplicitParam(name = "state", value = "STATE", dataTypeClass = int.class, example = "1") + @Operation(summary = "createUser", description = "CREATE_USER_NOTES") + @Parameters({ + @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "tenantId", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "queue", description = "QUEUE", schema =@Schema( implementation = String.class)), + @Parameter(name = "email", description = "EMAIL", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "phone", description = "PHONE", schema =@Schema( implementation = String.class)), + @Parameter(name = "state", description = "STATE", schema =@Schema( implementation = int.class, example = "1")) }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_USER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "userPassword"}) - public Result createUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @RequestParam(value = "tenantId") int tenantId, @@ -127,17 +125,17 @@ public Result createUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_ * @param pageSize page size * @return user list page */ - @ApiOperation(value = "queryUserList", notes = "QUERY_USER_LIST_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "10"), - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class) + @Operation(summary = "queryUserList", description = "QUERY_USER_LIST_NOTES") + @Parameters({ + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_USER_LIST_PAGING_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryUserList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryUserList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam(value = "searchVal", required = false) String searchVal) { @@ -164,22 +162,22 @@ public Result queryUserList(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param queue queue * @return update result code */ - @ApiOperation(value = "updateUser", notes = "UPDATE_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "userName", value = "USER_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "userPassword", value = "USER_PASSWORD", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "tenantId", value = "TENANT_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "queue", value = "QUEUE", dataTypeClass = String.class), - @ApiImplicitParam(name = "email", value = "EMAIL", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "phone", value = "PHONE", dataTypeClass = String.class), - @ApiImplicitParam(name = "state", value = "STATE", dataTypeClass = int.class, example = "1") + @Operation(summary = "updateUser", description = "UPDATE_USER_NOTES") + @Parameters({ + @Parameter(name = "id", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "tenantId", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "queue", description = "QUEUE", schema =@Schema( implementation = String.class)), + @Parameter(name = "email", description = "EMAIL", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "phone", description = "PHONE", schema =@Schema( implementation = String.class)), + @Parameter(name = "state", description = "STATE", schema =@Schema( implementation = int.class, example = "1")) }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_USER_ERROR) @AccessLogAnnotation(ignoreRequestArgs = {"loginUser", "userPassword"}) - public Result updateUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id, @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @@ -201,15 +199,15 @@ public Result updateUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_ * @param id user id * @return delete result code */ - @ApiOperation(value = "delUserById", notes = "DELETE_USER_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100") + @Operation(summary = "delUserById", description = "DELETE_USER_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_USER_BY_ID_ERROR) @AccessLogAnnotation - public Result delUserById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result delUserById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) throws Exception { Map result = usersService.deleteUserById(loginUser, id); return returnDataList(result); @@ -223,16 +221,16 @@ public Result delUserById(@ApiIgnore @RequestAttribute(value = Constants.SESSION * @param projectIds project id array * @return grant result code */ - @ApiOperation(value = "grantProject", notes = "GRANT_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "projectIds", value = "PROJECT_IDS", required = true, dataTypeClass = String.class) + @Operation(summary = "grantProject", description = "GRANT_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "projectIds", description = "PROJECT_IDS", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/grant-project") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_PROJECT_ERROR) @AccessLogAnnotation - public Result grantProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectIds") String projectIds) { Map result = usersService.grantProject(loginUser, userId, projectIds); @@ -247,16 +245,16 @@ public Result grantProject(@ApiIgnore @RequestAttribute(value = Constants.SESSIO * @param projectCode project code * @return grant result code */ - @ApiOperation(value = "grantProjectByCode", notes = "GRANT_PROJECT_BY_CODE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class) + @Operation(summary = "grantProjectByCode", description = "GRANT_PROJECT_BY_CODE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)) }) @PostMapping(value = "/grant-project-by-code") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_PROJECT_ERROR) @AccessLogAnnotation - public Result grantProjectByCode(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantProjectByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectCode") long projectCode) { Map result = this.usersService.grantProjectByCode(loginUser, userId, projectCode); @@ -271,16 +269,16 @@ public Result grantProjectByCode(@ApiIgnore @RequestAttribute(value = Constants. * @param projectCode project code * @return revoke result code */ - @ApiOperation(value = "revokeProject", notes = "REVOKE_PROJECT_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "projectCode", value = "PROJECT_CODE", required = true, dataTypeClass = long.class, example = "100") + @Operation(summary = "revokeProject", description = "REVOKE_PROJECT_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) }) @PostMapping(value = "/revoke-project") @ResponseStatus(HttpStatus.OK) @ApiException(REVOKE_PROJECT_ERROR) @AccessLogAnnotation - public Result revokeProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result revokeProject(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "projectCode") long projectCode) { Map result = this.usersService.revokeProject(loginUser, userId, projectCode); @@ -295,16 +293,16 @@ public Result revokeProject(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param resourceIds resource id array * @return grant result code */ - @ApiOperation(value = "grantResource", notes = "GRANT_RESOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "resourceIds", value = "RESOURCE_IDS", required = true, dataTypeClass = String.class) + @Operation(summary = "grantResource", description = "GRANT_RESOURCE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "resourceIds", description = "RESOURCE_IDS", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/grant-file") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_RESOURCE_ERROR) @AccessLogAnnotation - public Result grantResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "resourceIds") String resourceIds) { Map result = usersService.grantResources(loginUser, userId, resourceIds); @@ -319,16 +317,16 @@ public Result grantResource(@ApiIgnore @RequestAttribute(value = Constants.SESSI * @param udfIds udf id array * @return grant result code */ - @ApiOperation(value = "grantUDFFunc", notes = "GRANT_UDF_FUNC_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "udfIds", value = "UDF_IDS", required = true, dataTypeClass = String.class) + @Operation(summary = "grantUDFFunc", description = "GRANT_UDF_FUNC_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "udfIds", description = "UDF_IDS", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/grant-udf-func") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_UDF_FUNCTION_ERROR) @AccessLogAnnotation - public Result grantUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "udfIds") String udfIds) { Map result = usersService.grantUDFFunction(loginUser, userId, udfIds); @@ -343,16 +341,16 @@ public Result grantUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSIO * @param namespaceIds namespace id array * @return grant result code */ - @ApiOperation(value = "grantNamespace", notes = "GRANT_NAMESPACE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "namespaceIds", value = "NAMESPACE_IDS", required = true, dataTypeClass = String.class) + @Operation(summary = "grantNamespace", description = "GRANT_NAMESPACE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "namespaceIds", description = "NAMESPACE_IDS", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/grant-namespace") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_K8S_NAMESPACE_ERROR) @AccessLogAnnotation - public Result grantNamespace(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantNamespace(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "namespaceIds") String namespaceIds) { Map result = usersService.grantNamespaces(loginUser, userId, namespaceIds); @@ -367,16 +365,16 @@ public Result grantNamespace(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param datasourceIds data source id array * @return grant result code */ - @ApiOperation(value = "grantDataSource", notes = "GRANT_DATASOURCE_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataTypeClass = int.class, example = "100"), - @ApiImplicitParam(name = "datasourceIds", value = "DATASOURCE_IDS", required = true, dataTypeClass = String.class) + @Operation(summary = "grantDataSource", description = "GRANT_DATASOURCE_NOTES") + @Parameters({ + @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "datasourceIds", description = "DATASOURCE_IDS", required = true, schema =@Schema( implementation = String.class)) }) @PostMapping(value = "/grant-datasource") @ResponseStatus(HttpStatus.OK) @ApiException(GRANT_DATASOURCE_ERROR) @AccessLogAnnotation - public Result grantDataSource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result grantDataSource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "datasourceIds") String datasourceIds) { Map result = usersService.grantDataSource(loginUser, userId, datasourceIds); @@ -389,12 +387,12 @@ public Result grantDataSource(@ApiIgnore @RequestAttribute(value = Constants.SES * @param loginUser login user * @return user info */ - @ApiOperation(value = "getUserInfo", notes = "GET_USER_INFO_NOTES") + @Operation(summary = "getUserInfo", description = "GET_USER_INFO_NOTES") @GetMapping(value = "/get-user-info") @ResponseStatus(HttpStatus.OK) @ApiException(GET_USER_INFO_ERROR) @AccessLogAnnotation - public Result getUserInfo(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result getUserInfo(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = usersService.getUserInfo(loginUser); return returnDataList(result); } @@ -405,12 +403,12 @@ public Result getUserInfo(@ApiIgnore @RequestAttribute(value = Constants.SESSION * @param loginUser login user * @return user list */ - @ApiOperation(value = "listUser", notes = "LIST_USER_NOTES") + @Operation(summary = "listUser", description = "LIST_USER_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @ApiException(USER_LIST_ERROR) @AccessLogAnnotation - public Result listUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result listUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = usersService.queryAllGeneralUsers(loginUser); return returnDataList(result); } @@ -437,15 +435,15 @@ public Result listAll(@RequestAttribute(value = Constants.SESSION_USER) User log * @param userName user name * @return true if user name not exists, otherwise return false */ - @ApiOperation(value = "verifyUserName", notes = "VERIFY_USER_NAME_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userName", value = "USER_NAME", required = true, dataTypeClass = String.class) + @Operation(summary = "verifyUserName", description = "VERIFY_USER_NAME_NOTES") + @Parameters({ + @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/verify-user-name") @ResponseStatus(HttpStatus.OK) @ApiException(VERIFY_USERNAME_ERROR) @AccessLogAnnotation - public Result verifyUserName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result verifyUserName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName) { return usersService.verifyUserName(userName); } @@ -457,15 +455,15 @@ public Result verifyUserName(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param alertgroupId alert group id * @return unauthorize result code */ - @ApiOperation(value = "unauthorizedUser", notes = "UNAUTHORIZED_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "alertgroupId", value = "ALERT_GROUP_ID", required = true, dataTypeClass = String.class) + @Operation(summary = "unauthorizedUser", description = "UNAUTHORIZED_USER_NOTES") + @Parameters({ + @Parameter(name = "alertgroupId", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/unauth-user") @ResponseStatus(HttpStatus.OK) @ApiException(UNAUTHORIZED_USER_ERROR) @AccessLogAnnotation - public Result unauthorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result unauthorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId) { Map result = usersService.unauthorizedUser(loginUser, alertgroupId); return returnDataList(result); @@ -478,15 +476,15 @@ public Result unauthorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SE * @param alertgroupId alert group id * @return authorized result code */ - @ApiOperation(value = "authorizedUser", notes = "AUTHORIZED_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "alertgroupId", value = "ALERT_GROUP_ID", required = true, dataTypeClass = String.class) + @Operation(summary = "authorizedUser", description = "AUTHORIZED_USER_NOTES") + @Parameters({ + @Parameter(name = "alertgroupId", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = String.class)) }) @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @ApiException(AUTHORIZED_USER_ERROR) @AccessLogAnnotation - public Result authorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result authorizedUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId) { try { Map result = usersService.authorizedUser(loginUser, alertgroupId); @@ -505,12 +503,12 @@ public Result authorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param repeatPassword repeat password * @param email user email */ - @ApiOperation(value = "registerUser", notes = "REGISTER_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userName", value = "USER_NAME", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "userPassword", value = "USER_PASSWORD", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "repeatPassword", value = "REPEAT_PASSWORD", required = true, dataTypeClass = String.class), - @ApiImplicitParam(name = "email", value = "EMAIL", required = true, dataTypeClass = String.class), + @Operation(summary = "registerUser", description = "REGISTER_USER_NOTES") + @Parameters({ + @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "repeatPassword", description = "REPEAT_PASSWORD", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "email", description = "EMAIL", required = true, schema =@Schema( implementation = String.class)), }) @PostMapping("/register") @ResponseStatus(HttpStatus.OK) @@ -533,15 +531,15 @@ public Result registerUser(@RequestParam(value = "userName") String user * * @param userName user name */ - @ApiOperation(value = "activateUser", notes = "ACTIVATE_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userName", value = "USER_NAME", dataTypeClass = String.class), + @Operation(summary = "activateUser", description = "ACTIVATE_USER_NOTES") + @Parameters({ + @Parameter(name = "userName", description = "USER_NAME", schema =@Schema( implementation = String.class)), }) @PostMapping("/activate") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_USER_ERROR) @AccessLogAnnotation - public Result activateUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result activateUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName) { userName = ParameterUtils.handleEscapes(userName); Map result = usersService.activateUser(loginUser, userName); @@ -553,15 +551,15 @@ public Result activateUser(@ApiIgnore @RequestAttribute(value = Constant * * @param userNames user names */ - @ApiOperation(value = "batchActivateUser", notes = "BATCH_ACTIVATE_USER_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "userNames", value = "USER_NAMES", required = true, dataTypeClass = List.class), + @Operation(summary = "batchActivateUser", description = "BATCH_ACTIVATE_USER_NOTES") + @Parameters({ + @Parameter(name = "userNames", description = "USER_NAMES", required = true, schema =@Schema( implementation = List.class)), }) @PostMapping("/batch/activate") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_USER_ERROR) @AccessLogAnnotation - public Result batchActivateUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result batchActivateUser(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody List userNames) { List formatUserNames = userNames.stream().map(ParameterUtils::handleEscapes).collect(Collectors.toList()); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java index b22eda9eaea5..e3c836278464 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java @@ -21,6 +21,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.TASK_WITH_DEPENDENT_ERROR; import static org.apache.dolphinscheduler.common.Constants.SESSION_USER; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -32,8 +37,6 @@ import org.apache.dolphinscheduler.dao.entity.WorkFlowLineage; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; -import springfox.documentation.annotations.ApiIgnore; - import java.util.List; import java.util.Map; import java.util.Optional; @@ -51,16 +54,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - /** * work flow lineage controller */ -@Api(tags = "WORK_FLOW_LINEAGE_TAG") +@Tag(name = "WORK_FLOW_LINEAGE_TAG") @RestController @RequestMapping("projects/{projectCode}/lineages") public class WorkFlowLineageController extends BaseController { @@ -70,12 +67,12 @@ public class WorkFlowLineageController extends BaseController { @Autowired private WorkFlowLineageService workFlowLineageService; - @ApiOperation(value = "queryLineageByWorkFlowName", notes = "QUERY_WORKFLOW_LINEAGE_BY_NAME_NOTES") + @Operation(summary = "queryLineageByWorkFlowName", description = "QUERY_WORKFLOW_LINEAGE_BY_NAME_NOTES") @GetMapping(value = "/query-by-name") @ResponseStatus(HttpStatus.OK) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result> queryWorkFlowLineageByName(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result> queryWorkFlowLineageByName(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "workFlowName", required = false) String workFlowName) { try { workFlowName = ParameterUtils.handleEscapes(workFlowName); @@ -87,12 +84,12 @@ public Result> queryWorkFlowLineageByName(@ApiIgnore @Requ } } - @ApiOperation(value = "queryLineageByWorkFlowCode", notes = "QUERY_WORKFLOW_LINEAGE_BY_CODES_NOTES") + @Operation(summary = "queryLineageByWorkFlowCode", description = "QUERY_WORKFLOW_LINEAGE_BY_CODES_NOTES") @GetMapping(value = "/{workFlowCode}") @ResponseStatus(HttpStatus.OK) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result> queryWorkFlowLineageByCode(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result> queryWorkFlowLineageByCode(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @PathVariable(value = "workFlowCode", required = true) long workFlowCode) { try { Map result = workFlowLineageService.queryWorkFlowLineageByCode(projectCode, workFlowCode); @@ -103,12 +100,12 @@ public Result> queryWorkFlowLineageByCode(@ApiIgnore @Reques } } - @ApiOperation(value = "queryWorkFlowList", notes = "QUERY_WORKFLOW_LINEAGE_NOTES") + @Operation(summary = "queryWorkFlowList", description = "QUERY_WORKFLOW_LINEAGE_NOTES") @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result> queryWorkFlowLineage(@ApiIgnore @RequestAttribute(value = SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode) { + public Result> queryWorkFlowLineage(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode) { try { Map result = workFlowLineageService.queryWorkFlowLineage(projectCode); return returnDataList(result); @@ -127,18 +124,18 @@ public Result> queryWorkFlowLineage(@ApiIgnore @RequestAttri * @param taskCode task definition code * @return Result of task can be delete or not */ - @ApiOperation(value = "verifyTaskCanDelete", notes = "VERIFY_TASK_CAN_DELETE") - @ApiImplicitParams({ - @ApiImplicitParam(name = "projectCode", value = "PROCESS_DEFINITION_NAME", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "processDefinitionCode", value = "PROCESS_DEFINITION_CODE", required = true, dataTypeClass = long.class), - @ApiImplicitParam(name = "taskCode", value = "TASK_DEFINITION_CODE", required = true, dataTypeClass = long.class, example = "123456789"), + @Operation(summary = "verifyTaskCanDelete", description = "VERIFY_TASK_CAN_DELETE") + @Parameters({ + @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), }) @PostMapping(value = "/tasks/verify-delete") @ResponseStatus(HttpStatus.OK) @ApiException(TASK_WITH_DEPENDENT_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result verifyTaskCanDelete(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @ApiParam(name = "projectCode", value = "PROJECT_CODE", required = true) @PathVariable long projectCode, + public Result verifyTaskCanDelete(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam(value = "processDefinitionCode", required = true) long processDefinitionCode, @RequestParam(value = "taskCode", required = true) long taskCode) { Result result = new Result(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java index 58681aed857e..fdfb6e0fe8c5 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java @@ -22,15 +22,18 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_WORKER_GROUP_FAIL; import static org.apache.dolphinscheduler.api.enums.Status.SAVE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.WorkerGroupService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; -import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; - -import springfox.documentation.annotations.ApiIgnore; +import org.apache.dolphinscheduler.dao.entity.User; import java.util.Map; @@ -46,15 +49,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * worker group controller */ -@Api(tags = "WORKER_GROUP_TAG") +@Tag(name = "WORKER_GROUP_TAG") @RestController @RequestMapping("/worker-groups") public class WorkerGroupController extends BaseController { @@ -71,19 +69,19 @@ public class WorkerGroupController extends BaseController { * @param addrList addr list * @return create or update result code */ - @ApiOperation(value = "saveWorkerGroup", notes = "CREATE_WORKER_GROUP_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "WORKER_GROUP_ID", dataType = "Int", example = "10", defaultValue = "0"), - @ApiImplicitParam(name = "name", value = "WORKER_GROUP_NAME", required = true, dataType = "String"), - @ApiImplicitParam(name = "addrList", value = "WORKER_ADDR_LIST", required = true, dataType = "String"), - @ApiImplicitParam(name = "description", value = "WORKER_DESC", required = false, dataType = "String"), - @ApiImplicitParam(name = "otherParamsJson", value = "WORKER_PARMS_JSON", required = false, dataType = "String"), + @Operation(summary = "saveWorkerGroup", description = "CREATE_WORKER_GROUP_NOTES") + @Parameters({ + @Parameter(name = "id", description = "WORKER_GROUP_ID", schema =@Schema( implementation = int.class, example = "10", defaultValue = "0")), + @Parameter(name = "name", description = "WORKER_GROUP_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "addrList", description = "WORKER_ADDR_LIST", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "description", description = "WORKER_DESC", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "otherParamsJson", description = "WORKER_PARMS_JSON", required = false, schema =@Schema( implementation = String.class)), }) @PostMapping() @ResponseStatus(HttpStatus.OK) @ApiException(SAVE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result saveWorkerGroup(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result saveWorkerGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id", required = false, defaultValue = "0") int id, @RequestParam(value = "name") String name, @RequestParam(value = "addrList") String addrList, @@ -103,17 +101,17 @@ public Result saveWorkerGroup(@ApiIgnore @RequestAttribute(value = Constants.SES * @param pageSize page size * @return worker group list page */ - @ApiOperation(value = "queryAllWorkerGroupsPaging", notes = "QUERY_WORKER_GROUP_PAGING_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataTypeClass = int.class, example = "1"), - @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataTypeClass = int.class, example = "20"), - @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataTypeClass = String.class) + @Operation(summary = "queryAllWorkerGroupsPaging", description = "QUERY_WORKER_GROUP_PAGING_NOTES") + @Parameters({ + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_WORKER_GROUP_FAIL) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllWorkerGroupsPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result queryAllWorkerGroupsPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam(value = "searchVal", required = false) String searchVal) { @@ -133,12 +131,12 @@ public Result queryAllWorkerGroupsPaging(@ApiIgnore @RequestAttribute(value = Co * @param loginUser login user * @return all worker group list */ - @ApiOperation(value = "queryAllWorkerGroups", notes = "QUERY_WORKER_GROUP_LIST_NOTES") + @Operation(summary = "queryAllWorkerGroups", description = "QUERY_WORKER_GROUP_LIST_NOTES") @GetMapping(value = "/all") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_WORKER_GROUP_FAIL) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryAllWorkerGroups(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryAllWorkerGroups(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = workerGroupService.queryAllGroup(loginUser); return returnDataList(result); } @@ -150,15 +148,15 @@ public Result queryAllWorkerGroups(@ApiIgnore @RequestAttribute(value = Constant * @param id group id * @return delete result code */ - @ApiOperation(value = "deleteWorkerGroupById", notes = "DELETE_WORKER_GROUP_BY_ID_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "WORKER_GROUP_ID", required = true, dataTypeClass = int.class, example = "10"), + @Operation(summary = "deleteWorkerGroupById", description = "DELETE_WORKER_GROUP_BY_ID_NOTES") + @Parameters({ + @Parameter(name = "id", description = "WORKER_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "10")), }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_WORKER_GROUP_FAIL) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteWorkerGroupById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteWorkerGroupById(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("id") Integer id) { Map result = workerGroupService.deleteWorkerGroupById(loginUser, id); return returnDataList(result); @@ -170,12 +168,12 @@ public Result deleteWorkerGroupById(@ApiIgnore @RequestAttribute(value = Constan * @param loginUser login user * @return all worker address list */ - @ApiOperation(value = "queryWorkerAddressList", notes = "QUERY_WORKER_ADDRESS_LIST_NOTES") + @Operation(summary = "queryWorkerAddressList", description = "QUERY_WORKER_ADDRESS_LIST_NOTES") @GetMapping(value = "/worker-address-list") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_WORKER_ADDRESS_LIST_FAIL) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result queryWorkerAddressList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { + public Result queryWorkerAddressList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { Map result = workerGroupService.getWorkerAddressList(); return returnDataList(result); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java index c75ec2d37959..c2a76d665de8 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java @@ -22,6 +22,11 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_DEFINITION_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.workflow.WorkflowCreateRequest; import org.apache.dolphinscheduler.api.dto.workflow.WorkflowFilterRequest; @@ -34,8 +39,6 @@ import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; @@ -49,15 +52,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - /** * workflow controller */ -@Api(tags = "WORKFLOW_TAG") +@Tag(name = "WORKFLOW_TAG") @RestController @RequestMapping("/v2/workflows") public class WorkflowV2Controller extends BaseController { @@ -72,12 +70,12 @@ public class WorkflowV2Controller extends BaseController { * @param workflowCreateRequest the new workflow object will be created * @return ResourceResponse object created */ - @ApiOperation(value = "create", notes = "CREATE_WORKFLOWS_NOTES") + @Operation(summary = "create", description = "CREATE_WORKFLOWS_NOTES") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(CREATE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result createWorkflow(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result createWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody WorkflowCreateRequest workflowCreateRequest) { ProcessDefinition processDefinition = processDefinitionService.createSingleProcessDefinition(loginUser, workflowCreateRequest); @@ -91,15 +89,15 @@ public Result createWorkflow(@ApiIgnore @RequestAttribute(val * @param code process definition code * @return Result result object delete */ - @ApiOperation(value = "delete", notes = "DELETE_WORKFLOWS_NOTES") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "WORKFLOW_CODE", dataTypeClass = long.class, example = "123456", required = true) + @Operation(summary = "delete", description = "DELETE_WORKFLOWS_NOTES") + @Parameters({ + @Parameter(name = "code", description = "WORKFLOW_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(DELETE_PROCESS_DEFINE_BY_CODE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result deleteWorkflow(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result deleteWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { processDefinitionService.deleteProcessDefinitionByCode(loginUser, code); return Result.success(); @@ -113,12 +111,12 @@ public Result deleteWorkflow(@ApiIgnore @RequestAttribute(value = Constants.SESS * @param workflowUpdateRequest workflowUpdateRequest * @return ResourceResponse object updated */ - @ApiOperation(value = "update", notes = "UPDATE_WORKFLOWS_NOTES") + @Operation(summary = "update", description = "UPDATE_WORKFLOWS_NOTES") @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(UPDATE_PROCESS_DEFINITION_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result updateWorkflow(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result updateWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code, @RequestBody WorkflowUpdateRequest workflowUpdateRequest) { ProcessDefinition processDefinition = @@ -133,12 +131,12 @@ public Result updateWorkflow(@ApiIgnore @RequestAttribute(val * @param code workflow resource code you want to update * @return ResourceResponse object get from condition */ - @ApiOperation(value = "get", notes = "GET_WORKFLOWS_NOTES") + @Operation(summary = "get", description = "GET_WORKFLOWS_NOTES") @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result getWorkflow(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result getWorkflow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable("code") Long code) { ProcessDefinition processDefinition = processDefinitionService.getProcessDefinition(loginUser, code); return Result.success(processDefinition); @@ -151,12 +149,12 @@ public Result getWorkflow(@ApiIgnore @RequestAttribute(value * @param workflowFilterRequest workflowFilterRequest * @return PageResourceResponse from condition */ - @ApiOperation(value = "get", notes = "FILTER_WORKFLOWS_NOTES") + @Operation(summary = "get", description = "FILTER_WORKFLOWS_NOTES") @PostMapping(value = "/query", consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @ApiException(QUERY_PROCESS_DEFINITION_LIST) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") - public Result> filterWorkflows(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, + public Result> filterWorkflows(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestBody WorkflowFilterRequest workflowFilterRequest) { PageInfo processDefinitions = processDefinitionService.filterProcessDefinition(loginUser, workflowFilterRequest); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java index c0b8520e2eb7..dd7d713d45d0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java @@ -17,17 +17,17 @@ package org.apache.dolphinscheduler.api.dto; -import io.swagger.annotations.ApiModelProperty; -public class CreateTokenRequest { +import io.swagger.v3.oas.annotations.media.Schema; - @ApiModelProperty(example = "1", required = true) +public class CreateTokenRequest { + @Schema(example = "1", required = true) Integer userId; - @ApiModelProperty(example = "2022-12-31 00:00:00", required = true) + @Schema(example = "2022-12-31 00:00:00", required = true) String expireTime; - @ApiModelProperty(example = "abc123xyz") + @Schema(example = "abc123xyz") String token; public Integer getUserId() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java index d527c9fd5f60..e28e687cb7e5 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java @@ -18,19 +18,19 @@ package org.apache.dolphinscheduler.api.dto; import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; /** * page query dto */ -@ApiModel("QUERY-PAGE-INFO") +@Schema(name ="QUERY-PAGE-INFO") @Data public class PageQueryDto { - @ApiModelProperty(example = "10", required = true) + @Schema(example = "10", required = true) private Integer pageSize = 10; - @ApiModelProperty(example = "1", required = true) + @Schema(example = "1", required = true) private Integer pageNo = 1; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java index 21ad4d75be42..2d1cf19cc228 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java @@ -17,8 +17,8 @@ package org.apache.dolphinscheduler.api.dto.project; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import io.swagger.annotations.ApiModelProperty; /** * project create request @@ -26,9 +26,9 @@ @Data public class ProjectCreateRequest { - @ApiModelProperty(example = "pro123", required = true) + @Schema(example = "pro123", required = true) private String projectName; - @ApiModelProperty(example = "this is a project") + @Schema(example = "this is a project") private String description; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java index 942be6857d9e..43ceb7a5c6f9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java @@ -19,23 +19,21 @@ import org.apache.dolphinscheduler.api.dto.PageQueryDto; -import lombok.Data; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import lombok.Data; /** * project query request */ -@ApiModel("PROJECT-QUERY") +@Schema(name ="PROJECT-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class ProjectQueryRequest extends PageQueryDto { - @ApiModelProperty(example = "pro123") + @Schema(example = "pro123") private String searchVal; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java index 69cb3b563c52..7d59afbdb54a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java @@ -17,11 +17,11 @@ package org.apache.dolphinscheduler.api.dto.project; -import lombok.Data; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModelProperty; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; /** * project update request @@ -31,12 +31,12 @@ @Data public class ProjectUpdateRequest { - @ApiModelProperty(example = "admin", required = true) + @Schema(example = "admin", required = true) private String userName; - @ApiModelProperty(example = "pro123", required = true) + @Schema(example = "pro123", required = true) private String projectName; - @ApiModelProperty(example = "this is a project") + @Schema(example = "this is a project") private String description; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java index c318200f5acf..9006b35bb005 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java @@ -17,20 +17,20 @@ package org.apache.dolphinscheduler.api.dto.queue; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; /** * queue create request */ -@ApiModel("QUEUE-CREATE") +@Schema(name ="QUEUE-CREATE") @Data public class QueueCreateRequest { - @ApiModelProperty(example = "queue11", required = true) + @Schema(example = "queue11", required = true) private String queue; - @ApiModelProperty(example = "test_queue11", required = true) + @Schema(example = "test_queue11", required = true) private String queueName; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java index 3bdd2293cfbf..3c14cf4e5ecf 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java @@ -19,23 +19,22 @@ import org.apache.dolphinscheduler.api.dto.PageQueryDto; -import lombok.Data; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; /** * queue query request */ -@ApiModel("QUEUE-QUERY") +@Schema(name ="QUEUE-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class QueueQueryRequest extends PageQueryDto { - @ApiModelProperty(example = "queue11") + @Schema(example = "queue11") private String searchVal; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java index 7d2bbdc42f35..2b947ec23a00 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java @@ -17,26 +17,25 @@ package org.apache.dolphinscheduler.api.dto.queue; -import lombok.Data; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; /** * queue update request */ -@ApiModel("QUEUE-UPDATE") +@Schema(name ="QUEUE-UPDATE") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class QueueUpdateRequest { - @ApiModelProperty(example = "queue11", required = true) + @Schema(example = "queue11", required = true) private String queue; - @ApiModelProperty(example = "test_queue11", required = true) + @Schema(example = "test_queue11", required = true) private String queueName; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java index 6b07a7bb7dd2..31cba2aeb80f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java @@ -17,20 +17,20 @@ package org.apache.dolphinscheduler.api.dto.queue; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; /** * queue verify request */ -@ApiModel("QUEUE-Verify") +@Schema(name ="QUEUE-Verify") @Data public class QueueVerifyRequest { - @ApiModelProperty(example = "queue11", required = true) + @Schema(example = "queue11", required = true) private String queue; - @ApiModelProperty(example = "queue11", required = true) + @Schema(example = "queue11", required = true) private String queueName; } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleCreateRequest.java index f324c23c5a3e..592e5ddb99c8 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleCreateRequest.java @@ -31,7 +31,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * schedule create request @@ -39,40 +39,40 @@ @Data public class ScheduleCreateRequest { - @ApiModelProperty(example = "1234567890123", required = true) + @Schema(example = "1234567890123", required = true) private long processDefinitionCode; - @ApiModelProperty(example = "schedule timezone", required = true) + @Schema(example = "schedule timezone", required = true) private String crontab; - @ApiModelProperty(example = "2021-01-01 10:00:00", required = true) + @Schema(example = "2021-01-01 10:00:00", required = true) private String startTime; - @ApiModelProperty(example = "2022-01-01 12:00:00", required = true) + @Schema(example = "2022-01-01 12:00:00", required = true) private String endTime; - @ApiModelProperty(example = "Asia/Shanghai", required = true) + @Schema(example = "Asia/Shanghai", required = true) private String timezoneId; - @ApiModelProperty(allowableValues = "CONTINUE / END", example = "CONTINUE", notes = "default CONTINUE if value not provide.") + @Schema(allowableValues = "CONTINUE / END", example = "CONTINUE", description = "default CONTINUE if value not provide.") private String failureStrategy; - @ApiModelProperty(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", notes = "default OFFLINE if value not provide.") + @Schema(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", description = "default OFFLINE if value not provide.") private String releaseState; - @ApiModelProperty(allowableValues = "NONE / SUCCESS / FAILURE / ALL", example = "SUCCESS", notes = "default NONE if value not provide.") + @Schema(allowableValues = "NONE / SUCCESS / FAILURE / ALL", example = "SUCCESS", description = "default NONE if value not provide.") private String warningType; - @ApiModelProperty(example = "2", notes = "default 0 if value not provide.") + @Schema(example = "2", description = "default 0 if value not provide.") private int warningGroupId; - @ApiModelProperty(allowableValues = "HIGHEST / HIGH / MEDIUM / LOW / LOWEST", example = "MEDIUM", notes = "default MEDIUM if value not provide.") + @Schema(allowableValues = "HIGHEST / HIGH / MEDIUM / LOW / LOWEST", example = "MEDIUM", description = "default MEDIUM if value not provide.") private String processInstancePriority; - @ApiModelProperty(example = "worker-group-name") + @Schema(example = "worker-group-name") private String workerGroup; - @ApiModelProperty(example = "environment-code") + @Schema(example = "environment-code") private long environmentCode; public String getScheduleParam() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java index 120e773e0fea..ac6dc3f7db7e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java @@ -26,25 +26,25 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; /** * schedule query request */ -@ApiModel("SCHEDULE-QUERY") +@Schema(name ="SCHEDULE-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class ScheduleFilterRequest extends PageQueryDto { - @ApiModelProperty(example = "project-name") + @Schema(example = "project-name") private String projectName; - @ApiModelProperty(example = "process-definition-name") + @Schema(example = "process-definition-name") private String processDefinitionName; - @ApiModelProperty(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", notes = "default OFFLINE if value not provide.") + @Schema(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", description = "default OFFLINE if value not provide.") private String releaseState; public Schedule convert2Schedule() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleUpdateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleUpdateRequest.java index 3991af21b7c1..67caa0aea397 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleUpdateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleUpdateRequest.java @@ -38,7 +38,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * schedule update request @@ -48,37 +48,37 @@ @Data public class ScheduleUpdateRequest { - @ApiModelProperty(example = "schedule timezone", required = true) + @Schema(example = "schedule timezone", required = true) private String crontab; - @ApiModelProperty(example = "2021-01-01 10:00:00", required = true) + @Schema(example = "2021-01-01 10:00:00", required = true) private String startTime; - @ApiModelProperty(example = "2022-01-01 12:00:00", required = true) + @Schema(example = "2022-01-01 12:00:00", required = true) private String endTime; - @ApiModelProperty(example = "Asia/Shanghai", required = true) + @Schema(example = "Asia/Shanghai", required = true) private String timezoneId; - @ApiModelProperty(allowableValues = "CONTINUE / END", example = "CONTINUE", notes = "default CONTINUE if value not provide.") + @Schema(allowableValues = "CONTINUE / END", example = "CONTINUE", description = "default CONTINUE if value not provide.") private String failureStrategy; - @ApiModelProperty(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", notes = "default OFFLINE if value not provide.") + @Schema(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", description = "default OFFLINE if value not provide.") private String releaseState; - @ApiModelProperty(allowableValues = "NONE / SUCCESS / FAILURE / ALL", example = "SUCCESS", notes = "default NONE if value not provide.") + @Schema(allowableValues = "NONE / SUCCESS / FAILURE / ALL", example = "SUCCESS", description = "default NONE if value not provide.") private String warningType; - @ApiModelProperty(example = "2", notes = "default 0 if value not provide.") + @Schema(example = "2", description = "default 0 if value not provide.") private int warningGroupId; - @ApiModelProperty(allowableValues = "HIGHEST / HIGH / MEDIUM / LOW / LOWEST", example = "MEDIUM", notes = "default MEDIUM if value not provide.") + @Schema(allowableValues = "HIGHEST / HIGH / MEDIUM / LOW / LOWEST", example = "MEDIUM", description = "default MEDIUM if value not provide.") private String processInstancePriority; - @ApiModelProperty(example = "worker-group-name") + @Schema(example = "worker-group-name") private String workerGroup; - @ApiModelProperty(example = "environment-code") + @Schema(example = "environment-code") private long environmentCode; public String updateScheduleParam(Schedule schedule) throws InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskCreateRequest.java index df8a06d37883..942dbb85cd2b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskCreateRequest.java @@ -29,7 +29,7 @@ import java.util.Date; import lombok.Data; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * task create request @@ -37,66 +37,66 @@ @Data public class TaskCreateRequest { - @ApiModelProperty(example = "workflow-code", required = true) + @Schema(example = "workflow-code", required = true) private long workflowCode; - @ApiModelProperty(example = "task-name", required = true) + @Schema(example = "task-name", required = true) private String name; - @ApiModelProperty(example = "describe what this task actual do", required = true) + @Schema(example = "describe what this task actual do", required = true) private String description; - @ApiModelProperty(example = "6816095515584", dataType = "Long") + @Schema(example = "6816095515584", implementation = Long.class) private long projectCode; - @ApiModelProperty(example = "SHELL", required = true) + @Schema(example = "SHELL", required = true) private String taskType; // todo - @ApiModelProperty(example = "{\"localParams\": [], \"rawScript\": \"echo 1\", \"resourceList\": []}", required = true, notes = "task definition params") + @Schema(example = "{\"localParams\": [], \"rawScript\": \"echo 1\", \"resourceList\": []}", required = true, description = "task definition params") private String taskParams; - @ApiModelProperty(example = "YES", allowableValues = "YES,NO", notes = "default YES is not provided") + @Schema(example = "YES", allowableValues = "YES,NO", description = "default YES is not provided") private String flag; - @ApiModelProperty(example = "MEDIUM", allowableValues = "HIGHEST,HIGH,MEDIUM,LOW,LOWEST", notes = "default MEDIUM is not provided") + @Schema(example = "MEDIUM", allowableValues = "HIGHEST,HIGH,MEDIUM,LOW,LOWEST", description = "default MEDIUM is not provided") private String taskPriority; - @ApiModelProperty(example = "default", notes = "default 'default' if not provided") + @Schema(example = "default", description = "default 'default' if not provided") private String workerGroup; - @ApiModelProperty(example = "6563415109312", dataType = "Long") + @Schema(example = "6563415109312", implementation = Long.class) private long environmentCode; - @ApiModelProperty(example = "0", dataType = "Integer", notes = "default 0 not provided") + @Schema(example = "0", implementation = int.class, description = "default 0 not provided") private int failRetryTimes; - @ApiModelProperty(example = "1") + @Schema(example = "1") private int failRetryInterval; - @ApiModelProperty(example = "SHELL") + @Schema(example = "SHELL") private int timeout; - @ApiModelProperty(example = "CLOSE", allowableValues = "CLOSE,OPEN", notes = "default CLOSE is not provided") + @Schema(example = "CLOSE", allowableValues = "CLOSE,OPEN", description = "default CLOSE is not provided") private String timeoutFlag; - @ApiModelProperty(example = "MEDIUM", allowableValues = "WARN,FAILED,WARNFAILED", notes = "default MEDIUM is not provided") + @Schema(example = "MEDIUM", allowableValues = "WARN,FAILED,WARNFAILED", description = "default MEDIUM is not provided") private String timeoutNotifyStrategy; - @ApiModelProperty(example = "1,2,3") + @Schema(example = "1,2,3") private String resourceIds; - @ApiModelProperty(example = "2") + @Schema(example = "2") private int taskGroupId; - @ApiModelProperty(example = "1", dataType = "Integer", notes = "A priority number for execute task, the bigger the high priority, default null if not provided") + @Schema(example = "1", implementation = int.class, description = "A priority number for execute task, the bigger the high priority, default null if not provided") private int taskGroupPriority; - @ApiModelProperty(example = "0.1", dataType = "Float", notes = "default unlimited if not provided") + @Schema(example = "1", implementation = Integer.class, description = "default unlimited if not provided") private Integer cpuQuota; - @ApiModelProperty(example = "0.1", dataType = "Float", notes = "default unlimited if not provided") + @Schema(example = "0.1", implementation = Integer.class, description = "default unlimited if not provided") private Integer memoryMax; - @ApiModelProperty(example = "upstream-task-codes1,upstream-task-codes2", notes = "use , to split multiple upstream task codes") + @Schema(example = "upstream-task-codes1,upstream-task-codes2", description = "use , to split multiple upstream task codes") private String upstreamTasksCodes; public TaskDefinition convert2TaskDefinition() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java index 14d29965f6cf..bde05b511b97 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java @@ -25,25 +25,25 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; /** * task query request */ -@ApiModel("TASK-QUERY") +@Schema(name ="TASK-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class TaskFilterRequest extends PageQueryDto { - @ApiModelProperty(example = "project-name") + @Schema(example = "project-name") private String projectName; - @ApiModelProperty(example = "task-name") + @Schema(example = "task-name") private String name; - @ApiModelProperty(example = "SHELL") + @Schema(example = "SHELL") private String taskType; public TaskDefinition convert2TaskDefinition() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskUpdateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskUpdateRequest.java index d0725b29cf6d..b5a8ea7a46fa 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskUpdateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskUpdateRequest.java @@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * task update request @@ -42,63 +42,63 @@ @Data public class TaskUpdateRequest { - @ApiModelProperty(example = "workflow-code", required = true) + @Schema(example = "workflow-code", required = true) private long workflowCode; - @ApiModelProperty(example = "task-name") + @Schema(example = "task-name") private String name; - @ApiModelProperty(example = "describe what this task actual do") + @Schema(example = "describe what this task actual do") private String description; - @ApiModelProperty(example = "SHELL") + @Schema(example = "SHELL") private String taskType; // todo - @ApiModelProperty(example = "{\"localParams\": [], \"rawScript\": \"echo 1\", \"resourceList\": []}", notes = "task definition params") + @Schema(example = "{\"localParams\": [], \"rawScript\": \"echo 1\", \"resourceList\": []}", description = "task definition params") private String taskParams; - @ApiModelProperty(example = "YES", allowableValues = "YES,NO", notes = "default YES is not provided") + @Schema(example = "YES", allowableValues = "YES,NO", description = "default YES is not provided") private String flag; - @ApiModelProperty(example = "MEDIUM", allowableValues = "HIGHEST,HIGH,MEDIUM,LOW,LOWEST", notes = "default MEDIUM is not provided") + @Schema(example = "MEDIUM", allowableValues = "HIGHEST,HIGH,MEDIUM,LOW,LOWEST", description = "default MEDIUM is not provided") private String taskPriority; - @ApiModelProperty(example = "default", notes = "default 'default' if not provided") + @Schema(example = "default", description = "default 'default' if not provided") private String workerGroup; - @ApiModelProperty(example = "6563415109312", dataType = "Long") + @Schema(example = "6563415109312", implementation = long.class) private long environmentCode; - @ApiModelProperty(example = "0", dataType = "Integer", notes = "default 0 not provided") + @Schema(example = "0", implementation = Integer.class, description = "default 0 not provided") private int failRetryTimes; - @ApiModelProperty(example = "1") + @Schema(example = "1") private int failRetryInterval; - @ApiModelProperty(example = "SHELL") + @Schema(example = "SHELL") private int timeout; - @ApiModelProperty(example = "CLOSE", allowableValues = "CLOSE,OPEN", notes = "default CLOSE is not provided") + @Schema(example = "CLOSE", allowableValues = "CLOSE,OPEN", description = "default CLOSE is not provided") private String timeoutFlag; - @ApiModelProperty(example = "MEDIUM", allowableValues = "WARN,FAILED,WARNFAILED", notes = "default MEDIUM is not provided") + @Schema(example = "MEDIUM", allowableValues = "WARN,FAILED,WARNFAILED", description = "default MEDIUM is not provided") private String timeoutNotifyStrategy; - @ApiModelProperty(example = "1,2,3") + @Schema(example = "1,2,3") private String resourceIds; - @ApiModelProperty(example = "2") + @Schema(example = "2") private int taskGroupId; - @ApiModelProperty(example = "1", dataType = "Integer", notes = "A priority number for execute task, the bigger the high priority, default null if not provided") + @Schema(example = "1", implementation = int.class, description = "A priority number for execute task, the bigger the high priority, default null if not provided") private int taskGroupPriority; - @ApiModelProperty(example = "0.1", dataType = "Float", notes = "default unlimited if not provided") + @Schema(example = "0.1", implementation = Integer.class, description = "default unlimited if not provided") private Integer cpuQuota; - @ApiModelProperty(example = "0.1", dataType = "Float", notes = "default unlimited if not provided") + @Schema(example = "0.1", implementation = Integer.class, description = "default unlimited if not provided") private Integer memoryMax; - @ApiModelProperty(example = "upstream-task-codes1,upstream-task-codes2", notes = "use , to split multiple upstream task codes") + @Schema(example = "upstream-task-codes1,upstream-task-codes2", description = "use , to split multiple upstream task codes") private String upstreamTasksCodes; /** diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationCreateRequest.java index 05e6b7b4f001..2c92024db3a3 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationCreateRequest.java @@ -22,7 +22,7 @@ import java.util.Date; import lombok.Data; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * task relation create request @@ -30,16 +30,16 @@ @Data public class TaskRelationCreateRequest { - @ApiModelProperty(example = "12345678") + @Schema(example = "12345678") private long projectCode; - @ApiModelProperty(example = "87654321", required = true) + @Schema(example = "87654321", required = true) private long workflowCode; - @ApiModelProperty(example = "12345", required = true) + @Schema(example = "12345", required = true) private long preTaskCode; - @ApiModelProperty(example = "54321", required = true) + @Schema(example = "54321", required = true) private long postTaskCode; public ProcessTaskRelation convert2ProcessTaskRelation() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationDeleteRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationDeleteRequest.java index b6dde3d07805..2fcb87b35083 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationDeleteRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationDeleteRequest.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * task relation want to delete request @@ -37,7 +37,7 @@ public class TaskRelationDeleteRequest { private long upstreamCode; private long downstreamCode; - @ApiModelProperty(example = "12345678,87654321", required = true, notes = "relation pair want to delete relation, separated by comma") + @Schema(example = "12345678,87654321", required = true, description = "relation pair want to delete relation, separated by comma") private String codePair; public TaskRelationDeleteRequest(String relationPair) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java index 39e32dcad7a3..838a1fc8f6b1 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java @@ -25,25 +25,25 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; /** * task relation query request */ -@ApiModel("TASK-RELATION-QUERY") +@Schema(name ="TASK-RELATION-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class TaskRelationFilterRequest extends PageQueryDto { - @ApiModelProperty(example = "1234567890123") + @Schema(example = "1234567890123") private long workflowCode; - @ApiModelProperty(example = "1234567890123") + @Schema(example = "1234567890123") private long preTaskCode; - @ApiModelProperty(example = "1234567890123") + @Schema(example = "1234567890123") private long postTaskCode; public TaskRelationFilterRequest(long workflowCode, long preTaskCode, long postTaskCode) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationUpdateUpstreamRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationUpdateUpstreamRequest.java index 49f85cd69742..0d7b8ae2ec3a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationUpdateUpstreamRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationUpdateUpstreamRequest.java @@ -29,7 +29,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * task relation update request @@ -39,10 +39,10 @@ @Data public class TaskRelationUpdateUpstreamRequest extends PageQueryDto { - @ApiModelProperty(example = "1234587654321", notes = "workflow code ") + @Schema(example = "1234587654321", description = "workflow code ") private long workflowCode; - @ApiModelProperty(example = "12345678,87654321", required = true, notes = "upstream you want to update separated by comma") + @Schema(example = "12345678,87654321", required = true, description = "upstream you want to update separated by comma") private String upstreams; public List getUpstreams() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowCreateRequest.java index e6d78a176bed..63cae33e5bc7 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowCreateRequest.java @@ -26,7 +26,7 @@ import java.util.Date; import lombok.Data; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * workflow create request @@ -34,31 +34,31 @@ @Data public class WorkflowCreateRequest { - @ApiModelProperty(example = "workflow name", required = true) + @Schema(example = "workflow name", required = true) private String name; - @ApiModelProperty(example = "workflow's description") + @Schema(example = "workflow's description") private String description; - @ApiModelProperty(example = "12345", required = true) + @Schema(example = "12345", required = true) private long projectCode; - @ApiModelProperty(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", notes = "default OFFLINE if not provide.") + @Schema(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE", description = "default OFFLINE if not provide.") private String releaseState; - @ApiModelProperty(example = "[{\"prop\":\"key\",\"value\":\"value\",\"direct\":\"IN\",\"type\":\"VARCHAR\"}]") + @Schema(example = "[{\"prop\":\"key\",\"value\":\"value\",\"direct\":\"IN\",\"type\":\"VARCHAR\"}]") private String globalParams; - @ApiModelProperty(example = "2") + @Schema(example = "2") private int warningGroupId; - @ApiModelProperty(example = "60") + @Schema(example = "60") private int timeout; - @ApiModelProperty(example = "tenant1", required = true) + @Schema(example = "tenant1", required = true) private String tenantCode; - @ApiModelProperty(allowableValues = "PARALLEL / SERIAL_WAIT / SERIAL_DISCARD / SERIAL_PRIORITY", example = "PARALLEL", notes = "default PARALLEL if not provide.") + @Schema(allowableValues = "PARALLEL / SERIAL_WAIT / SERIAL_DISCARD / SERIAL_PRIORITY", example = "PARALLEL", description = "default PARALLEL if not provide.") private String executionType; public ProcessDefinition convert2ProcessDefinition() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java index 5a5681754c37..32f8b3462908 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java @@ -26,28 +26,28 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema;; +import io.swagger.v3.oas.annotations.media.Schema; /** * workflow query response */ -@ApiModel("WORKFLOW-QUERY") +@Schema(name ="WORKFLOW-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class WorkflowFilterRequest extends PageQueryDto { - @ApiModelProperty(example = "project-name") + @Schema(example = "project-name") private String projectName; - @ApiModelProperty(example = "workflow-name") + @Schema(example = "workflow-name") private String workflowName; - @ApiModelProperty(example = "ONLINE / OFFLINE") + @Schema(example = "ONLINE / OFFLINE") private String releaseState; - @ApiModelProperty(example = "ONLINE / OFFLINE") + @Schema(example = "ONLINE / OFFLINE") private String scheduleReleaseState; public ProcessDefinition convert2ProcessDefinition() { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowUpdateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowUpdateRequest.java index 103bf5612e47..7e3d90d46aec 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowUpdateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowUpdateRequest.java @@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * workflow update request @@ -38,31 +38,31 @@ @Data public class WorkflowUpdateRequest { - @ApiModelProperty(example = "workflow's name") + @Schema(example = "workflow's name") private String name; - @ApiModelProperty(example = "workflow's description") + @Schema(example = "workflow's description") private String description; - @ApiModelProperty(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE") + @Schema(allowableValues = "ONLINE / OFFLINE", example = "OFFLINE") private String releaseState; - @ApiModelProperty(example = "[{\"prop\":\"key\",\"value\":\"value\",\"direct\":\"IN\",\"type\":\"VARCHAR\"}]") + @Schema(example = "[{\"prop\":\"key\",\"value\":\"value\",\"direct\":\"IN\",\"type\":\"VARCHAR\"}]") private String globalParams; - @ApiModelProperty(example = "2") + @Schema(example = "2") private int warningGroupId; - @ApiModelProperty(example = "60") + @Schema(example = "60") private int timeout; - @ApiModelProperty(example = "tenantCode1") + @Schema(example = "tenantCode1") private String tenantCode; - @ApiModelProperty(allowableValues = "PARALLEL / SERIAL_WAIT / SERIAL_DISCARD / SERIAL_PRIORITY", example = "PARALLEL", notes = "default PARALLEL if not provide.") + @Schema(allowableValues = "PARALLEL / SERIAL_WAIT / SERIAL_DISCARD / SERIAL_PRIORITY", example = "PARALLEL", description = "default PARALLEL if not provide.") private String executionType; - @ApiModelProperty(example = "[{\\\"taskCode\\\":7009653961024,\\\"x\\\":312,\\\"y\\\":196}]") + @Schema(example = "[{\\\"taskCode\\\":7009653961024,\\\"x\\\":312,\\\"y\\\":196}]") private String location; /** diff --git a/dolphinscheduler-api/src/main/resources/application.yaml b/dolphinscheduler-api/src/main/resources/application.yaml index aa6857821926..8e27ac2cce90 100644 --- a/dolphinscheduler-api/src/main/resources/application.yaml +++ b/dolphinscheduler-api/src/main/resources/application.yaml @@ -80,6 +80,10 @@ spring: mvc: pathmatch: matching-strategy: ANT_PATH_MATCHER +springdoc: + swagger-ui: + path: /swagger-ui.html + packages-to-scan: org.apache.dolphinscheduler.api management: endpoints: From aa34643c15e952c792f5345aa83e7d79ee3cd38e Mon Sep 17 00:00:00 2001 From: fuchanghai <1105596917@qq.com> Date: Sat, 15 Oct 2022 20:28:35 +0800 Subject: [PATCH 03/14] [improvement-#12266]remove springfox dependency --- dolphinscheduler-api/pom.xml | 5 ----- dolphinscheduler-bom/pom.xml | 6 ------ 2 files changed, 11 deletions(-) diff --git a/dolphinscheduler-api/pom.xml b/dolphinscheduler-api/pom.xml index a070bb8d1e27..cc34dcba1ef2 100644 --- a/dolphinscheduler-api/pom.xml +++ b/dolphinscheduler-api/pom.xml @@ -134,11 +134,6 @@ spring-context - - org.hibernate.validator hibernate-validator diff --git a/dolphinscheduler-bom/pom.xml b/dolphinscheduler-bom/pom.xml index ea9124e2916a..337312e0dd9a 100644 --- a/dolphinscheduler-bom/pom.xml +++ b/dolphinscheduler-bom/pom.xml @@ -75,7 +75,6 @@ 6.1.0.jre8 0.238.1 2.5 - 3.0.0 2.0.0 0.10.2 0.10.9 @@ -562,11 +561,6 @@ javax.servlet-api ${javax.servlet-api.version} - - io.springfox - springfox-boot-starter - ${springfox.version} - com.github.rholder From 6bf0d4b5311fc325fa31aa1f900d88e03c55f7d1 Mon Sep 17 00:00:00 2001 From: fuchanghai <1105596917@qq.com> Date: Sun, 16 Oct 2022 12:55:53 +0800 Subject: [PATCH 04/14] [improvement-#12266]add other version --- .../api/configuration/OpenAPIConfiguration.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java index 1c89f7b5b5df..cc0fcc344c4a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java @@ -36,7 +36,7 @@ public class OpenAPIConfiguration implements WebMvcConfigurer { @Bean - public OpenAPI apiV1Info() { + public OpenAPI apiV1Info1() { return new OpenAPI() .info(new Info() .title("Dolphin Scheduler Api Docs") @@ -45,11 +45,18 @@ public OpenAPI apiV1Info() { } @Bean - public GroupedOpenApi publicApi() { + public GroupedOpenApi publicApi1() { return GroupedOpenApi.builder() .group("v1") .pathsToMatch("/**") .build(); } + @Bean + public GroupedOpenApi publicApi2() { + return GroupedOpenApi.builder() + .group("v2") + .pathsToMatch("/**") + .build(); + } } From 171c7b6f97ec4931761e74df38f7cd073e2aba6f Mon Sep 17 00:00:00 2001 From: fuchanghai <1105596917@qq.com> Date: Sun, 16 Oct 2022 17:31:25 +0800 Subject: [PATCH 05/14] [improvement-#12266]delete swagger and springfox in know-dependencies.txt --- tools/dependencies/known-dependencies.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tools/dependencies/known-dependencies.txt b/tools/dependencies/known-dependencies.txt index 304b63887187..36cdf6d396a6 100644 --- a/tools/dependencies/known-dependencies.txt +++ b/tools/dependencies/known-dependencies.txt @@ -319,24 +319,7 @@ spring-tx-5.3.22.jar spring-web-5.3.22.jar spring-webmvc-5.3.22.jar springdoc-openapi-ui-1.6.9.jar -springfox-bean-validators-3.0.0.jar -springfox-boot-starter-3.0.0.jar -springfox-core-3.0.0.jar -springfox-data-rest-3.0.0.jar -springfox-oas-3.0.0.jar -springfox-schema-3.0.0.jar -springfox-spi-3.0.0.jar -springfox-spring-web-3.0.0.jar -springfox-spring-webflux-3.0.0.jar -springfox-spring-webmvc-3.0.0.jar -springfox-swagger-common-3.0.0.jar -springfox-swagger-ui-3.0.0.jar -springfox-swagger2-3.0.0.jar stax2-api-4.2.1.jar -swagger-annotations-1.5.20.jar -swagger-annotations-2.1.2.jar -swagger-models-1.5.20.jar -swagger-models-2.1.2.jar tephra-api-0.6.0.jar third-party-jackson-core-2.17.282.jar token-provider-1.0.1.jar From 6e92388f0fd80e424fb5786241854e4d333e110c Mon Sep 17 00:00:00 2001 From: fuchanghai <‘2875334588@qq.com’> Date: Mon, 17 Oct 2022 09:31:20 +0800 Subject: [PATCH 06/14] [improvement] fix denpendencies.txt --- tools/dependencies/known-dependencies.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/dependencies/known-dependencies.txt b/tools/dependencies/known-dependencies.txt index 36cdf6d396a6..1b8e9304b0ec 100644 --- a/tools/dependencies/known-dependencies.txt +++ b/tools/dependencies/known-dependencies.txt @@ -31,7 +31,7 @@ caffeine-2.9.3.jar checker-qual-3.12.0.jar checker-qual-3.19.0.jar checker-qual-3.5.0.jar -classgraph-4.8.83.jar +classgraph-4.8.147.jar classmate-1.5.1.jar clickhouse-jdbc-0.1.52.jar lz4-java-1.4.0.jar @@ -214,7 +214,6 @@ logback-classic-1.2.11.jar logback-core-1.2.11.jar logging-interceptor-4.9.3.jar lz4-1.3.0.jar -mapstruct-1.3.1.Final.jar metrics-core-4.2.11.jar metrics-spi-2.17.282.jar micrometer-core-1.9.3.jar @@ -310,8 +309,6 @@ spring-expression-5.3.22.jar spring-jcl-5.3.22.jar spring-jdbc-5.3.22.jar spring-ldap-core-2.4.1.jar -spring-plugin-core-2.0.0.RELEASE.jar -spring-plugin-metadata-2.0.0.RELEASE.jar spring-retry-1.3.3.jar spring-security-crypto-5.7.3.jar spring-security-rsa-1.0.10.RELEASE.jar @@ -319,7 +316,13 @@ spring-tx-5.3.22.jar spring-web-5.3.22.jar spring-webmvc-5.3.22.jar springdoc-openapi-ui-1.6.9.jar +springdoc-openapi-common-1.6.9.jar +springdoc-openapi-webmvc-core-1.6.9.jar stax2-api-4.2.1.jar +swagger-annotations-2.2.0.jar +swagger-core-2.2.0.jar +swagger-models-2.2.0.jar +swagger-ui-4.11.1.jar tephra-api-0.6.0.jar third-party-jackson-core-2.17.282.jar token-provider-1.0.1.jar @@ -349,6 +352,7 @@ perfmark-api-0.23.0.jar proto-google-common-protos-2.0.1.jar protobuf-java-3.17.2.jar protobuf-java-util-3.17.2.jar +webjars-locator-core-0.50.jar zjsonpatch-0.3.0.jar zookeeper-3.8.0.jar zookeeper-jute-3.8.0.jar From 04985bf47458108cd4066c66b55cd6a04f3bb726 Mon Sep 17 00:00:00 2001 From: fuchanghai <‘2875334588@qq.com’> Date: Mon, 17 Oct 2022 10:57:28 +0800 Subject: [PATCH 07/14] [improvement] upgrade LICENSE --- dolphinscheduler-dist/release-docs/LICENSE | 19 +- .../licenses/LICENSE-mapstruct.txt | 41 ---- .../licenses/LICENSE-spring-plugin-core.txt | 216 ------------------ .../LICENSE-spring-plugin-metadata.txt | 216 ------------------ ...t => LICENSE-springdoc-openapi-common.txt} | 9 +- ...LICENSE-springdoc-openapi-webmvc-core.txt} | 9 +- .../licenses/LICENSE-springfox-core.txt | 201 ---------------- .../LICENSE-springfox-swagger-common.txt | 201 ---------------- .../licenses/LICENSE-springfox-swagger-ui.txt | 201 ---------------- .../licenses/LICENSE-springfox-swagger2.txt | 201 ---------------- ...pring-web.txt => LICENSE-swagger-core.txt} | 9 +- .../licenses/LICENSE-swagger-ui.txt | 12 + .../licenses/LICENSE-webjars-locator-core.txt | 7 + 13 files changed, 41 insertions(+), 1301 deletions(-) delete mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-mapstruct.txt delete mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-core.txt delete mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-metadata.txt rename dolphinscheduler-dist/release-docs/licenses/{LICENSE-springfox-schema.txt => LICENSE-springdoc-openapi-common.txt} (98%) rename dolphinscheduler-dist/release-docs/licenses/{LICENSE-springfox-spi.txt => LICENSE-springdoc-openapi-webmvc-core.txt} (98%) delete mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-core.txt delete mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-common.txt delete mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-ui.txt delete mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger2.txt rename dolphinscheduler-dist/release-docs/licenses/{LICENSE-springfox-spring-web.txt => LICENSE-swagger-core.txt} (98%) create mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-swagger-ui.txt create mode 100644 dolphinscheduler-dist/release-docs/licenses/LICENSE-webjars-locator-core.txt diff --git a/dolphinscheduler-dist/release-docs/LICENSE b/dolphinscheduler-dist/release-docs/LICENSE index ef14fc1b55d5..c4948c45f49d 100644 --- a/dolphinscheduler-dist/release-docs/LICENSE +++ b/dolphinscheduler-dist/release-docs/LICENSE @@ -334,7 +334,6 @@ The text of each license is also included at licenses/LICENSE-[project].txt. log4j-core-2.11.2: https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core/2.11.2, Apache 2.0 log4j-1.2-api 2.17.2: https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-1.2-api/2.17.2, Apache 2.0 lz4 1.3.0: https://mvnrepository.com/artifact/net.jpountz.lz4/lz4/1.3.0, Apache 2.0 - mapstruct 1.3.1.Final: https://github.com/mapstruct/mapstruct, Apache 2.0 mybatis 3.5.10 https://mvnrepository.com/artifact/org.mybatis/mybatis/3.5.10, Apache 2.0 mybatis-plus 3.5.2: https://github.com/baomidou/mybatis-plus, Apache 2.0 mybatis-plus-annotation 3.5.2: https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-annotation/3.5.2, Apache 2.0 @@ -378,22 +377,17 @@ The text of each license is also included at licenses/LICENSE-[project].txt. spring-core 5.3.22: https://mvnrepository.com/artifact/org.springframework/spring-core/5.3.22, Apache 2.0 spring-expression 5.3.13: https://mvnrepository.com/artifact/org.springframework/spring-expression/5.3.13, Apache 2.0 springdoc-openapi-ui 1.6.9: https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui/1.6.9, Apache 2.0 - springfox-core 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-core/3.0.0, Apache 2.0 - springfox-schema 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-schema/3.0.0, Apache 2.0 - springfox-spi 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-spi/3.0.0, Apache 2.0 - springfox-spring-web 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-spring-web/3.0.0, Apache 2.0 - springfox-swagger2 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-swagger2/3.0.0, Apache 2.0 - springfox-swagger-common 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-swagger-common/3.0.0, Apache 2.0 - springfox-swagger-ui 3.0.0: https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui/3.0.0, Apache 2.0 + springdoc-openapi-common 1.6.9: https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-common/1.6.9, Apache 2.0 + springdoc-openapi-webmvc-core 1.6.9: https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-webmvc-core/1.6.9, Apache 2.0 spring-jcl 5.3.13: https://mvnrepository.com/artifact/org.springframework/spring-jcl/5.3.13, Apache 2.0 spring-jdbc 5.3.22: https://mvnrepository.com/artifact/org.springframework/spring-jdbc/5.3.22, Apache 2.0 - spring-plugin-core 2.0.0.RELEASE: https://mvnrepository.com/artifact/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE, Apache 2.0 - spring-plugin-metadata 2.0.0.RELEASE: https://mvnrepository.com/artifact/org.springframework.plugin/spring-plugin-metadata/2.0.0.RELEASE, Apache 2.0 spring-tx 5.3.22: https://mvnrepository.com/artifact/org.springframework/spring-tx/5.3.22, Apache 2.0 spring-web 5.3.13: https://mvnrepository.com/artifact/org.springframework/spring-web/5.3.13, Apache 2.0 spring-webmvc 5.3.13: https://mvnrepository.com/artifact/org.springframework/spring-webmvc/5.3.13, Apache 2.0 - swagger-annotations 1.5.20: https://mvnrepository.com/artifact/io.swagger/swagger-annotations/1.5.20, Apache 2.0 - swagger-models 1.5.24: https://mvnrepository.com/artifact/io.swagger/swagger-models/1.5.24, Apache 2.0 + swagger-annotations 2.2.0: https://mvnrepository.com/artifact/io.swagger/swagger-annotations/2.2.0, Apache 2.0 + swagger-models 2.2.0: https://mvnrepository.com/artifact/io.swagger/swagger-models/2.2.0, Apache 2.0 + swagger-core 2.2.0: https://mvnrepository.com/artifact/io.swagger/swagger-core/2.2.0, Apache 2.0 + swagger-ui 4.11.1: https://mvnrepository.com/artifact/io.swagger/swagger-ui/4.11.1, Apache 2.0 tephra-api 0.6.0: https://mvnrepository.com/artifact/co.cask.tephra/tephra-api/0.6.0, Apache 2.0 token-provider 1.0.1: https://mvnrepository.com/artifact/org.apache.kerby/token-provider/1.0.1, Apache 2.0 tomcat-embed-el 9.0.65: https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-el/9.0.65, Apache 2.0 @@ -589,6 +583,7 @@ The text of each license is also included at licenses/LICENSE-[project].txt. bcpkix-jdk15on 1.68: https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on, MIT bcprov-jdk15on 1.68: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on, MIT reactive-streams 1.0.4: https://mvnrepository.com/artifact/org.reactivestreams/reactive-streams/1.0.4, MIT + webjars-locator-core 0.50 https://mvnrepository.com/artifact/org.webjars/webjars-locator-core/0.50, MIT ======================================================================== MPL 1.1 licenses diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-mapstruct.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-mapstruct.txt deleted file mode 100644 index f052b4665d62..000000000000 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-mapstruct.txt +++ /dev/null @@ -1,41 +0,0 @@ - Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) - and/or other contributors as indicated by the @authors tag. See the - copyright.txt file in the distribution for a full listing of all - contributors. - - MapStruct is licensed under the Apache License, Version 2.0 (the - "License"); you may not use this software except in compliance with the - License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------- - - MAPSTRUCT SUBCOMPONENTS WITH DIFFERENT COPYRIGHT OWNERS - - The MapStruct distribution (ZIP, TAR.GZ) as well as the MapStruct - library (JAR) include FreeMarker, a software developed by Attila - Szegedi, Daniel Dekany and Jonathan Revusky. FreeMarker is licensed - under the same license as MapStruct itself - Apache License, Version - 2.0 - but the copyright owners are the aforementioned individuals. - - The MapStruct distribution (ZIP, TAR.GZ) as well as the MapStruct - library (JAR) include a number of files that are licensed by the - Apache Software Foundation under the same license as MapStruct itself - - Apache License, Version 2.0 - but the copyright owner is the Apache - Software Foundation. These files are: - - freemarker/ext/jsp/web-app_2_2.dtd - freemarker/ext/jsp/web-app_2_3.dtd - freemarker/ext/jsp/web-app_2_4.xsd - freemarker/ext/jsp/web-app_2_5.xsd - freemarker/ext/jsp/web-jsptaglibrary_1_1.dtd - freemarker/ext/jsp/web-jsptaglibrary_1_2.dtd - freemarker/ext/jsp/web-jsptaglibrary_2_0.xsd - freemarker/ext/jsp/web-jsptaglibrary_2_1.xsd diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-core.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-core.txt deleted file mode 100644 index 7b1adee7af1d..000000000000 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-core.txt +++ /dev/null @@ -1,216 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -======================================================================= - -To the extent any open source subcomponents are licensed under the EPL and/or other -similar licenses that require the source code and/or modifications to -source code to be made available (as would be noted above), you may obtain a -copy of the source code corresponding to the binaries for such open source -components and modifications thereto, if any, (the "Source Files"), by -downloading the Source Files from http://www.springsource.org/download, -or by sending a request, with your name and address to: VMware, Inc., 3401 Hillview -Avenue, Palo Alto, CA 94304, United States of America or email info@vmware.com. All -such requests should clearly specify: OPEN SOURCE FILES REQUEST, Attention General -Counsel. VMware shall mail a copy of the Source Files to you on a CD or equivalent -physical medium. This offer to obtain a copy of the Source Files is valid for three -years from the date you acquired this Software product. \ No newline at end of file diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-metadata.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-metadata.txt deleted file mode 100644 index 7b1adee7af1d..000000000000 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-spring-plugin-metadata.txt +++ /dev/null @@ -1,216 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -======================================================================= - -To the extent any open source subcomponents are licensed under the EPL and/or other -similar licenses that require the source code and/or modifications to -source code to be made available (as would be noted above), you may obtain a -copy of the source code corresponding to the binaries for such open source -components and modifications thereto, if any, (the "Source Files"), by -downloading the Source Files from http://www.springsource.org/download, -or by sending a request, with your name and address to: VMware, Inc., 3401 Hillview -Avenue, Palo Alto, CA 94304, United States of America or email info@vmware.com. All -such requests should clearly specify: OPEN SOURCE FILES REQUEST, Attention General -Counsel. VMware shall mail a copy of the Source Files to you on a CD or equivalent -physical medium. This offer to obtain a copy of the Source Files is valid for three -years from the date you acquired this Software product. \ No newline at end of file diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-schema.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-common.txt similarity index 98% rename from dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-schema.txt rename to dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-common.txt index 980a15ac24ee..7a4a3ea2424c 100644 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-schema.txt +++ b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-common.txt @@ -1,4 +1,5 @@ - Apache License + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -178,7 +179,7 @@ APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -186,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +199,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. + limitations under the License. \ No newline at end of file diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-spi.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-webmvc-core.txt similarity index 98% rename from dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-spi.txt rename to dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-webmvc-core.txt index 980a15ac24ee..7a4a3ea2424c 100644 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-spi.txt +++ b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-webmvc-core.txt @@ -1,4 +1,5 @@ - Apache License + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -178,7 +179,7 @@ APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -186,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +199,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. + limitations under the License. \ No newline at end of file diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-core.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-core.txt deleted file mode 100644 index 980a15ac24ee..000000000000 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-core.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-common.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-common.txt deleted file mode 100644 index 980a15ac24ee..000000000000 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-common.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-ui.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-ui.txt deleted file mode 100644 index 980a15ac24ee..000000000000 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-ui.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger2.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger2.txt deleted file mode 100644 index 980a15ac24ee..000000000000 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger2.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-spring-web.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-swagger-core.txt similarity index 98% rename from dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-spring-web.txt rename to dolphinscheduler-dist/release-docs/licenses/LICENSE-swagger-core.txt index 980a15ac24ee..7a4a3ea2424c 100644 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-spring-web.txt +++ b/dolphinscheduler-dist/release-docs/licenses/LICENSE-swagger-core.txt @@ -1,4 +1,5 @@ - Apache License + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -178,7 +179,7 @@ APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -186,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +199,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. + limitations under the License. \ No newline at end of file diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-swagger-ui.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-swagger-ui.txt new file mode 100644 index 000000000000..657c7a2da868 --- /dev/null +++ b/dolphinscheduler-dist/release-docs/licenses/LICENSE-swagger-ui.txt @@ -0,0 +1,12 @@ +swagger-ui +Copyright 2020-2021 SmartBear Software Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/dolphinscheduler-dist/release-docs/licenses/LICENSE-webjars-locator-core.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-webjars-locator-core.txt new file mode 100644 index 000000000000..decadab03c8c --- /dev/null +++ b/dolphinscheduler-dist/release-docs/licenses/LICENSE-webjars-locator-core.txt @@ -0,0 +1,7 @@ +Copyright (c) 2013 James Ward + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file From 196221bec10ad990add42807b3b229ac4d15ab28 Mon Sep 17 00:00:00 2001 From: fuchanghai <‘2875334588@qq.com’> Date: Mon, 17 Oct 2022 11:26:52 +0800 Subject: [PATCH 08/14] [improvement] delete OpenAPITranslationConfiguration.java --- .../OpenAPITranslationConfiguration.java | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java deleted file mode 100644 index 0a6a81535ba7..000000000000 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.dolphinscheduler.api.configuration; - - -public class OpenAPITranslationConfiguration { - - /*@Component - @RequiredArgsConstructor - @Order(Ordered.LOWEST_PRECEDENCE) - public static class TranslationOperationBuilderPlugin implements OperationBuilderPlugin { - - private final MessageSource messageSource; - - @Override - public boolean supports(DocumentationType delimiter) { - return true; - } - - @Override - public void apply(OperationContext context) { - Locale locale = LocaleContextHolder.getLocale(); - Operation operation = context.operationBuilder().build(); - String notes = operation.getNotes(); - notes = messageSource.getMessage(notes, null, description, locale); - - Set tags = operation.getTags().stream() - .map(tag -> messageSource.getMessage(tag, null, tag, locale)) - .collect(toSet()); - - Collection parameters = operation.getRequestParameters().stream() - .map(it -> new RequestParameter( - it.getName(), - it.getIn(), - messageSource.getMessage(it.getDescription(), null, it.getDescription(), locale), - it.getRequired(), - it.getDeprecated(), - it.getHidden(), - it.getParameterSpecification(), - it.getScalarExample(), - it.getExamples(), - it.getPrecedence(), - it.getExtensions(), - it.getParameterIndex())) - .collect(toList()); - - context.operationBuilder() - .notes(notes) - .requestParameters(parameters) - .tags(tags); - } - }*/ -} From 6fafc6f1d490add7d854fa65b2c0ee2d62a04eb7 Mon Sep 17 00:00:00 2001 From: fuchanghai <33984497+fuchanghai@users.noreply.github.com> Date: Mon, 17 Oct 2022 22:41:55 +0800 Subject: [PATCH 09/14] Update dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java Co-authored-by: Wenjun Ruan --- .../api/configuration/OpenAPIConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java index cc0fcc344c4a..5f8da8c4ba3e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java @@ -48,7 +48,7 @@ public OpenAPI apiV1Info1() { public GroupedOpenApi publicApi1() { return GroupedOpenApi.builder() .group("v1") - .pathsToMatch("/**") + .pathsToExclude("v2/**") .build(); } From a6ce63123550de933203307d775e46d3f470c676 Mon Sep 17 00:00:00 2001 From: fuchanghai <33984497+fuchanghai@users.noreply.github.com> Date: Mon, 17 Oct 2022 22:49:42 +0800 Subject: [PATCH 10/14] Update dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java Co-authored-by: Wenjun Ruan --- .../api/configuration/OpenAPIConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java index 5f8da8c4ba3e..e678a92e90c5 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java @@ -56,7 +56,7 @@ public GroupedOpenApi publicApi1() { public GroupedOpenApi publicApi2() { return GroupedOpenApi.builder() .group("v2") - .pathsToMatch("/**") + .pathsToMatch("v2/**") .build(); } } From 0d1a7d86e9963718ab941c7dc90a433e3138b74f Mon Sep 17 00:00:00 2001 From: fuchanghai <33984497+fuchanghai@users.noreply.github.com> Date: Mon, 17 Oct 2022 22:54:51 +0800 Subject: [PATCH 11/14] update how to match different versions --- .../api/configuration/OpenAPIConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java index e678a92e90c5..adc3a782df26 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java @@ -48,7 +48,7 @@ public OpenAPI apiV1Info1() { public GroupedOpenApi publicApi1() { return GroupedOpenApi.builder() .group("v1") - .pathsToExclude("v2/**") + .pathsToExclude("/v2/**") .build(); } @@ -56,7 +56,7 @@ public GroupedOpenApi publicApi1() { public GroupedOpenApi publicApi2() { return GroupedOpenApi.builder() .group("v2") - .pathsToMatch("v2/**") + .pathsToMatch("/v2/**") .build(); } } From b07e50bf4705f12c6fbb79fd2c8144e74831b3aa Mon Sep 17 00:00:00 2001 From: fuchanghai <1105596917@qq.com> Date: Sat, 22 Oct 2022 14:12:57 +0800 Subject: [PATCH 12/14] [improvement-#12416] reslove conflict --- .../api/configuration/AppConfiguration.java | 2 +- .../configuration/OpenAPIConfiguration.java | 9 +- .../api/controller/AccessTokenController.java | 12 +- .../controller/AccessTokenV2Controller.java | 11 +- .../api/controller/AlertGroupController.java | 48 +++--- .../AlertPluginInstanceController.java | 32 ++-- .../api/controller/AuditLogController.java | 25 ++- .../api/controller/ClusterController.java | 38 ++--- .../controller/DataAnalysisController.java | 25 ++- .../api/controller/DataQualityController.java | 41 +++-- .../api/controller/DataSourceController.java | 43 ++--- .../api/controller/EnvironmentController.java | 41 ++--- .../api/controller/ExecutorController.java | 117 +++++++------- .../api/controller/FavTaskController.java | 21 +-- .../controller/K8sNamespaceController.java | 43 ++--- .../api/controller/LoggerController.java | 31 ++-- .../api/controller/LoginController.java | 15 +- .../api/controller/MonitorController.java | 7 +- .../ProcessDefinitionController.java | 121 +++++++------- .../controller/ProcessInstanceController.java | 99 +++++++----- .../ProcessTaskRelationController.java | 53 ++++--- .../ProcessTaskRelationV2Controller.java | 15 +- .../api/controller/ProjectController.java | 39 ++--- .../api/controller/ProjectV2Controller.java | 31 ++-- .../api/controller/QueueController.java | 31 ++-- .../api/controller/QueueV2Controller.java | 24 +-- .../api/controller/ResourcesController.java | 149 +++++++++--------- .../api/controller/ScheduleV2Controller.java | 13 +- .../api/controller/SchedulerController.java | 75 ++++----- .../controller/TaskDefinitionController.java | 77 ++++----- .../TaskDefinitionV2Controller.java | 17 +- .../api/controller/TaskGroupController.java | 67 ++++---- .../controller/TaskInstanceController.java | 41 ++--- .../api/controller/TenantController.java | 35 ++-- .../api/controller/UiPluginController.java | 15 +- .../api/controller/UsersController.java | 95 +++++------ .../controller/WorkFlowLineageController.java | 17 +- .../api/controller/WorkerGroupController.java | 31 ++-- .../api/controller/WorkflowV2Controller.java | 13 +- .../api/dto/CreateTokenRequest.java | 2 +- .../api/dto/PageQueryDto.java | 3 +- .../api/dto/project/ProjectCreateRequest.java | 2 +- .../api/dto/project/ProjectQueryRequest.java | 8 +- .../api/dto/project/ProjectUpdateRequest.java | 4 +- .../api/dto/queue/QueueCreateRequest.java | 5 +- .../api/dto/queue/QueueQueryRequest.java | 7 +- .../api/dto/queue/QueueUpdateRequest.java | 7 +- .../api/dto/queue/QueueVerifyRequest.java | 5 +- .../dto/schedule/ScheduleFilterRequest.java | 4 +- .../api/dto/task/TaskFilterRequest.java | 4 +- .../TaskRelationFilterRequest.java | 4 +- .../dto/workflow/WorkflowFilterRequest.java | 4 +- 52 files changed, 856 insertions(+), 822 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java index 5cfb11ad72c0..423cf6757158 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java @@ -103,7 +103,7 @@ public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(loginInterceptor()) .addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN) .excludePathPatterns(LOGIN_PATH_PATTERN, REGISTER_PATH_PATTERN, - "/swagger-resources/**", "/webjars/**", "/v3/api-docs/**", "/api-docs/**","/swagger-ui.html", + "/swagger-resources/**", "/webjars/**", "/v3/api-docs/**", "/api-docs/**", "/swagger-ui.html", "/doc.html", "/swagger-ui/**", "*.html", "/ui/**", "/error"); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java index adc3a782df26..349445616b08 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPIConfiguration.java @@ -16,10 +16,6 @@ */ package org.apache.dolphinscheduler.api.configuration; - - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; import org.springdoc.core.GroupedOpenApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.context.annotation.Bean; @@ -27,6 +23,9 @@ import org.springframework.context.annotation.PropertySource; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; + /** * swager2 config class */ @@ -48,7 +47,7 @@ public OpenAPI apiV1Info1() { public GroupedOpenApi publicApi1() { return GroupedOpenApi.builder() .group("v1") - .pathsToExclude("/v2/**") + .pathsToExclude("/v2/**") .build(); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java index 627a1215e871..812203016b56 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java @@ -24,12 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ACCESSTOKEN_LIST_PAGING_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ACCESS_TOKEN_ERROR; -import io.swagger.v3.oas.annotations.Hidden; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AccessTokenService; @@ -38,7 +32,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -54,6 +47,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; /** * access token controller diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java index 214983b440a2..221f069ffc5f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenV2Controller.java @@ -19,10 +19,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.CREATE_ACCESS_TOKEN_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.CreateTokenRequest; import org.apache.dolphinscheduler.api.dto.CreateTokenResponse; @@ -32,7 +28,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PostMapping; @@ -42,6 +37,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; /** * access token controller @@ -64,7 +63,7 @@ public class AccessTokenV2Controller extends BaseController { @Operation(summary = "createTokenV2", description = "CREATE_TOKEN_V2") @PostMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) - @Parameter(name = "createTokenRequest", description = "createTokenRequest", required = true, schema =@Schema( implementation = CreateTokenRequest.class)) + @Parameter(name = "createTokenRequest", description = "createTokenRequest", required = true, schema = @Schema(implementation = CreateTokenRequest.class)) @ApiException(CREATE_ACCESS_TOKEN_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public CreateTokenResponse createToken(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java index dec344f26285..85c1f5f9916b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java @@ -24,11 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERTGROUP_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_GROUP_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -38,15 +33,30 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; - +import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.Map; /** * alert group controller @@ -72,7 +82,7 @@ public class AlertGroupController extends BaseController { @Operation(summary = "createAlertgroup", description = "CREATE_ALERT_GROUP_NOTES") @Parameters({ @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema = @Schema(implementation = String.class)), - @Parameter(name = "description", description = "DESC", schema = @Schema( implementation = String.class)), + @Parameter(name = "description", description = "DESC", schema = @Schema(implementation = String.class)), @Parameter(name = "alertInstanceIds", description = "alertInstanceIds", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping() @@ -116,9 +126,9 @@ public Result list(@Parameter(hidden = true) @RequestAttribute(value = Constants */ @Operation(summary = "queryAlertGroupListPaging", description = "QUERY_ALERT_GROUP_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -145,7 +155,7 @@ public Result listPaging(@Parameter(hidden = true) @RequestAttribute(value = Con @Operation(summary = "queryAlertGroupById", description = "QUERY_ALERT_GROUP_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "ALERT_GROUP_ID", schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "id", description = "ALERT_GROUP_ID", schema = @Schema(implementation = int.class, example = "1")) }) @PostMapping(value = "/query") @ResponseStatus(HttpStatus.OK) @@ -169,10 +179,10 @@ public Result queryAlertGroupById(@Parameter(hidden = true) @RequestAttribute(va */ @Operation(summary = "updateAlertgroup", description = "UPDATE_ALERT_GROUP_NOTES") @Parameters({ - @Parameter(name = "id", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "alertInstanceIds", description = "alertInstanceIds", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "id", description = "ALERT_GROUP_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "alertInstanceIds", description = "alertInstanceIds", required = true, schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -198,7 +208,7 @@ public Result updateAlertgroup(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "delAlertgroupById", description = "DELETE_ALERT_GROUP_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "ALERT_GROUP_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -219,7 +229,7 @@ public Result delAlertgroupById(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "verifyGroupName", description = "VERIFY_ALERT_GROUP_NAME_NOTES") @Parameters({ - @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "groupName", description = "GROUP_NAME", required = true, schema = @Schema(implementation = String.class)), }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java index 7be67984bbd1..600d514041e7 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertPluginInstanceController.java @@ -24,11 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ALERT_PLUGIN_INSTANCE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -55,6 +50,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; /** * alert plugin instance controller @@ -80,9 +80,9 @@ public class AlertPluginInstanceController extends BaseController { */ @Operation(summary = "createAlertPluginInstance", description = "CREATE_ALERT_PLUGIN_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "pluginDefineId", description = "ALERT_PLUGIN_DEFINE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "instanceName", description = "ALERT_PLUGIN_INSTANCE_NAME", required = true, schema =@Schema( implementation = String.class, example = "DING TALK")), - @Parameter(name = "pluginInstanceParams", description = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, schema =@Schema( implementation = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS")) + @Parameter(name = "pluginDefineId", description = "ALERT_PLUGIN_DEFINE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "instanceName", description = "ALERT_PLUGIN_INSTANCE_NAME", required = true, schema = @Schema(implementation = String.class, example = "DING TALK")), + @Parameter(name = "pluginInstanceParams", description = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, schema = @Schema(implementation = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS")) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -108,9 +108,9 @@ public Result createAlertPluginInstance(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "updateAlertPluginInstance", description = "UPDATE_ALERT_PLUGIN_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "alertPluginInstanceId", description = "ALERT_PLUGIN_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "instanceName", description = "ALERT_PLUGIN_INSTANCE_NAME", required = true, schema =@Schema( implementation = String.class, example = "DING TALK")), - @Parameter(name = "pluginInstanceParams", description = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, schema =@Schema( implementation = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS")) + @Parameter(name = "alertPluginInstanceId", description = "ALERT_PLUGIN_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "instanceName", description = "ALERT_PLUGIN_INSTANCE_NAME", required = true, schema = @Schema(implementation = String.class, example = "DING TALK")), + @Parameter(name = "pluginInstanceParams", description = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, schema = @Schema(implementation = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS")) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -134,7 +134,7 @@ public Result updateAlertPluginInstance(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "deleteAlertPluginInstance", description = "DELETE_ALERT_PLUGIN_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "id", description = "ALERT_PLUGIN_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "ALERT_PLUGIN_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -190,7 +190,7 @@ public Result getAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "verifyAlertInstanceName", description = "VERIFY_ALERT_INSTANCE_NAME_NOTES") @Parameters({ - @Parameter(name = "alertInstanceName", description = "ALERT_INSTANCE_NAME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "alertInstanceName", description = "ALERT_INSTANCE_NAME", required = true, schema = @Schema(implementation = String.class)), }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @@ -218,9 +218,9 @@ public Result verifyGroupName(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "queryAlertPluginInstanceListPaging", description = "QUERY_ALERT_PLUGIN_INSTANCE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java index ac4b17fd3b92..546119ec2a26 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AuditLogController.java @@ -19,11 +19,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_AUDIT_LOG_LIST_PAGING; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.AuditService; @@ -33,7 +28,6 @@ import org.apache.dolphinscheduler.common.enums.AuditResourceType; import org.apache.dolphinscheduler.dao.entity.User; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.GetMapping; @@ -43,6 +37,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; @Tag(name = "AUDIT_LOG_TAG") @RestController @@ -67,13 +66,13 @@ public class AuditLogController extends BaseController { */ @Operation(summary = "queryAuditLogListPaging", description = "QUERY_AUDIT_LOG") @Parameters({ - @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "resourceType", description = "RESOURCE_TYPE", schema =@Schema( implementation = AuditResourceType.class)), - @Parameter(name = "operationType", description = "OPERATION_TYPE", schema =@Schema( implementation = AuditOperationType.class)), - @Parameter(name = "userName", description = "USER_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "resourceType", description = "RESOURCE_TYPE", schema = @Schema(implementation = AuditResourceType.class)), + @Parameter(name = "operationType", description = "OPERATION_TYPE", schema = @Schema(implementation = AuditOperationType.class)), + @Parameter(name = "userName", description = "USER_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping(value = "/audit-log-list") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java index 160c4c5906c5..a3117ed647c6 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java @@ -24,11 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_CLUSTER_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_CLUSTER_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ClusterService; @@ -37,7 +32,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -50,6 +44,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * cluster controller */ @@ -72,9 +72,9 @@ public class ClusterController extends BaseController { */ @Operation(summary = "createCluster", description = "CREATE_CLUSTER_NOTES") @Parameters({ - @Parameter(name = "name", description = "CLUSTER_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "config", description = "CONFIG", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "CLUSTER_DESC", schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "CLUSTER_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "config", description = "CONFIG", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "CLUSTER_DESC", schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @@ -101,10 +101,10 @@ public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "updateCluster", description = "UPDATE_CLUSTER_NOTES") @Parameters({ - @Parameter(name = "code", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), - @Parameter(name = "name", description = "CLUSTER_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "config", description = "CLUSTER_CONFIG", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "CLUSTER_DESC", schema =@Schema( implementation = String.class)), + @Parameter(name = "code", description = "CLUSTER_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")), + @Parameter(name = "name", description = "CLUSTER_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "config", description = "CLUSTER_CONFIG", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "CLUSTER_DESC", schema = @Schema(implementation = String.class)), }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @@ -127,7 +127,7 @@ public Result updateCluster(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "queryClusterByCode", description = "QUERY_CLUSTER_BY_CODE_NOTES") @Parameters({ - @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/query-by-code") @ResponseStatus(HttpStatus.OK) @@ -150,9 +150,9 @@ public Result queryClusterByCode(@Parameter(hidden = true) @RequestAttribute(val */ @Operation(summary = "queryClusterListPaging", description = "QUERY_CLUSTER_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @@ -181,7 +181,7 @@ public Result queryClusterListPaging(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "deleteClusterByCode", description = "DELETE_CLUSTER_BY_CODE_NOTES") @Parameters({ - @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @@ -219,7 +219,7 @@ public Result queryAllClusterList(@Parameter(hidden = true) @RequestAttribute(va */ @Operation(summary = "verifyCluster", description = "VERIFY_CLUSTER_NOTES") @Parameters({ - @Parameter(name = "clusterName", description = "CLUSTER_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "clusterName", description = "CLUSTER_NAME", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/verify-cluster") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java index b10cf2d914bc..a3c34c983371 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java @@ -23,11 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUEUE_COUNT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.TASK_INSTANCE_STATE_COUNT_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.DataAnalysisService; @@ -35,7 +30,6 @@ import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -47,6 +41,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; /** * data analysis controller @@ -70,9 +69,9 @@ public class DataAnalysisController extends BaseController { */ @Operation(summary = "countTaskState", description = "COUNT_TASK_STATE_NOTES") @Parameters({ - @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/task-state-count") @ResponseStatus(HttpStatus.OK) @@ -99,9 +98,9 @@ public Result countTaskState(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "countProcessInstanceState", description = "COUNT_PROCESS_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/process-state-count") @ResponseStatus(HttpStatus.OK) @@ -126,7 +125,7 @@ public Result countProcessInstanceState(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "countDefinitionByUser", description = "COUNT_PROCESS_DEFINITION_BY_USER_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/define-user-count") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java index ad18d3c5e177..9ddd3caa8092 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataQualityController.java @@ -23,11 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_RULE_LIST_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_RULE_LIST_PAGING_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.DqExecuteResultService; import org.apache.dolphinscheduler.api.service.DqRuleService; @@ -36,7 +31,6 @@ import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -48,6 +42,11 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; /** * data quality controller @@ -70,7 +69,7 @@ public class DataQualityController extends BaseController { */ @Operation(summary = "getRuleFormCreateJson", description = "GET_RULE_FORM_CREATE_JSON_NOTES") @Parameters({ - @Parameter(name = "ruleId", description = "RULE_ID", schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "ruleId", description = "RULE_ID", schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping(value = "/getRuleFormCreateJson") @ResponseStatus(HttpStatus.OK) @@ -91,12 +90,12 @@ public Result getRuleFormCreateJsonById(@RequestParam(value = "ruleId") int rule */ @Operation(summary = "queryRuleListPaging", description = "QUERY_RULE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "ruleType", description = "RULE_TYPE", schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", schema =@Schema( implementation = int.class, example = "10")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "ruleType", description = "RULE_TYPE", schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", schema = @Schema(implementation = int.class, example = "10")) }) @GetMapping(value = "/rule/page") @ResponseStatus(HttpStatus.OK) @@ -145,13 +144,13 @@ public Result queryRuleList() { */ @Operation(summary = "queryExecuteResultListPaging", description = "QUERY_EXECUTE_RESULT_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "ruleType", description = "RULE_TYPE", schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "state", description = "STATE", schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", schema =@Schema( implementation = int.class, example = "10")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "ruleType", description = "RULE_TYPE", schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "state", description = "STATE", schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", schema = @Schema(implementation = int.class, example = "10")) }) @GetMapping(value = "/result/page") @ResponseStatus(HttpStatus.OK) @@ -182,7 +181,7 @@ public Result queryExecuteResultListPaging(@Parameter(hidden = true) @RequestAtt */ @Operation(summary = "getDatasourceOptionsById", description = "GET_DATASOURCE_OPTIONS_NOTES") @Parameters({ - @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping(value = "/getDatasourceOptionsById") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java index 5fc0de1273e6..867402a40b94 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java @@ -30,11 +30,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_DATASOURCE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_DATASOURCE_NAME_FAILURE; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -65,6 +60,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * data source controller */ @@ -106,8 +107,8 @@ public Result createDataSource(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "updateDataSource", description = "UPDATE_DATA_SOURCE_NOTES") @Parameters({ - @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class)), - @Parameter(name = "dataSourceParam", description = "DATA_SOURCE_PARAM", required = true, schema =@Schema( implementation = BaseDataSourceParamDTO.class)) + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class)), + @Parameter(name = "dataSourceParam", description = "DATA_SOURCE_PARAM", required = true, schema = @Schema(implementation = BaseDataSourceParamDTO.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -130,7 +131,7 @@ public Result updateDataSource(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "queryDataSource", description = "QUERY_DATA_SOURCE_NOTES") @Parameters({ - @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}") @@ -153,8 +154,8 @@ public Result queryDataSource(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "queryDataSourceList", description = "QUERY_DATA_SOURCE_LIST_BY_TYPE_NOTES") @Parameters({ - @Parameter(name = "type", description = "DB_TYPE", required = true, schema = @Schema (implementation = DbType.class)), - @Parameter(name = "testFlag", description = "DB_TEST_FLAG", required = true, schema = @Schema (implementation = int.class)) + @Parameter(name = "type", description = "DB_TYPE", required = true, schema = @Schema(implementation = DbType.class)), + @Parameter(name = "testFlag", description = "DB_TEST_FLAG", required = true, schema = @Schema(implementation = int.class)) }) @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @@ -178,9 +179,9 @@ public Result queryDataSourceList(@Parameter(hidden = true) @RequestAttribute(va */ @Operation(summary = "queryDataSourceListPaging", description = "QUERY_DATA_SOURCE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -228,7 +229,7 @@ public Result connectDataSource(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "connectionTest", description = "CONNECT_DATA_SOURCE_TEST_NOTES") @Parameters({ - @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/connect-test") @ResponseStatus(HttpStatus.OK) @@ -248,7 +249,7 @@ public Result connectionTest(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "deleteDataSource", description = "DELETE_DATA_SOURCE_NOTES") @Parameters({ - @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -268,7 +269,7 @@ public Result deleteDataSource(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "verifyDataSourceName", description = "VERIFY_DATA_SOURCE_NOTES") @Parameters({ - @Parameter(name = "name", description = "DATA_SOURCE_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "DATA_SOURCE_NAME", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @@ -288,7 +289,7 @@ public Result verifyDataSourceName(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "unauthDatasource", description = "UNAUTHORIZED_DATA_SOURCE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-datasource") @ResponseStatus(HttpStatus.OK) @@ -310,7 +311,7 @@ public Result unauthDatasource(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "authedDatasource", description = "AUTHORIZED_DATA_SOURCE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-datasource") @ResponseStatus(HttpStatus.OK) @@ -341,7 +342,7 @@ public Result getKerberosStartupState(@Parameter(hidden = true) @RequestAttribut @Operation(summary = "tables", description = "GET_DATASOURCE_TABLES_NOTES") @Parameters({ - @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping(value = "/tables") @ResponseStatus(HttpStatus.OK) @@ -353,8 +354,8 @@ public Result getTables(@RequestParam("datasourceId") Integer datasourceId) { @Operation(summary = "tableColumns", description = "GET_DATASOURCE_TABLE_COLUMNS_NOTES") @Parameters({ - @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "tableName", description = "TABLE_NAME", required = true, schema =@Schema( implementation = String.class, example = "test")) + @Parameter(name = "datasourceId", description = "DATA_SOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "tableName", description = "TABLE_NAME", required = true, schema = @Schema(implementation = String.class, example = "test")) }) @GetMapping(value = "/tableColumns") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java index 05f57a77f7df..d6a2ff08581c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/EnvironmentController.java @@ -24,11 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_ENVIRONMENT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_ENVIRONMENT_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.EnvironmentService; @@ -49,6 +44,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * environment controller */ @@ -71,10 +72,10 @@ public class EnvironmentController extends BaseController { */ @Operation(summary = "createEnvironment", description = "CREATE_ENVIRONMENT_NOTES") @Parameters({ - @Parameter(name = "name", description = "ENVIRONMENT_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "config", description = "CONFIG", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "ENVIRONMENT_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "workerGroups", description = "WORKER_GROUP_LIST", schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "ENVIRONMENT_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "config", description = "CONFIG", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "ENVIRONMENT_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "workerGroups", description = "WORKER_GROUP_LIST", schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @@ -103,11 +104,11 @@ public Result createEnvironment(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "updateEnvironment", description = "UPDATE_ENVIRONMENT_NOTES") @Parameters({ - @Parameter(name = "code", description = "ENVIRONMENT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), - @Parameter(name = "name", description = "ENVIRONMENT_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "config", description = "ENVIRONMENT_CONFIG", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "ENVIRONMENT_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "workerGroups", description = "WORKER_GROUP_LIST", schema =@Schema( implementation = String.class)) + @Parameter(name = "code", description = "ENVIRONMENT_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")), + @Parameter(name = "name", description = "ENVIRONMENT_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "config", description = "ENVIRONMENT_CONFIG", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "ENVIRONMENT_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "workerGroups", description = "WORKER_GROUP_LIST", schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @@ -132,7 +133,7 @@ public Result updateEnvironment(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "queryEnvironmentByCode", description = "QUERY_ENVIRONMENT_BY_CODE_NOTES") @Parameters({ - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/query-by-code") @ResponseStatus(HttpStatus.OK) @@ -155,9 +156,9 @@ public Result queryEnvironmentByCode(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "queryEnvironmentListPaging", description = "QUERY_ENVIRONMENT_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @@ -186,7 +187,7 @@ public Result queryEnvironmentListPaging(@Parameter(hidden = true) @RequestAttri */ @Operation(summary = "deleteEnvironmentByCode", description = "DELETE_ENVIRONMENT_BY_CODE_NOTES") @Parameters({ - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @@ -224,7 +225,7 @@ public Result queryAllEnvironmentList(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "verifyEnvironment", description = "VERIFY_ENVIRONMENT_NOTES") @Parameters({ - @Parameter(name = "environmentName", description = "ENVIRONMENT_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "environmentName", description = "ENVIRONMENT_NAME", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/verify-environment") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java index 12f37015943d..b402cffe4a08 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java @@ -23,11 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_EXECUTING_WORKFLOW_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.START_PROCESS_INSTANCE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.ExecuteType; import org.apache.dolphinscheduler.api.enums.Status; @@ -69,6 +64,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * executor controller */ @@ -105,23 +106,23 @@ public class ExecutorController extends BaseController { */ @Operation(summary = "startProcessInstance", description = "RUN_PROCESS_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = Long.class), example = "100"), - @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", required = true, schema =@Schema( implementation = String.class), example = "2022-04-06 00:00:00,2022-04-06 00:00:00"), - @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema =@Schema( implementation = FailureStrategy.class)), - @Parameter(name = "startNodeList", description = "START_NODE_LIST", schema =@Schema( implementation = String.class)), - @Parameter(name = "taskDependType", description = "TASK_DEPEND_TYPE", schema =@Schema( implementation = TaskDependType.class)), - @Parameter(name = "execType", description = "COMMAND_TYPE", schema =@Schema( implementation = CommandType.class)), - @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema =@Schema( implementation = WarningType.class)), - @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "runMode", description = "RUN_MODE", schema =@Schema( implementation = RunMode.class)), - @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", required = true, schema =@Schema( implementation = Priority.class)), - @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = Long.class, example = "-1")), - @Parameter(name = "timeout", description = "TIMEOUT", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "expectedParallelismNumber", description = "EXPECTED_PARALLELISM_NUMBER", schema =@Schema( implementation = int.class , example = "8")), - @Parameter(name = "dryRun", description = "DRY_RUN", schema =@Schema( implementation = int.class, example = "0")), - @Parameter(name = "testFlag", description = "TEST_FLAG", schema =@Schema( implementation = int.class, example = "0")), - @Parameter(name = "complementDependentMode", description = "COMPLEMENT_DEPENDENT_MODE", schema =@Schema( implementation = ComplementDependentMode.class)) + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = Long.class), example = "100"), + @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", required = true, schema = @Schema(implementation = String.class), example = "2022-04-06 00:00:00,2022-04-06 00:00:00"), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema = @Schema(implementation = FailureStrategy.class)), + @Parameter(name = "startNodeList", description = "START_NODE_LIST", schema = @Schema(implementation = String.class)), + @Parameter(name = "taskDependType", description = "TASK_DEPEND_TYPE", schema = @Schema(implementation = TaskDependType.class)), + @Parameter(name = "execType", description = "COMMAND_TYPE", schema = @Schema(implementation = CommandType.class)), + @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema = @Schema(implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "runMode", description = "RUN_MODE", schema = @Schema(implementation = RunMode.class)), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", required = true, schema = @Schema(implementation = Priority.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema = @Schema(implementation = String.class, example = "default")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema = @Schema(implementation = Long.class, example = "-1")), + @Parameter(name = "timeout", description = "TIMEOUT", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "expectedParallelismNumber", description = "EXPECTED_PARALLELISM_NUMBER", schema = @Schema(implementation = int.class, example = "8")), + @Parameter(name = "dryRun", description = "DRY_RUN", schema = @Schema(implementation = int.class, example = "0")), + @Parameter(name = "testFlag", description = "TEST_FLAG", schema = @Schema(implementation = int.class, example = "0")), + @Parameter(name = "complementDependentMode", description = "COMPLEMENT_DEPENDENT_MODE", schema = @Schema(implementation = ComplementDependentMode.class)) }) @PostMapping(value = "start-process-instance") @ResponseStatus(HttpStatus.OK) @@ -193,23 +194,23 @@ public Result startProcessInstance(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "batchStartProcessInstance", description = "BATCH_RUN_PROCESS_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "processDefinitionCodes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "1,2,3")), - @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", required = true, schema =@Schema( implementation = String.class, example = "2022-04-06 00:00:00,2022-04-06 00:00:00")), - @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema =@Schema( implementation = FailureStrategy.class)), - @Parameter(name = "startNodeList", description = "START_NODE_LIST", schema =@Schema( implementation = String.class)), - @Parameter(name = "taskDependType", description = "TASK_DEPEND_TYPE", schema =@Schema( implementation = TaskDependType.class)), - @Parameter(name = "execType", description = "COMMAND_TYPE", schema =@Schema( implementation = CommandType.class)), - @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema =@Schema( implementation = WarningType.class)), - @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "runMode", description = "RUN_MODE", schema =@Schema( implementation = RunMode.class)), - @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", required = true, schema =@Schema( implementation = Priority.class)), - @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = Long.class, example = "-1")), - @Parameter(name = "timeout", description = "TIMEOUT", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "expectedParallelismNumber", description = "EXPECTED_PARALLELISM_NUMBER", schema =@Schema( implementation = int.class, example = "8")), - @Parameter(name = "dryRun", description = "DRY_RUN", schema =@Schema( implementation = int.class, example = "0")), - @Parameter(name = "testFlag", description = "TEST_FLAG", schema =@Schema( implementation = int.class, example = "0")), - @Parameter(name = "complementDependentMode", description = "COMPLEMENT_DEPENDENT_MODE", schema =@Schema( implementation = ComplementDependentMode.class)) + @Parameter(name = "processDefinitionCodes", description = "PROCESS_DEFINITION_CODES", required = true, schema = @Schema(implementation = String.class, example = "1,2,3")), + @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", required = true, schema = @Schema(implementation = String.class, example = "2022-04-06 00:00:00,2022-04-06 00:00:00")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema = @Schema(implementation = FailureStrategy.class)), + @Parameter(name = "startNodeList", description = "START_NODE_LIST", schema = @Schema(implementation = String.class)), + @Parameter(name = "taskDependType", description = "TASK_DEPEND_TYPE", schema = @Schema(implementation = TaskDependType.class)), + @Parameter(name = "execType", description = "COMMAND_TYPE", schema = @Schema(implementation = CommandType.class)), + @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema = @Schema(implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "runMode", description = "RUN_MODE", schema = @Schema(implementation = RunMode.class)), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", required = true, schema = @Schema(implementation = Priority.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema = @Schema(implementation = String.class, example = "default")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema = @Schema(implementation = Long.class, example = "-1")), + @Parameter(name = "timeout", description = "TIMEOUT", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "expectedParallelismNumber", description = "EXPECTED_PARALLELISM_NUMBER", schema = @Schema(implementation = int.class, example = "8")), + @Parameter(name = "dryRun", description = "DRY_RUN", schema = @Schema(implementation = int.class, example = "0")), + @Parameter(name = "testFlag", description = "TEST_FLAG", schema = @Schema(implementation = int.class, example = "0")), + @Parameter(name = "complementDependentMode", description = "COMPLEMENT_DEPENDENT_MODE", schema = @Schema(implementation = ComplementDependentMode.class)) }) @PostMapping(value = "batch-start-process-instance") @ResponseStatus(HttpStatus.OK) @@ -294,8 +295,8 @@ public Result batchStartProcessInstance(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "execute", description = "EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "executeType", description = "EXECUTE_TYPE", required = true, schema =@Schema( implementation = ExecuteType.class)) + @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "executeType", description = "EXECUTE_TYPE", required = true, schema = @Schema(implementation = ExecuteType.class)) }) @PostMapping(value = "/execute") @ResponseStatus(HttpStatus.OK) @@ -304,9 +305,9 @@ public Result batchStartProcessInstance(@Parameter(hidden = true) @RequestAttrib public Result execute(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode, @RequestParam("processInstanceId") Integer processInstanceId, - @RequestParam("executeType") ExecuteType executeType - ) { - logger.info("Start to execute process instance, projectCode:{}, processInstanceId:{}.", projectCode, processInstanceId); + @RequestParam("executeType") ExecuteType executeType) { + logger.info("Start to execute process instance, projectCode:{}, processInstanceId:{}.", projectCode, + processInstanceId); Map result = execService.execute(loginUser, projectCode, processInstanceId, executeType); return returnDataList(result); } @@ -322,9 +323,9 @@ public Result execute(@Parameter(hidden = true) @RequestAttribute(value = Consta */ @Operation(summary = "batchExecute", description = "BATCH_EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = int.class)), - @Parameter(name = "processInstanceIds", description = "PROCESS_INSTANCE_IDS", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "executeType", description = "EXECUTE_TYPE", required = true, schema =@Schema( implementation = ExecuteType.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = int.class)), + @Parameter(name = "processInstanceIds", description = "PROCESS_INSTANCE_IDS", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "executeType", description = "EXECUTE_TYPE", required = true, schema = @Schema(implementation = ExecuteType.class)) }) @PostMapping(value = "/batch-execute") @ResponseStatus(HttpStatus.OK) @@ -373,7 +374,7 @@ public Result batchExecute(@RequestAttribute(value = Constants.SESSION_USER) Use */ @Operation(summary = "startCheckProcessDefinition", description = "START_CHECK_PROCESS_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @PostMapping(value = "/start-check") @ResponseStatus(HttpStatus.OK) @@ -389,7 +390,7 @@ public Result startCheckProcessDefinition(@RequestParam(value = "processDefiniti */ @Operation(summary = "queryExecutingWorkflow", description = "QUERY_WORKFLOW_EXECUTE_DATA") @Parameters({ - @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/query-executing-workflow") @ResponseStatus(HttpStatus.OK) @@ -414,15 +415,15 @@ public Result queryExecutingWorkflow(@RequestParam("id") Integer processInstance */ @Operation(summary = "startTaskInstance", description = "RUN_TASK_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "version", description = "VERSION", schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema =@Schema( implementation = FailureStrategy.class)), - @Parameter(name = "execType", description = "COMMAND_TYPE", schema =@Schema( implementation = CommandType.class)), - @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema =@Schema( implementation = WarningType.class)), - @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class, example = "-1")), - @Parameter(name = "timeout", description = "TIMEOUT", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "dryRun", description = "DRY_RUN", schema =@Schema( implementation = int.class, example = "0")), + @Parameter(name = "version", description = "VERSION", schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", required = true, schema = @Schema(implementation = FailureStrategy.class)), + @Parameter(name = "execType", description = "COMMAND_TYPE", schema = @Schema(implementation = CommandType.class)), + @Parameter(name = "warningType", description = "WARNING_TYPE", required = true, schema = @Schema(implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema = @Schema(implementation = String.class, example = "default")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema = @Schema(implementation = long.class, example = "-1")), + @Parameter(name = "timeout", description = "TIMEOUT", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "dryRun", description = "DRY_RUN", schema = @Schema(implementation = int.class, example = "0")), }) @PostMapping(value = "/task-instance/{code}/start") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java index 69d5b6f0c302..4d4e401a8400 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/FavTaskController.java @@ -17,9 +17,10 @@ package org.apache.dolphinscheduler.api.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; +import static org.apache.dolphinscheduler.api.enums.Status.ADD_TASK_TYPE_ERROR; +import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_TYPE_ERROR; +import static org.apache.dolphinscheduler.api.enums.Status.LIST_TASK_TYPE_ERROR; + import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.FavTaskDto; import org.apache.dolphinscheduler.api.enums.Status; @@ -28,6 +29,11 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.entity.User; + +import java.util.List; + +import javax.annotation.Resource; + import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -38,12 +44,9 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import javax.annotation.Resource; -import java.util.List; - -import static org.apache.dolphinscheduler.api.enums.Status.ADD_TASK_TYPE_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_TYPE_ERROR; -import static org.apache.dolphinscheduler.api.enums.Status.LIST_TASK_TYPE_ERROR; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; /** * fav controller diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java index d8822f055e53..22d672f15e6b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/K8sNamespaceController.java @@ -26,11 +26,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_K8S_NAMESPACE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_K8S_NAMESPACE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.K8sNamespaceService; @@ -55,6 +50,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * k8s namespace controller */ @@ -77,9 +78,9 @@ public class K8sNamespaceController extends BaseController { */ @Operation(summary = "queryNamespaceListPaging", description = "QUERY_NAMESPACE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -111,10 +112,10 @@ public Result queryNamespaceListPaging(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "createK8sNamespace", description = "CREATE_NAMESPACE_NOTES") @Parameters({ - @Parameter(name = "namespace", description = "NAMESPACE", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "limits_cpu", description = "LIMITS_CPU", required = false, schema =@Schema( implementation = double.class)), - @Parameter(name = "limits_memory", description = "LIMITS_MEMORY", required = false, schema =@Schema( implementation = int.class)) + @Parameter(name = "namespace", description = "NAMESPACE", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "limits_cpu", description = "LIMITS_CPU", required = false, schema = @Schema(implementation = double.class)), + @Parameter(name = "limits_memory", description = "LIMITS_MEMORY", required = false, schema = @Schema(implementation = int.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -141,10 +142,10 @@ public Result createNamespace(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "updateK8sNamespace", description = "UPDATE_NAMESPACE_NOTES") @Parameters({ - @Parameter(name = "id", description = "K8S_NAMESPACE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "userName", description = "OWNER", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "limitsCpu", description = "LIMITS_CPU", required = false, schema =@Schema( implementation = double.class)), - @Parameter(name = "limitsMemory", description = "LIMITS_MEMORY", required = false, schema =@Schema( implementation = int.class))}) + @Parameter(name = "id", description = "K8S_NAMESPACE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "userName", description = "OWNER", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "limitsCpu", description = "LIMITS_CPU", required = false, schema = @Schema(implementation = double.class)), + @Parameter(name = "limitsMemory", description = "LIMITS_MEMORY", required = false, schema = @Schema(implementation = int.class))}) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_K8S_NAMESPACE_ERROR) @@ -170,8 +171,8 @@ public Result updateNamespace(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "verifyNamespaceK8s", description = "VERIFY_NAMESPACE_K8S_NOTES") @Parameters({ - @Parameter(name = "namespace", description = "NAMESPACE", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema =@Schema( implementation = long.class)), + @Parameter(name = "namespace", description = "NAMESPACE", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "clusterCode", description = "CLUSTER_CODE", required = true, schema = @Schema(implementation = long.class)), }) @PostMapping(value = "/verify") @ResponseStatus(HttpStatus.OK) @@ -193,7 +194,7 @@ public Result verifyNamespace(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "delNamespaceById", description = "DELETE_NAMESPACE_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "NAMESPACE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "NAMESPACE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @@ -214,7 +215,7 @@ public Result delNamespaceById(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "queryUnauthorizedNamespace", description = "QUERY_UNAUTHORIZED_NAMESPACE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-namespace") @ResponseStatus(HttpStatus.OK) @@ -235,7 +236,7 @@ public Result queryUnauthorizedNamespace(@Parameter(hidden = true) @RequestAttri */ @Operation(summary = "queryAuthorizedNamespace", description = "QUERY_AUTHORIZED_NAMESPACE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-namespace") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java index 23c1d953adc2..11ccfb321488 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoggerController.java @@ -20,11 +20,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_INSTANCE_LOG_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.LoggerService; @@ -46,6 +41,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * logger controller */ @@ -68,9 +69,9 @@ public class LoggerController extends BaseController { */ @Operation(summary = "queryLog", description = "QUERY_TASK_INSTANCE_LOG_NOTES") @Parameters({ - @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/detail") @ResponseStatus(HttpStatus.OK) @@ -92,7 +93,7 @@ public Result queryLog(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "downloadTaskLog", description = "DOWNLOAD_TASK_INSTANCE_LOG_NOTES") @Parameters({ - @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/download-log") @ResponseBody @@ -120,10 +121,10 @@ public ResponseEntity downloadTaskLog(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "queryLogInSpecifiedProject", description = "QUERY_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{projectCode}/detail") @ResponseStatus(HttpStatus.OK) @@ -147,8 +148,8 @@ public Result queryLog(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "downloadTaskLogInSpecifiedProject", description = "DOWNLOAD_TASK_INSTANCE_LOG_IN_SPECIFIED_PROJECT_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskInstanceId", description = "TASK_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{projectCode}/download-log") @ResponseBody diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java index ca503e69f058..7eb73433f61b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java @@ -21,11 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.SIGN_OUT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.USER_LOGIN_FAILURE; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -51,6 +46,12 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * login controller */ @@ -76,8 +77,8 @@ public class LoginController extends BaseController { */ @Operation(summary = "login", description = "LOGIN_NOTES") @Parameters({ - @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "userName", description = "USER_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/login") @ApiException(USER_LOGIN_FAILURE) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java index 6a09639a8e87..3e5cb5d07a7e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/MonitorController.java @@ -21,9 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.LIST_WORKERS_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_DATABASE_STATE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.MonitorService; @@ -41,6 +38,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * monitor controller */ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java index 4411f45b5555..98580dee9acc 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java @@ -35,11 +35,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_DEFINITION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -74,6 +69,12 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * process definition controller */ @@ -105,10 +106,10 @@ public class ProcessDefinitionController extends BaseController { */ @Operation(summary = "createProcessDefinition", description = "CREATE_PROCESS_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "locations", description = "PROCESS_DEFINITION_LOCATIONS", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "locations", description = "PROCESS_DEFINITION_LOCATIONS", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema = @Schema(implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -143,8 +144,8 @@ public Result createProcessDefinition(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "batchCopyByCodes", description = "COPY_PROCESS_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "3,4")), - @Parameter(name = "targetProjectCode", description = "TARGET_PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "123")) + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema = @Schema(implementation = String.class, example = "3,4")), + @Parameter(name = "targetProjectCode", description = "TARGET_PROJECT_CODE", required = true, schema = @Schema(implementation = long.class, example = "123")) }) @PostMapping(value = "/batch-copy") @ResponseStatus(HttpStatus.OK) @@ -169,8 +170,8 @@ public Result copyProcessDefinition(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "batchMoveByCodes", description = "MOVE_PROCESS_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "3,4")), - @Parameter(name = "targetProjectCode", description = "TARGET_PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "123")) + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema = @Schema(implementation = String.class, example = "3,4")), + @Parameter(name = "targetProjectCode", description = "TARGET_PROJECT_CODE", required = true, schema = @Schema(implementation = long.class, example = "123")) }) @PostMapping(value = "/batch-move") @ResponseStatus(HttpStatus.OK) @@ -194,8 +195,8 @@ public Result moveProcessDefinition(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "verify-name", description = "VERIFY_PROCESS_DEFINITION_NAME_NOTES") @Parameters({ - @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = false, schema =@Schema( implementation = Long.class)), + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = false, schema = @Schema(implementation = Long.class)), }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @@ -229,12 +230,12 @@ public Result verifyProcessDefinitionName(@Parameter(hidden = true) @RequestAttr */ @Operation(summary = "update", description = "UPDATE_PROCESS_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), - @Parameter(name = "locations", description = "PROCESS_DEFINITION_LOCATIONS", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, schema =@Schema( implementation = ReleaseState.class)), - @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")), + @Parameter(name = "locations", description = "PROCESS_DEFINITION_LOCATIONS", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, schema = @Schema(implementation = ReleaseState.class)), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -282,9 +283,9 @@ public Result updateProcessDefinition(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "queryVersions", description = "QUERY_PROCESS_DEFINITION_VERSIONS_NOTES") @Parameters({ - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")) + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")) }) @GetMapping(value = "/{code}/versions") @ResponseStatus(HttpStatus.OK) @@ -317,8 +318,8 @@ public Result queryProcessDefinitionVersions(@Parameter(hidden = true) @RequestA */ @Operation(summary = "switchVersion", description = "SWITCH_PROCESS_DEFINITION_VERSION_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), - @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @@ -344,8 +345,8 @@ public Result switchProcessDefinitionVersion(@Parameter(hidden = true) @RequestA */ @Operation(summary = "deleteVersion", description = "DELETE_PROCESS_DEFINITION_VERSION_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), - @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @@ -371,9 +372,9 @@ public Result deleteProcessDefinitionVersion(@Parameter(hidden = true) @RequestA */ @Operation(summary = "release", description = "RELEASE_PROCESS_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), - @Parameter(name = "releaseState", description = "PROCESS_DEFINITION_RELEASE", required = true, schema =@Schema( implementation = ReleaseState.class)), + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")), + @Parameter(name = "releaseState", description = "PROCESS_DEFINITION_RELEASE", required = true, schema = @Schema(implementation = ReleaseState.class)), }) @PostMapping(value = "/{code}/release") @ResponseStatus(HttpStatus.OK) @@ -398,7 +399,7 @@ public Result releaseProcessDefinition(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "queryProcessDefinitionByCode", description = "QUERY_PROCESS_DEFINITION_BY_CODE_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")) + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -422,7 +423,7 @@ public Result queryProcessDefinitionByCode(@Parameter(hidden = true) @RequestAtt */ @Operation(summary = "queryProcessDefinitionByName", description = "QUERY_PROCESS_DEFINITION_BY_NAME_NOTES") @Parameters({ - @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/query-by-name") @ResponseStatus(HttpStatus.OK) @@ -486,11 +487,11 @@ public Result queryProcessDefinitionSimpleList(@Parameter(hidden = true) @Reques */ @Operation(summary = "queryListPaging", description = "QUERY_PROCESS_DEFINITION_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "userId", description = "USER_ID", required = false, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) + @Parameter(name = "searchVal", description = "SEARCH_VAL", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "userId", description = "USER_ID", required = false, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema = @Schema(implementation = String.class)) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -528,8 +529,8 @@ public Result> queryProcessDefinitionListPaging( */ @Operation(summary = "viewTree", description = "VIEW_TREE_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), - @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{code}/view-tree") @ResponseStatus(HttpStatus.OK) @@ -553,7 +554,7 @@ public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Const */ @Operation(summary = "getTasksByDefinitionCode", description = "GET_TASK_LIST_BY_DEFINITION_CODE_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/{code}/tasks") @ResponseStatus(HttpStatus.OK) @@ -576,7 +577,7 @@ public Result getNodeListByDefinitionCode(@Parameter(hidden = true) @RequestAttr */ @Operation(summary = "getTaskListByDefinitionCodes", description = "GET_TASK_LIST_BY_DEFINITION_CODE_NOTES") @Parameters({ - @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema =@Schema( implementation = String.class, example = "100,200,300")) + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODES", required = true, schema = @Schema(implementation = String.class, example = "100,200,300")) }) @GetMapping(value = "/batch-query-tasks") @ResponseStatus(HttpStatus.OK) @@ -598,7 +599,7 @@ public Result getNodeListMapByDefinitionCodes(@Parameter(hidden = true) @Request */ @Operation(summary = "getProcessListByProjectCode", description = "GET_PROCESS_LIST_BY_PROCESS_CODE_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/query-process-definition-list") @ResponseStatus(HttpStatus.OK) @@ -618,8 +619,8 @@ public Result getProcessListByProjectCodes(@Parameter(hidden = true) @RequestAtt */ @Operation(summary = "getTaskListByProcessDefinitionCode", description = "GET_TASK_LIST_BY_PROCESS_CODE_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")), }) @GetMapping(value = "/query-task-definition-list") @ResponseStatus(HttpStatus.OK) @@ -642,7 +643,7 @@ public Result getTaskListByProcessDefinitionCode(@Parameter(hidden = true) @Requ */ @Operation(summary = "deleteByCode", description = "DELETE_PROCESS_DEFINITION_BY_ID_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -665,7 +666,7 @@ public Result deleteProcessDefinitionByCode(@Parameter(hidden = true) @RequestAt */ @Operation(summary = "batchDeleteByCodes", description = "BATCH_DELETE_PROCESS_DEFINITION_BY_IDS_NOTES") @Parameters({ - @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/batch-delete") @ResponseStatus(HttpStatus.OK) @@ -690,7 +691,7 @@ public Result batchDeleteProcessDefinitionByCodes(@Parameter(hidden = true) @Req */ @Operation(summary = "batchExportByCodes", description = "BATCH_EXPORT_PROCESS_DEFINITION_BY_CODES_NOTES") @Parameters({ - @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "codes", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/batch-export") @ResponseBody @@ -735,7 +736,7 @@ public Result queryAllProcessDefinitionByProjectCode(@Parameter(hidden = true) @ */ @Operation(summary = "importProcessDefinition", description = "IMPORT_PROCESS_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema =@Schema( implementation = MultipartFile.class)) + @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema = @Schema(implementation = MultipartFile.class)) }) @PostMapping(value = "/import") @ApiException(IMPORT_PROCESS_DEFINE_ERROR) @@ -767,9 +768,9 @@ public Result importProcessDefinition(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "createEmptyProcessDefinition", description = "CREATE_EMPTY_PROCESS_NOTES") @Parameters({ - @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), - @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/empty") @ResponseStatus(HttpStatus.OK) @@ -808,11 +809,11 @@ public Result createEmptyProcessDefinition(@Parameter(hidden = true) @RequestAtt */ @Operation(summary = "updateBasicInfo", description = "UPDATE_PROCESS_DEFINITION_BASIC_INFO_NOTES") @Parameters({ - @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), - @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, schema =@Schema( implementation = ReleaseState.class)), - @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")), + @Parameter(name = "description", description = "PROCESS_DEFINITION_DESC", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, schema = @Schema(implementation = ReleaseState.class)), + @Parameter(name = "otherParamsJson", description = "OTHER_PARAMS_JSON", required = false, schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{code}/basic-info") @ResponseStatus(HttpStatus.OK) @@ -856,9 +857,9 @@ public Result updateProcessDefinitionBasicInfo(@Parameter(hidden = true) @Reques */ @Operation(summary = "releaseWorkflowAndSchedule", description = "RELEASE_WORKFLOW_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), - @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, schema =@Schema( implementation = ReleaseState.class)) + @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, schema = @Schema(implementation = ReleaseState.class)) }) @PostMapping(value = "/{code}/release-workflow") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java index af9b0a82fe17..11385ba9853b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java @@ -17,12 +17,8 @@ package org.apache.dolphinscheduler.api.controller; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.commons.lang3.StringUtils; +import static org.apache.dolphinscheduler.api.enums.Status.*; + import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -30,14 +26,11 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus; -import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.User; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; + +import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.text.MessageFormat; @@ -46,7 +39,27 @@ import java.util.List; import java.util.Map; -import static org.apache.dolphinscheduler.api.enums.Status.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; /** * process instance controller @@ -79,15 +92,15 @@ public class ProcessInstanceController extends BaseController { */ @Operation(summary = "queryProcessInstanceListPaging", description = "QUERY_PROCESS_INSTANCE_LIST_NOTES") @Parameters({ - @Parameter(name = "processDefineCode", description = "PROCESS_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "100")), - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema =@Schema( implementation = WorkflowExecutionStatus.class)), - @Parameter(name = "host", description = "HOST", schema =@Schema( implementation = String.class)), - @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")) + @Parameter(name = "processDefineCode", description = "PROCESS_DEFINITION_CODE", schema = @Schema(implementation = long.class, example = "100")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema = @Schema(implementation = WorkflowExecutionStatus.class)), + @Parameter(name = "host", description = "HOST", schema = @Schema(implementation = String.class)), + @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -127,7 +140,7 @@ public Result queryProcessInstanceList(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "queryTaskListByProcessId", description = "QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/tasks") @ResponseStatus(HttpStatus.OK) @@ -156,15 +169,15 @@ public Result queryTaskListByProcessId(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "updateProcessInstance", description = "UPDATE_PROCESS_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "taskRelationJson", description = "TASK_RELATION_JSON", schema =@Schema( implementation = String.class)), - @Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", schema =@Schema( implementation = String.class)), - @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", schema =@Schema( implementation = String.class)), - @Parameter(name = "syncDefine", description = "SYNC_DEFINE", required = true, schema =@Schema( implementation = boolean.class, example = "false")), - @Parameter(name = "globalParams", description = "PROCESS_GLOBAL_PARAMS", schema =@Schema( implementation = String.class, example = "[]")), - @Parameter(name = "locations", description = "PROCESS_INSTANCE_LOCATIONS", schema =@Schema( implementation = String.class)), - @Parameter(name = "timeout", description = "PROCESS_TIMEOUT", schema =@Schema( implementation = int.class, example = "0")), - @Parameter(name = "tenantCode", description = "TENANT_CODE", schema =@Schema( implementation = String.class, example = "default")) + @Parameter(name = "taskRelationJson", description = "TASK_RELATION_JSON", schema = @Schema(implementation = String.class)), + @Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", schema = @Schema(implementation = String.class)), + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "scheduleTime", description = "SCHEDULE_TIME", schema = @Schema(implementation = String.class)), + @Parameter(name = "syncDefine", description = "SYNC_DEFINE", required = true, schema = @Schema(implementation = boolean.class, example = "false")), + @Parameter(name = "globalParams", description = "PROCESS_GLOBAL_PARAMS", schema = @Schema(implementation = String.class, example = "[]")), + @Parameter(name = "locations", description = "PROCESS_INSTANCE_LOCATIONS", schema = @Schema(implementation = String.class)), + @Parameter(name = "timeout", description = "PROCESS_TIMEOUT", schema = @Schema(implementation = int.class, example = "0")), + @Parameter(name = "tenantCode", description = "TENANT_CODE", schema = @Schema(implementation = String.class, example = "default")) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -197,7 +210,7 @@ public Result updateProcessInstance(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "queryProcessInstanceById", description = "QUERY_PROCESS_INSTANCE_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -222,9 +235,9 @@ public Result queryProcessInstanceById(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "queryTopNLongestRunningProcessInstance", description = "QUERY_TOPN_LONGEST_RUNNING_PROCESS_INSTANCE_NOTES") @Parameters({ - @Parameter(name = "size", description = "PROCESS_INSTANCE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "startTime", description = "PROCESS_INSTANCE_START_TIME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "endTime", description = "PROCESS_INSTANCE_END_TIME", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "size", description = "PROCESS_INSTANCE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "startTime", description = "PROCESS_INSTANCE_START_TIME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "endTime", description = "PROCESS_INSTANCE_END_TIME", required = true, schema = @Schema(implementation = String.class)), }) @GetMapping(value = "/top-n") @ResponseStatus(HttpStatus.OK) @@ -251,7 +264,7 @@ public Result queryTopNLongestRunningProcessInstance(@Parameter */ @Operation(summary = "deleteProcessInstanceById", description = "DELETE_PROCESS_INSTANCE_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -274,7 +287,7 @@ public Result deleteProcessInstanceById(@Parameter(hidden = tru */ @Operation(summary = "querySubProcessInstanceByTaskCode", description = "QUERY_SUBPROCESS_INSTANCE_BY_TASK_CODE_NOTES") @Parameters({ - @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/query-sub-by-parent") @ResponseStatus(HttpStatus.OK) @@ -298,7 +311,7 @@ public Result querySubProcessInstanceByTaskId(@Parameter(hidden = true) @Request */ @Operation(summary = "queryParentInstanceBySubId", description = "QUERY_PARENT_PROCESS_INSTANCE_BY_SUB_PROCESS_INSTANCE_ID_NOTES") @Parameters({ - @Parameter(name = "subId", description = "SUB_PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "subId", description = "SUB_PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/query-parent-by-sub") @ResponseStatus(HttpStatus.OK) @@ -320,7 +333,7 @@ public Result queryParentInstanceBySubId(@Parameter(hidden = true) @RequestAttri */ @Operation(summary = "viewVariables", description = "QUERY_PROCESS_INSTANCE_GLOBAL_VARIABLES_AND_LOCAL_VARIABLES_NOTES") @Parameters({ - @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/view-variables") @ResponseStatus(HttpStatus.OK) @@ -343,7 +356,7 @@ public Result viewVariables(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "vieGanttTree", description = "VIEW_GANTT_NOTES") @Parameters({ - @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "PROCESS_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/view-gantt") @ResponseStatus(HttpStatus.OK) @@ -367,8 +380,8 @@ public Result viewTree(@Parameter(hidden = true) @RequestAttribute(value = Const */ @Operation(summary = "batchDeleteProcessInstanceByIds", description = "BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = int.class)), - @Parameter(name = "processInstanceIds", description = "PROCESS_INSTANCE_IDS", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = int.class)), + @Parameter(name = "processInstanceIds", description = "PROCESS_INSTANCE_IDS", required = true, schema = @Schema(implementation = String.class)), }) @PostMapping(value = "/batch-delete") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java index 31e8cc393f89..019880569aaa 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationController.java @@ -23,11 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_PROCESS_RELATION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_PROCESS_RELATION_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProcessTaskRelationService; @@ -50,6 +45,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * process task relation controller */ @@ -73,10 +74,10 @@ public class ProcessTaskRelationController extends BaseController { */ @Operation(summary = "save", description = "CREATE_PROCESS_TASK_RELATION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "preTaskCode", description = "PRE_TASK_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "postTaskCode", description = "POST_TASK_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "preTaskCode", description = "PRE_TASK_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "postTaskCode", description = "POST_TASK_CODE", required = true, schema = @Schema(implementation = long.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -110,9 +111,9 @@ public Result createProcessTaskRelation(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "deleteRelation", description = "DELETE_PROCESS_TASK_RELATION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema = @Schema(implementation = long.class)) }) @DeleteMapping(value = "/{taskCode}") @ResponseStatus(HttpStatus.OK) @@ -137,9 +138,9 @@ public Result deleteTaskProcessRelation(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "deleteUpstreamRelation", description = "DELETE_UPSTREAM_RELATION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "preTaskCodes", description = "PRE_TASK_CODES", required = true, schema =@Schema( implementation = String.class, example = "1,2")), - @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "preTaskCodes", description = "PRE_TASK_CODES", required = true, schema = @Schema(implementation = String.class, example = "1,2")), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema = @Schema(implementation = long.class)) }) @DeleteMapping(value = "/{taskCode}/upstream") @ResponseStatus(HttpStatus.OK) @@ -164,9 +165,9 @@ public Result deleteUpstreamRelation(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "deleteDownstreamRelation", description = "DELETE_DOWNSTREAM_RELATION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "postTaskCodes", description = "POST_TASK_CODES", required = true, schema =@Schema( implementation = String.class, example = "1,2")), - @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "postTaskCodes", description = "POST_TASK_CODES", required = true, schema = @Schema(implementation = String.class, example = "1,2")), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema = @Schema(implementation = long.class)) }) @DeleteMapping(value = "/{taskCode}/downstream") @ResponseStatus(HttpStatus.OK) @@ -190,8 +191,8 @@ public Result deleteDownstreamRelation(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "queryUpstreamRelation", description = "QUERY_UPSTREAM_RELATION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema = @Schema(implementation = long.class)) }) @GetMapping(value = "/{taskCode}/upstream") @ResponseStatus(HttpStatus.OK) @@ -213,8 +214,8 @@ public Result queryUpstreamRelation(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "queryDownstreamRelation", description = "QUERY_DOWNSTREAM_RELATION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_CODE", required = true, schema = @Schema(implementation = long.class)) }) @GetMapping(value = "/{taskCode}/downstream") @ResponseStatus(HttpStatus.OK) @@ -238,10 +239,10 @@ public Result queryDownstreamRelation(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "deleteEdge", description = "DELETE_EDGE_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "preTaskCode", description = "PRE_TASK_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "postTaskCode", description = "POST_TASK_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "preTaskCode", description = "PRE_TASK_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "postTaskCode", description = "POST_TASK_CODE", required = true, schema = @Schema(implementation = long.class)) }) @DeleteMapping(value = "/{processDefinitionCode}/{preTaskCode}/{postTaskCode}") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java index 512cdab05f7f..d20cec00ec5e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessTaskRelationV2Controller.java @@ -21,11 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_PROCESS_RELATION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_UPSTREAM_TASK_PROCESS_RELATION_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationCreateRequest; import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationDeleteRequest; @@ -51,6 +46,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * process task relation controller */ @@ -90,7 +91,7 @@ public Result createTaskRelation(@Parameter(hidden = true) */ @Operation(summary = "delete", description = "DELETE_PROCESS_TASK_RELATION_NOTES") @Parameters({ - @Parameter(name = "code-pair", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456,78901", required = true)) + @Parameter(name = "code-pair", description = "TASK_DEFINITION_CODE", schema = @Schema(implementation = long.class, example = "123456,78901", required = true)) }) @DeleteMapping(value = "/{code-pair}") @ResponseStatus(HttpStatus.OK) @@ -114,7 +115,7 @@ public Result deleteTaskRelation(@Parameter(hidden = true) @RequestAttribute(val */ @Operation(summary = "update", description = "UPDATE_PROCESS_TASK_RELATION_NOTES") @Parameters({ - @Parameter(name = "code", description = "DOWMSTREAM_TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "code", description = "DOWMSTREAM_TASK_DEFINITION_CODE", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java index 9acdee155857..236f3e802a34 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java @@ -27,11 +27,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_UNAUTHORIZED_PROJECT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ProjectService; @@ -55,6 +50,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * project controller */ @@ -78,8 +79,8 @@ public class ProjectController extends BaseController { */ @Operation(summary = "create", description = "CREATE_PROJECT_NOTES") @Parameters({ - @Parameter(name = "projectName", description = "PROJECT_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "PROJECT_DESC", schema =@Schema( implementation = String.class)) + @Parameter(name = "projectName", description = "PROJECT_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "PROJECT_DESC", schema = @Schema(implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -102,10 +103,10 @@ public Result createProject(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "update", description = "UPDATE_PROJECT_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456")), - @Parameter(name = "projectName", description = "PROJECT_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "PROJECT_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "userName", description = "USER_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "code", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "123456")), + @Parameter(name = "projectName", description = "PROJECT_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "PROJECT_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "userName", description = "USER_NAME", schema = @Schema(implementation = String.class)), }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -128,7 +129,7 @@ public Result updateProject(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "queryProjectByCode", description = "QUERY_PROJECT_BY_ID_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456")) + @Parameter(name = "code", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "123456")) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -150,9 +151,9 @@ public Result queryProjectByCode(@Parameter(hidden = true) @RequestAttribute(val */ @Operation(summary = "queryProjectListPaging", description = "QUERY_PROJECT_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -182,7 +183,7 @@ public Result queryProjectListPaging(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "delete", description = "DELETE_PROJECT_BY_ID_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456")) + @Parameter(name = "code", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "123456")) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -202,7 +203,7 @@ public Result deleteProject(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "queryUnauthorizedProject", description = "QUERY_UNAUTHORIZED_PROJECT_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-project") @ResponseStatus(HttpStatus.OK) @@ -222,7 +223,7 @@ public Result queryUnauthorizedProject(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "queryAuthorizedProject", description = "QUERY_AUTHORIZED_PROJECT_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-project") @ResponseStatus(HttpStatus.OK) @@ -242,7 +243,7 @@ public Result queryAuthorizedProject(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "queryAuthorizedUser", description = "QUERY_AUTHORIZED_USER_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "100")) }) @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java index 610be8208c77..6d445bdd6e0a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectV2Controller.java @@ -27,11 +27,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_UNAUTHORIZED_PROJECT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROJECT_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.project.ProjectCreateRequest; import org.apache.dolphinscheduler.api.dto.project.ProjectCreateResponse; @@ -64,6 +59,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * project controller */ @@ -124,7 +125,7 @@ public ProjectUpdateResponse updateProject(@Parameter(hidden = true) @RequestAtt */ @Operation(summary = "queryProjectByCode", description = "QUERY_PROJECT_BY_ID_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "code", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -145,9 +146,9 @@ public ProjectQueryResponse queryProjectByCode(@Parameter(hidden = true) @Reques */ @Operation(summary = "queryProjectListPaging", description = "QUERY_PROJECT_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class, example = "test")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class, example = "test")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping(consumes = {"application/json"}) @ResponseStatus(HttpStatus.OK) @@ -174,7 +175,7 @@ public ProjectListPagingResponse queryProjectListPaging(@Parameter(hidden = true */ @Operation(summary = "delete", description = "DELETE_PROJECT_BY_ID_NOTES") @Parameters({ - @Parameter(name = "code", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "code", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -195,7 +196,7 @@ public ProjectDeleteResponse deleteProject(@Parameter(hidden = true) @RequestAtt */ @Operation(summary = "queryUnauthorizedProject", description = "QUERY_UNAUTHORIZED_PROJECT_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100", required = true)) + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class, example = "100", required = true)) }) @GetMapping(value = "/unauth-project") @ResponseStatus(HttpStatus.OK) @@ -216,7 +217,7 @@ public ProjectListResponse queryUnauthorizedProject(@Parameter(hidden = true) @R */ @Operation(summary = "queryAuthorizedProject", description = "QUERY_AUTHORIZED_PROJECT_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", schema =@Schema( implementation = int.class, example = "100", required = true)) + @Parameter(name = "userId", description = "USER_ID", schema = @Schema(implementation = int.class, example = "100", required = true)) }) @GetMapping(value = "/authed-project") @ResponseStatus(HttpStatus.OK) @@ -237,7 +238,7 @@ public ProjectListResponse queryAuthorizedProject(@Parameter(hidden = true) @Req */ @Operation(summary = "queryAuthorizedUser", description = "QUERY_AUTHORIZED_USER_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class, example = "100", required = true)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema = @Schema(implementation = long.class, example = "100", required = true)) }) @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @@ -257,7 +258,7 @@ public UserListResponse queryAuthorizedUser(@Parameter(hidden = true) @RequestAt */ @Operation(summary = "queryProjectCreatedAndAuthorizedByUser", description = "QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_NOTES") @Parameters({ - @Parameter(name = "loginUser", description = "LOGIN_USER", schema =@Schema( implementation = Object.class, example = "\"{id:100}\"", required = true)) + @Parameter(name = "loginUser", description = "LOGIN_USER", schema = @Schema(implementation = Object.class, example = "\"{id:100}\"", required = true)) }) @GetMapping(value = "/created-and-authed") @ResponseStatus(HttpStatus.OK) @@ -276,7 +277,7 @@ public ProjectListResponse queryProjectCreatedAndAuthorizedByUser(@Parameter(hid */ @Operation(summary = "queryAllProjectList", description = "QUERY_ALL_PROJECT_LIST_NOTES") @Parameters({ - @Parameter(name = "loginUser", description = "LOGIN_USER", schema =@Schema( implementation = Object.class, example = "\"{id:100}\"", required = true)) + @Parameter(name = "loginUser", description = "LOGIN_USER", schema = @Schema(implementation = Object.class, example = "\"{id:100}\"", required = true)) }) @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java index 241ff219544e..130669466160 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueController.java @@ -22,11 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_QUEUE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_QUEUE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.QueueService; @@ -47,6 +42,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * queue controller */ @@ -84,9 +85,9 @@ public Result queryList(@Parameter(hidden = true) @RequestAttribute(value = Cons */ @Operation(summary = "queryQueueListPaging", description = "QUERY_QUEUE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -116,8 +117,8 @@ public Result queryQueueListPaging(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "createQueue", description = "CREATE_QUEUE_NOTES") @Parameters({ - @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -140,9 +141,9 @@ public Result createQueue(@Parameter(hidden = true) @RequestAttribute(value = Co */ @Operation(summary = "updateQueue", description = "UPDATE_QUEUE_NOTES") @Parameters({ - @Parameter(name = "id", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "id", description = "QUEUE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) @@ -165,8 +166,8 @@ public Result updateQueue(@Parameter(hidden = true) @RequestAttribute(value = Co */ @Operation(summary = "verifyQueue", description = "VERIFY_QUEUE_NOTES") @Parameters({ - @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "queue", description = "YARN_QUEUE_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "queueName", description = "QUEUE_NAME", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/verify") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java index 2d5cde2028c9..ce9864ed5b75 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/QueueV2Controller.java @@ -22,11 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_QUEUE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_QUEUE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.queue.QueueCreateRequest; import org.apache.dolphinscheduler.api.dto.queue.QueueCreateResponse; @@ -41,8 +36,8 @@ import org.apache.dolphinscheduler.api.service.QueueService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; -import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.entity.User; +import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -56,6 +51,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * queue controller */ @@ -92,9 +93,9 @@ public QueueListResponse queryList(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "queryQueueListPaging", description = "QUERY_QUEUE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -142,14 +143,15 @@ public QueueCreateResponse createQueue(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "updateQueue", description = "UPDATE_QUEUE_NOTES") @Parameters({ - @Parameter(name = "id", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "QUEUE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @PutMapping(value = "/{id}", consumes = {"application/json"}) @ResponseStatus(HttpStatus.CREATED) @ApiException(UPDATE_QUEUE_ERROR) @AccessLogAnnotation(ignoreRequestArgs = "loginUser") public QueueUpdateResponse updateQueue(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, - @PathVariable(value = "id") int id, @RequestBody QueueUpdateRequest queueUpdateRequest) { + @PathVariable(value = "id") int id, + @RequestBody QueueUpdateRequest queueUpdateRequest) { Result result = queueService.updateQueue(loginUser, id, queueUpdateRequest.getQueue(), queueUpdateRequest.getQueueName()); return new QueueUpdateResponse(result); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java index aabfca069387..d00dbfe33028 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java @@ -41,11 +41,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.VIEW_RESOURCE_FILE_ON_LINE_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VIEW_UDF_FUNCTION_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.ResourcesService; @@ -82,6 +77,12 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * resources controller */ @@ -108,11 +109,11 @@ public class ResourcesController extends BaseController { */ @Operation(summary = "createDirectory", description = "CREATE_RESOURCE_NOTES") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), - @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)), + @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/directory") @ApiException(CREATE_RESOURCE_ERROR) @@ -134,12 +135,12 @@ public Result createDirectory(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "createResource", description = "CREATE_RESOURCE_NOTES") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), - @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema =@Schema( implementation = MultipartFile.class)), - @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)), + @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema = @Schema(implementation = MultipartFile.class)), + @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping() @ApiException(CREATE_RESOURCE_ERROR) @@ -168,11 +169,11 @@ public Result createResource(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "updateResource", description = "UPDATE_RESOURCE_NOTES") @Parameters({ - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), - @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema =@Schema( implementation = MultipartFile.class)) + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)), + @Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema = @Schema(implementation = MultipartFile.class)) }) @PutMapping(value = "/{id}") @ApiException(UPDATE_RESOURCE_ERROR) @@ -196,7 +197,7 @@ public Result updateResource(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "queryResourceList", description = "QUERY_RESOURCE_LIST_NOTES") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)) }) @GetMapping(value = "/list") @ResponseStatus(HttpStatus.OK) @@ -220,11 +221,11 @@ public Result queryResourceList(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "queryResourceListPaging", description = "QUERY_RESOURCE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)), + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -255,7 +256,7 @@ public Result queryResourceListPaging(@Parameter(hidden = true) @Request */ @Operation(summary = "deleteResource", description = "DELETE_RESOURCE_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -276,8 +277,8 @@ public Result deleteResource(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "verifyResourceName", description = "VERIFY_RESOURCE_NAME_NOTES") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), - @Parameter(name = "fullName", description = "RESOURCE_FULL_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)), + @Parameter(name = "fullName", description = "RESOURCE_FULL_NAME", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/verify-name") @ResponseStatus(HttpStatus.OK) @@ -298,7 +299,7 @@ public Result verifyResourceName(@Parameter(hidden = true) @RequestAttri */ @Operation(summary = "queryResourceByProgramType", description = "QUERY_RESOURCE_LIST_NOTES") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)) }) @GetMapping(value = "/query-by-type") @ResponseStatus(HttpStatus.OK) @@ -321,9 +322,9 @@ public Result queryResourceJarList(@Parameter(hidden = true) @RequestAtt */ @Operation(summary = "queryResource", description = "QUERY_BY_RESOURCE_NAME") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), - @Parameter(name = "fullName", description = "RESOURCE_FULL_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "id", description = "RESOURCE_ID", required = false, schema =@Schema( implementation = int.class, example = "10")) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)), + @Parameter(name = "fullName", description = "RESOURCE_FULL_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "id", description = "RESOURCE_ID", required = false, schema = @Schema(implementation = int.class, example = "10")) }) @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -348,9 +349,9 @@ public Result queryResource(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "viewResource", description = "VIEW_RESOURCE_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "limit", description = "LIMIT", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "skipLineNum", description = "SKIP_LINE_NUM", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "limit", description = "LIMIT", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/view") @ApiException(VIEW_RESOURCE_FILE_ON_LINE_ERROR) @@ -369,13 +370,13 @@ public Result viewResource(@Parameter(hidden = true) @RequestAttribute(value = C */ @Operation(summary = "onlineCreateResource", description = "ONLINE_CREATE_RESOURCE_NOTES") @Parameters({ - @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema =@Schema( implementation = ResourceType.class)), - @Parameter(name = "fileName", description = "RESOURCE_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "suffix", description = "SUFFIX", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "RESOURCE_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "content", description = "CONTENT", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "currentDir", description = "RESOURCE_CURRENTDIR", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)), + @Parameter(name = "fileName", description = "RESOURCE_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "suffix", description = "SUFFIX", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "RESOURCE_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "content", description = "CONTENT", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "currentDir", description = "RESOURCE_CURRENTDIR", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/online-create") @ApiException(CREATE_RESOURCE_FILE_ON_LINE_ERROR) @@ -406,8 +407,8 @@ public Result onlineCreateResource(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "updateResourceContent", description = "UPDATE_RESOURCE_NOTES") @Parameters({ - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "content", description = "CONTENT", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "content", description = "CONTENT", required = true, schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{id}/update-content") @ApiException(EDIT_RESOURCE_FILE_ON_LINE_ERROR) @@ -431,7 +432,7 @@ public Result updateResourceContent(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "downloadResource", description = "DOWNLOAD_RESOURCE_NOTES") @Parameters({ - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/download") @ResponseBody @@ -464,13 +465,13 @@ public ResponseEntity downloadResource(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "createUdfFunc", description = "CREATE_UDF_FUNCTION_NOTES") @Parameters({ - @Parameter(name = "type", description = "UDF_TYPE", required = true, schema =@Schema( implementation = UdfType.class)), - @Parameter(name = "funcName", description = "FUNC_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "className", description = "CLASS_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "argTypes", description = "ARG_TYPES", schema =@Schema( implementation = String.class)), - @Parameter(name = "database", description = "DATABASE_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "UDF_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "resourceId", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "type", description = "UDF_TYPE", required = true, schema = @Schema(implementation = UdfType.class)), + @Parameter(name = "funcName", description = "FUNC_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "className", description = "CLASS_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "argTypes", description = "ARG_TYPES", schema = @Schema(implementation = String.class)), + @Parameter(name = "database", description = "DATABASE_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "UDF_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "resourceId", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @PostMapping(value = "/{resourceId}/udf-func") @@ -499,7 +500,7 @@ public Result createUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "viewUIUdfFunction", description = "VIEW_UDF_FUNCTION_NOTES") @Parameters({ - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{id}/udf-func") @@ -527,14 +528,14 @@ public Result viewUIUdfFunction(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "updateUdfFunc", description = "UPDATE_UDF_FUNCTION_NOTES") @Parameters({ - @Parameter(name = "id", description = "UDF_ID", required = true, schema =@Schema( implementation = int.class)), - @Parameter(name = "type", description = "UDF_TYPE", required = true, schema =@Schema( implementation = UdfType.class)), - @Parameter(name = "funcName", description = "FUNC_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "className", description = "CLASS_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "argTypes", description = "ARG_TYPES", schema =@Schema( implementation = String.class)), - @Parameter(name = "database", description = "DATABASE_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "UDF_DESC", schema =@Schema( implementation = String.class)), - @Parameter(name = "resourceId", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "UDF_ID", required = true, schema = @Schema(implementation = int.class)), + @Parameter(name = "type", description = "UDF_TYPE", required = true, schema = @Schema(implementation = UdfType.class)), + @Parameter(name = "funcName", description = "FUNC_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "className", description = "CLASS_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "argTypes", description = "ARG_TYPES", schema = @Schema(implementation = String.class)), + @Parameter(name = "database", description = "DATABASE_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "UDF_DESC", schema = @Schema(implementation = String.class)), + @Parameter(name = "resourceId", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @PutMapping(value = "/{resourceId}/udf-func/{id}") @@ -564,9 +565,9 @@ public Result updateUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "queryUdfFuncListPaging", description = "QUERY_UDF_FUNCTION_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping(value = "/udf-func") @ResponseStatus(HttpStatus.OK) @@ -592,7 +593,7 @@ public Result queryUdfFuncListPaging(@Parameter(hidden = true) @RequestA */ @Operation(summary = "queryUdfFuncList", description = "QUERY_UDF_FUNC_LIST_NOTES") @Parameters({ - @Parameter(name = "type", description = "UDF_TYPE", required = true, schema =@Schema( implementation = UdfType.class)) + @Parameter(name = "type", description = "UDF_TYPE", required = true, schema = @Schema(implementation = UdfType.class)) }) @GetMapping(value = "/udf-func/list") @ResponseStatus(HttpStatus.OK) @@ -612,7 +613,7 @@ public Result queryUdfFuncList(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "verifyUdfFuncName", description = "VERIFY_UDF_FUNCTION_NAME_NOTES") @Parameters({ - @Parameter(name = "name", description = "FUNC_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "name", description = "FUNC_NAME", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/udf-func/verify-name") @@ -633,7 +634,7 @@ public Result verifyUdfFuncName(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "deleteUdfFunc", description = "DELETE_UDF_FUNCTION_NOTES") @Parameters({ - @Parameter(name = "id", description = "UDF_FUNC_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "UDF_FUNC_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/udf-func/{id}") @ResponseStatus(HttpStatus.OK) @@ -653,7 +654,7 @@ public Result deleteUdfFunc(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "authorizedFile", description = "AUTHORIZED_FILE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-file") @ResponseStatus(HttpStatus.CREATED) @@ -674,7 +675,7 @@ public Result authorizedFile(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "authorizeResourceTree", description = "AUTHORIZE_RESOURCE_TREE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-resource-tree") @ResponseStatus(HttpStatus.CREATED) @@ -695,7 +696,7 @@ public Result authorizeResourceTree(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "unauthUDFFunc", description = "UNAUTHORIZED_UDF_FUNC_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/unauth-udf-func") @ResponseStatus(HttpStatus.CREATED) @@ -717,7 +718,7 @@ public Result unauthUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "authUDFFunc", description = "AUTHORIZED_UDF_FUNC_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/authed-udf-func") @ResponseStatus(HttpStatus.CREATED) @@ -738,7 +739,7 @@ public Result authorizedUDFFunction(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "queryResourceById", description = "QUERY_BY_RESOURCE_NAME") @Parameters({ - @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema =@Schema( implementation = int.class, example = "10")) + @Parameter(name = "id", description = "RESOURCE_ID", required = true, schema = @Schema(implementation = int.class, example = "10")) }) @GetMapping(value = "/{id}/query") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java index 056579612bc0..87dd6658d4de 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java @@ -23,11 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_SCHEDULE_LIST_PAGING_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_SCHEDULE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.schedule.ScheduleCreateRequest; import org.apache.dolphinscheduler.api.dto.schedule.ScheduleFilterRequest; @@ -53,6 +48,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * schedule controller */ @@ -90,7 +91,7 @@ public Result createSchedule(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "delete", description = "DELETE_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "id", description = "SCHEDULE_ID", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "id", description = "SCHEDULE_ID", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java index 364b0e31ded7..f20609594583 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java @@ -27,11 +27,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_SCHEDULE_ERROR; import static org.apache.dolphinscheduler.common.Constants.SESSION_USER; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -59,6 +54,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * scheduler controller */ @@ -91,14 +92,14 @@ public class SchedulerController extends BaseController { */ @Operation(summary = "createSchedule", description = "CREATE_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")), - @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','timezoneId':'America/Phoenix','crontab':'0 0 3/6 * * ? *'}")), - @Parameter(name = "warningType", description = "WARNING_TYPE", schema =@Schema( implementation = WarningType.class)), - @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema =@Schema( implementation = FailureStrategy.class)), - @Parameter(name = "workerGroupId", description = "WORKER_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class)), - @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema =@Schema( implementation = Priority.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")), + @Parameter(name = "schedule", description = "SCHEDULE", schema = @Schema(implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','timezoneId':'America/Phoenix','crontab':'0 0 3/6 * * ? *'}")), + @Parameter(name = "warningType", description = "WARNING_TYPE", schema = @Schema(implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema = @Schema(implementation = FailureStrategy.class)), + @Parameter(name = "workerGroupId", description = "WORKER_GROUP_ID", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema = @Schema(implementation = long.class)), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema = @Schema(implementation = Priority.class)), }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -137,14 +138,14 @@ public Result createSchedule(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "updateSchedule", description = "UPDATE_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), - @Parameter(name = "warningType", description = "WARNING_TYPE", schema =@Schema( implementation = WarningType.class)), - @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema =@Schema( implementation = FailureStrategy.class)), - @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), - @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema =@Schema( implementation = Priority.class)), - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class)), + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "schedule", description = "SCHEDULE", schema = @Schema(implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), + @Parameter(name = "warningType", description = "WARNING_TYPE", schema = @Schema(implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema = @Schema(implementation = FailureStrategy.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema = @Schema(implementation = String.class, example = "default")), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema = @Schema(implementation = Priority.class)), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema = @Schema(implementation = long.class)), }) @PutMapping("/{id}") @ResponseStatus(HttpStatus.OK) @@ -176,7 +177,7 @@ public Result updateSchedule(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "online", description = "ONLINE_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @PostMapping("/{id}/online") @ApiException(PUBLISH_SCHEDULE_ONLINE_ERROR) @@ -198,7 +199,7 @@ public Result publishScheduleOnline(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "offline", description = "OFFLINE_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @PostMapping("/{id}/offline") @ApiException(OFFLINE_SCHEDULE_ERROR) @@ -225,10 +226,10 @@ public Result offlineSchedule(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "queryScheduleListPaging", description = "QUERY_SCHEDULE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "processDefinitionId", description = "PROCESS_DEFINITION_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "processDefinitionId", description = "PROCESS_DEFINITION_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ApiException(QUERY_SCHEDULE_LIST_PAGING_ERROR) @@ -260,7 +261,7 @@ public Result queryScheduleListPaging(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "deleteScheduleById", description = "DELETE_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "SCHEDULE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -299,7 +300,7 @@ public Result queryScheduleList(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "previewSchedule", description = "PREVIEW_SCHEDULE_NOTES") @Parameters({ - @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), + @Parameter(name = "schedule", description = "SCHEDULE", schema = @Schema(implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), }) @PostMapping("/preview") @ResponseStatus(HttpStatus.CREATED) @@ -327,14 +328,14 @@ public Result previewSchedule(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "updateScheduleByProcessDefinitionCode", description = "UPDATE_SCHEDULE_BY_PROCESS_DEFINITION_CODE_NOTES") @Parameters({ - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "12345678")), - @Parameter(name = "schedule", description = "SCHEDULE", schema =@Schema( implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), - @Parameter(name = "warningType", description = "WARNING_TYPE", schema =@Schema( implementation = WarningType.class)), - @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema =@Schema( implementation = FailureStrategy.class)), - @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema =@Schema( implementation = String.class, example = "default")), - @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema =@Schema( implementation = Priority.class)), - @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema =@Schema( implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "12345678")), + @Parameter(name = "schedule", description = "SCHEDULE", schema = @Schema(implementation = String.class, example = "{'startTime':'2019-06-10 00:00:00','endTime':'2019-06-13 00:00:00','crontab':'0 0 3/6 * * ? *'}")), + @Parameter(name = "warningType", description = "WARNING_TYPE", schema = @Schema(implementation = WarningType.class)), + @Parameter(name = "warningGroupId", description = "WARNING_GROUP_ID", schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "failureStrategy", description = "FAILURE_STRATEGY", schema = @Schema(implementation = FailureStrategy.class)), + @Parameter(name = "workerGroup", description = "WORKER_GROUP", schema = @Schema(implementation = String.class, example = "default")), + @Parameter(name = "processInstancePriority", description = "PROCESS_INSTANCE_PRIORITY", schema = @Schema(implementation = Priority.class)), + @Parameter(name = "environmentCode", description = "ENVIRONMENT_CODE", schema = @Schema(implementation = long.class)), }) @PutMapping("/update/{code}") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java index a77e4cb626e3..44f6fb99492b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java @@ -28,11 +28,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.SWITCH_TASK_DEFINITION_VERSION_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_DEFINITION_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -61,6 +56,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * task definition controller */ @@ -82,8 +83,8 @@ public class TaskDefinitionController extends BaseController { */ @Operation(summary = "save", description = "CREATE_TASK_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -109,10 +110,10 @@ public Result createTaskDefinition(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "saveSingle", description = "CREATE_SINGLE_TASK_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema =@Schema( implementation = String.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema = @Schema(implementation = String.class)) }) @PostMapping("/save-single") @ResponseStatus(HttpStatus.CREATED) @@ -139,9 +140,9 @@ public Result createTaskBindsWorkFlow(@Parameter(hidden = true) @RequestAttribut */ @Operation(summary = "update", description = "UPDATE_TASK_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), - @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")), + @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -168,10 +169,10 @@ public Result updateTaskDefinition(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "updateWithUpstream", description = "UPDATE_TASK_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), - @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema =@Schema( implementation = String.class)) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")), + @Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{code}/with-upstream") @ResponseStatus(HttpStatus.OK) @@ -200,9 +201,9 @@ public Result updateTaskWithUpstream(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "queryVersions", description = "QUERY_TASK_DEFINITION_VERSIONS_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")) }) @GetMapping(value = "/{code}/versions") @ResponseStatus(HttpStatus.OK) @@ -231,8 +232,8 @@ public Result queryTaskDefinitionVersions(@Parameter(hidden = true) @RequestAttr */ @Operation(summary = "switchVersion", description = "SWITCH_TASK_DEFINITION_VERSION_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), - @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @GetMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @@ -257,8 +258,8 @@ public Result switchTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttr */ @Operation(summary = "deleteVersion", description = "DELETE_TASK_DEFINITION_VERSION_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")), - @Parameter(name = "version", description = "VERSION", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")), + @Parameter(name = "version", description = "VERSION", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{code}/versions/{version}") @ResponseStatus(HttpStatus.OK) @@ -283,7 +284,7 @@ public Result deleteTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttr */ @Operation(summary = "deleteTaskDefinition", description = "DELETE_TASK_DEFINITION_BY_CODE_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -306,7 +307,7 @@ public Result deleteTaskDefinitionByCode(@Parameter(hidden = true) @RequestAttri */ @Operation(summary = "queryTaskDefinitionByCode", description = "QUERY_TASK_DEFINITION_DETAIL_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "1")) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -334,13 +335,13 @@ public Result queryTaskDefinitionDetail(@Parameter(hidden = true) @RequestAttrib */ @Operation(summary = "queryTaskDefinitionListPaging", description = "QUERY_TASK_DEFINITION_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = false, schema =@Schema( implementation = long.class)), - @Parameter(name = "searchWorkflowName", description = "SEARCH_WORKFLOW_NAME", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "searchTaskName", description = "SEARCH_TASK_NAME", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "taskType", description = "TASK_TYPE", required = false, schema =@Schema( implementation = String.class, example = "SHELL")), - @Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema =@Schema( implementation = TaskExecuteType.class, example = "STREAM")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")) + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = false, schema = @Schema(implementation = long.class)), + @Parameter(name = "searchWorkflowName", description = "SEARCH_WORKFLOW_NAME", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "searchTaskName", description = "SEARCH_TASK_NAME", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "taskType", description = "TASK_TYPE", required = false, schema = @Schema(implementation = String.class, example = "SHELL")), + @Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema = @Schema(implementation = TaskExecuteType.class, example = "STREAM")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -373,7 +374,7 @@ public Result queryTaskDefinitionListPaging(@Parameter(hidden = true) @RequestAt */ @Operation(summary = "genTaskCodeList", description = "GEN_TASK_CODE_LIST_NOTES") @Parameters({ - @Parameter(name = "genNum", description = "GEN_NUM", required = true, schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "genNum", description = "GEN_NUM", required = true, schema = @Schema(implementation = int.class, example = "1")) }) @GetMapping(value = "/gen-task-codes") @ResponseStatus(HttpStatus.OK) @@ -396,9 +397,9 @@ public Result genTaskCodeList(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "releaseTaskDefinition", description = "RELEASE_TASK_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), - @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, schema =@Schema( implementation = ReleaseState.class)) + @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")), + @Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, schema = @Schema(implementation = ReleaseState.class)) }) @PostMapping(value = "/{code}/release") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java index 61c3168a6543..71bbf5aef992 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionV2Controller.java @@ -23,11 +23,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_DEFINITION_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.task.TaskCreateRequest; import org.apache.dolphinscheduler.api.dto.task.TaskFilterRequest; @@ -53,6 +48,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * task definition controller */ @@ -90,7 +91,7 @@ public Result createTaskDefinition(@Parameter(hidden = true) @Re */ @Operation(summary = "delete", description = "DELETE_TASK_DEFINITION_VERSION_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -112,7 +113,7 @@ public Result deleteTaskDefinition(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "update", description = "UPDATE_TASK_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @PutMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) @@ -135,7 +136,7 @@ public Result updateTaskDefinition(@Parameter(hidden = true) @Re */ @Operation(summary = "get", description = "GET_TASK_DEFINITION_NOTES") @Parameters({ - @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "code", description = "TASK_DEFINITION_CODE", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @GetMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java index 7603c46779df..a1067968afcc 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskGroupController.java @@ -24,11 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.START_TASK_GROUP_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_GROUP_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TaskGroupQueueService; @@ -49,6 +44,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * task group controller */ @@ -72,10 +73,10 @@ public class TaskGroupController extends BaseController { */ @Operation(summary = "create", description = "CREATE_TASK_GROUP_NOTE") @Parameters({ - @Parameter(name = "name", description = "NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "projectCode", description = "PROJECT_CODE", schema =@Schema( implementation = long.class)), - @Parameter(name = "description", description = "DESCRIPTION", schema =@Schema( implementation = String.class)), - @Parameter(name = "groupSize", description = "GROUPSIZE", schema =@Schema( implementation = int.class)), + @Parameter(name = "name", description = "NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "projectCode", description = "PROJECT_CODE", schema = @Schema(implementation = long.class)), + @Parameter(name = "description", description = "DESCRIPTION", schema = @Schema(implementation = String.class)), + @Parameter(name = "groupSize", description = "GROUPSIZE", schema = @Schema(implementation = int.class)), }) @PostMapping(value = "/create") @@ -104,10 +105,10 @@ public Result createTaskGroup(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "update", description = "UPDATE_TASK_GROUP_NOTE") @Parameters({ - @Parameter(name = "id", description = "id", schema =@Schema( implementation = int.class)), - @Parameter(name = "name", description = "NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "DESCRIPTION", schema =@Schema( implementation = String.class)), - @Parameter(name = "groupSize", description = "GROUPSIZE", schema =@Schema( implementation = int.class)), + @Parameter(name = "id", description = "id", schema = @Schema(implementation = int.class)), + @Parameter(name = "name", description = "NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "DESCRIPTION", schema = @Schema(implementation = String.class)), + @Parameter(name = "groupSize", description = "GROUPSIZE", schema = @Schema(implementation = int.class)), }) @PostMapping(value = "/update") @@ -133,9 +134,9 @@ public Result updateTaskGroup(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "list-paging", description = "QUERY_ALL_TASK_GROUP_NOTES") @Parameters({ - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "name", description = "NAME", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "name", description = "NAME", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @@ -161,9 +162,9 @@ public Result queryAllTaskGroup(@Parameter(hidden = true) @RequestAttribute(valu */ @Operation(summary = "queryTaskGroupByStatus", description = "QUERY_TASK_GROUP_LIST_BY_STATUS_NOTES") @Parameters({ - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), - @Parameter(name = "status", description = "status", required = true, schema =@Schema( implementation = int.class)) + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")), + @Parameter(name = "status", description = "status", required = true, schema = @Schema(implementation = int.class)) }) @GetMapping(value = "/query-list-by-status") @ResponseStatus(HttpStatus.OK) @@ -188,9 +189,9 @@ public Result queryTaskGroupByStatus(@Parameter(hidden = true) @RequestAttribute */ @Operation(summary = "queryTaskGroupByName", description = "QUERY_TASK_GROUP_LIST_BY_PROJECT_ID_NOTES") @Parameters({ - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/query-list-by-projectCode") @ResponseStatus(HttpStatus.OK) @@ -214,7 +215,7 @@ public Result queryTaskGroupByCode(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "closeTaskGroup", description = "CLOSE_TASK_GROUP_NOTES") @Parameters({ - @Parameter(name = "id", description = "ID", required = true, schema =@Schema( implementation = int.class)) + @Parameter(name = "id", description = "ID", required = true, schema = @Schema(implementation = int.class)) }) @PostMapping(value = "/close-task-group") @ResponseStatus(HttpStatus.CREATED) @@ -236,7 +237,7 @@ public Result closeTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "startTaskGroup", description = "START_TASK_GROUP_NOTES") @Parameters({ - @Parameter(name = "id", description = "ID", required = true, schema =@Schema( implementation = int.class)) + @Parameter(name = "id", description = "ID", required = true, schema = @Schema(implementation = int.class)) }) @PostMapping(value = "/start-task-group") @ResponseStatus(HttpStatus.CREATED) @@ -257,7 +258,7 @@ public Result startTaskGroup(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "forceStart", description = "WAKE_TASK_COMPULSIVELY_NOTES") @Parameters({ - @Parameter(name = "queueId", description = "TASK_GROUP_QUEUEID", required = true, schema =@Schema( implementation = int.class)) + @Parameter(name = "queueId", description = "TASK_GROUP_QUEUEID", required = true, schema = @Schema(implementation = int.class)) }) @PostMapping(value = "/forceStart") @ResponseStatus(HttpStatus.CREATED) @@ -278,8 +279,8 @@ public Result forceStart(@Parameter(hidden = true) @RequestAttribute(value = Con */ @Operation(summary = "modifyPriority", description = "WAKE_TASK_COMPULSIVELY_NOTES") @Parameters({ - @Parameter(name = "queueId", description = "TASK_GROUP_QUEUEID", required = true, schema =@Schema( implementation = int.class)), - @Parameter(name = "priority", description = "TASK_GROUP_QUEUE_PRIORITY", required = true, schema =@Schema( implementation = int.class)) + @Parameter(name = "queueId", description = "TASK_GROUP_QUEUEID", required = true, schema = @Schema(implementation = int.class)), + @Parameter(name = "priority", description = "TASK_GROUP_QUEUE_PRIORITY", required = true, schema = @Schema(implementation = int.class)) }) @PostMapping(value = "/modifyPriority") @ResponseStatus(HttpStatus.CREATED) @@ -309,12 +310,12 @@ public Result modifyPriority(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "queryTasksByGroupId", description = "QUERY_ALL_TASKS_NOTES") @Parameters({ - @Parameter(name = "groupId", description = "GROUP_ID", required = false, schema =@Schema( implementation = int.class, example = "1", defaultValue = "-1")), - @Parameter(name = "taskInstanceName", description = "TASK_INSTANCE_NAME", required = false, schema =@Schema( implementation = String.class, example = "taskName")), - @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", required = false, schema =@Schema( implementation = String.class, example = "processName")), - @Parameter(name = "status", description = "STATUS", required = false, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "groupId", description = "GROUP_ID", required = false, schema = @Schema(implementation = int.class, example = "1", defaultValue = "-1")), + @Parameter(name = "taskInstanceName", description = "TASK_INSTANCE_NAME", required = false, schema = @Schema(implementation = String.class, example = "taskName")), + @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", required = false, schema = @Schema(implementation = String.class, example = "processName")), + @Parameter(name = "status", description = "STATUS", required = false, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping(value = "/query-list-by-group-id") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java index 698d47422814..f8c61a89be41 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java @@ -22,11 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.TASK_SAVEPOINT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.TASK_STOP_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TaskInstanceService; @@ -50,6 +45,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * task instance controller */ @@ -80,18 +81,18 @@ public class TaskInstanceController extends BaseController { */ @Operation(summary = "queryTaskListPaging", description = "QUERY_TASK_INSTANCE_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = false, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "taskName", description = "TASK_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema =@Schema( implementation = String.class)), - @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema =@Schema( implementation = TaskExecutionStatus.class)), - @Parameter(name = "host", description = "HOST", schema =@Schema( implementation = String.class)), - @Parameter(name = "startDate", description = "START_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "endDate", description = "END_DATE", schema =@Schema( implementation = String.class)), - @Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema =@Schema( implementation = TaskExecuteType.class, example = "STREAM")), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), + @Parameter(name = "processInstanceId", description = "PROCESS_INSTANCE_ID", required = false, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "processInstanceName", description = "PROCESS_INSTANCE_NAME", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "taskName", description = "TASK_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "executorName", description = "EXECUTOR_NAME", schema = @Schema(implementation = String.class)), + @Parameter(name = "stateType", description = "EXECUTION_STATUS", schema = @Schema(implementation = TaskExecutionStatus.class)), + @Parameter(name = "host", description = "HOST", schema = @Schema(implementation = String.class)), + @Parameter(name = "startDate", description = "START_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "endDate", description = "END_DATE", schema = @Schema(implementation = String.class)), + @Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema = @Schema(implementation = TaskExecuteType.class, example = "STREAM")), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")), }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -134,7 +135,7 @@ public Result queryTaskListPaging(@Parameter(hidden = true) @RequestAttribute(va */ @Operation(summary = "force-success", description = "FORCE_TASK_SUCCESS") @Parameters({ - @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "12")) + @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "12")) }) @PostMapping(value = "/{id}/force-success") @ResponseStatus(HttpStatus.OK) @@ -157,7 +158,7 @@ public Result forceTaskSuccess(@Parameter(hidden = true) @RequestAttribu */ @Operation(summary = "savepoint", description = "TASK_SAVEPOINT") @Parameters({ - @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "12")) + @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "12")) }) @PostMapping(value = "/{id}/savepoint") @ResponseStatus(HttpStatus.OK) @@ -179,7 +180,7 @@ public Result taskSavePoint(@Parameter(hidden = true) @RequestAttribute( */ @Operation(summary = "stop", description = "TASK_STOP") @Parameters({ - @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema =@Schema( implementation = int.class, example = "12")) + @Parameter(name = "id", description = "TASK_INSTANCE_ID", required = true, schema = @Schema(implementation = int.class, example = "12")) }) @PostMapping(value = "/{id}/stop") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java index 2a087efd76d8..1fd5206cfe30 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TenantController.java @@ -24,11 +24,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TENANT_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_OS_TENANT_CODE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.TenantService; @@ -52,6 +47,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * tenant controller */ @@ -74,9 +75,9 @@ public class TenantController extends BaseController { */ @Operation(summary = "createTenant", description = "CREATE_TENANT_NOTES") @Parameters({ - @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "queueId", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "description", description = "TENANT_DESC", schema =@Schema( implementation = String.class)) + @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "queueId", description = "QUEUE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "description", description = "TENANT_DESC", schema = @Schema(implementation = String.class)) }) @PostMapping() @ResponseStatus(HttpStatus.CREATED) @@ -102,9 +103,9 @@ public Result createTenant(@Parameter(hidden = true) @RequestAttribute(value = C */ @Operation(summary = "queryTenantlistPaging", description = "QUERY_TENANT_LIST_PAGING_NOTES") @Parameters({ - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)), - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")) + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)), + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -152,10 +153,10 @@ public Result queryTenantlist(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "updateTenant", description = "UPDATE_TENANT_NOTES") @Parameters({ - @Parameter(name = "id", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "queueId", description = "QUEUE_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "description", description = "TENANT_DESC", schema =@Schema( implementation = String.class)) + @Parameter(name = "id", description = "TENANT_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "queueId", description = "QUEUE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "description", description = "TENANT_DESC", schema = @Schema(implementation = String.class)) }) @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -180,7 +181,7 @@ public Result updateTenant(@Parameter(hidden = true) @RequestAttribute(value = C */ @Operation(summary = "deleteTenantById", description = "DELETE_TENANT_NOTES") @Parameters({ - @Parameter(name = "id", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "TENANT_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) @@ -201,7 +202,7 @@ public Result deleteTenantById(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "verifyTenantCode", description = "VERIFY_TENANT_CODE_NOTES") @Parameters({ - @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/verify-code") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java index 24e6731de9d2..8b6dd9d161ea 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java @@ -19,11 +19,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PLUGINS_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.UiPluginService; @@ -44,6 +39,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * ui plugin controller * Some plugins (such as alert plugin) need to provide UI interfaces to users. @@ -60,7 +61,7 @@ public class UiPluginController extends BaseController { @Operation(summary = "queryUiPluginsByType", description = "QUERY_UI_PLUGINS_BY_TYPE") @Parameters({ - @Parameter(name = "pluginType", description = "pluginType", required = true, schema =@Schema( implementation = PluginType.class)), + @Parameter(name = "pluginType", description = "pluginType", required = true, schema = @Schema(implementation = PluginType.class)), }) @GetMapping(value = "/query-by-type") @ResponseStatus(HttpStatus.CREATED) @@ -75,7 +76,7 @@ public Result queryUiPluginsByType(@Parameter(hidden = true) @RequestAttribute(v @Operation(summary = "queryUiPluginDetailById", description = "QUERY_UI_PLUGIN_DETAIL_BY_ID") @Parameters({ - @Parameter(name = "id", description = "PLUGIN_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), + @Parameter(name = "id", description = "PLUGIN_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), }) @GetMapping(value = "/{id}") @ResponseStatus(HttpStatus.CREATED) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java index 0200993c989d..206c6438456f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UsersController.java @@ -33,11 +33,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.USER_LIST_ERROR; import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_USERNAME_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -64,6 +59,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * users controller */ @@ -91,13 +92,13 @@ public class UsersController extends BaseController { */ @Operation(summary = "createUser", description = "CREATE_USER_NOTES") @Parameters({ - @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "tenantId", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "queue", description = "QUEUE", schema =@Schema( implementation = String.class)), - @Parameter(name = "email", description = "EMAIL", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "phone", description = "PHONE", schema =@Schema( implementation = String.class)), - @Parameter(name = "state", description = "STATE", schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "userName", description = "USER_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "tenantId", description = "TENANT_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "queue", description = "QUEUE", schema = @Schema(implementation = String.class)), + @Parameter(name = "email", description = "EMAIL", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "phone", description = "PHONE", schema = @Schema(implementation = String.class)), + @Parameter(name = "state", description = "STATE", schema = @Schema(implementation = int.class, example = "1")) }) @PostMapping(value = "/create") @ResponseStatus(HttpStatus.CREATED) @@ -127,9 +128,9 @@ public Result createUser(@Parameter(hidden = true) @RequestAttribute(value = Con */ @Operation(summary = "queryUserList", description = "QUERY_USER_LIST_NOTES") @Parameters({ - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "10")), - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)) + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/list-paging") @ResponseStatus(HttpStatus.OK) @@ -164,14 +165,14 @@ public Result queryUserList(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "updateUser", description = "UPDATE_USER_NOTES") @Parameters({ - @Parameter(name = "id", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "tenantId", description = "TENANT_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "queue", description = "QUEUE", schema =@Schema( implementation = String.class)), - @Parameter(name = "email", description = "EMAIL", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "phone", description = "PHONE", schema =@Schema( implementation = String.class)), - @Parameter(name = "state", description = "STATE", schema =@Schema( implementation = int.class, example = "1")) + @Parameter(name = "id", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "userName", description = "USER_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "tenantId", description = "TENANT_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "queue", description = "QUEUE", schema = @Schema(implementation = String.class)), + @Parameter(name = "email", description = "EMAIL", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "phone", description = "PHONE", schema = @Schema(implementation = String.class)), + @Parameter(name = "state", description = "STATE", schema = @Schema(implementation = int.class, example = "1")) }) @PostMapping(value = "/update") @ResponseStatus(HttpStatus.OK) @@ -201,7 +202,7 @@ public Result updateUser(@Parameter(hidden = true) @RequestAttribute(value = Con */ @Operation(summary = "delUserById", description = "DELETE_USER_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")) + @Parameter(name = "id", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")) }) @PostMapping(value = "/delete") @ResponseStatus(HttpStatus.OK) @@ -223,8 +224,8 @@ public Result delUserById(@Parameter(hidden = true) @RequestAttribute(value = Co */ @Operation(summary = "grantProject", description = "GRANT_PROJECT_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "projectIds", description = "PROJECT_IDS", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "projectIds", description = "PROJECT_IDS", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/grant-project") @ResponseStatus(HttpStatus.OK) @@ -247,8 +248,8 @@ public Result grantProject(@Parameter(hidden = true) @RequestAttribute(value = C */ @Operation(summary = "grantProjectByCode", description = "GRANT_PROJECT_BY_CODE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class)) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)) }) @PostMapping(value = "/grant-project-by-code") @ResponseStatus(HttpStatus.OK) @@ -271,8 +272,8 @@ public Result grantProjectByCode(@Parameter(hidden = true) @RequestAttribute(val */ @Operation(summary = "revokeProject", description = "REVOKE_PROJECT_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema =@Schema( implementation = long.class, example = "100")) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class, example = "100")) }) @PostMapping(value = "/revoke-project") @ResponseStatus(HttpStatus.OK) @@ -295,8 +296,8 @@ public Result revokeProject(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "grantResource", description = "GRANT_RESOURCE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "resourceIds", description = "RESOURCE_IDS", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "resourceIds", description = "RESOURCE_IDS", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/grant-file") @ResponseStatus(HttpStatus.OK) @@ -319,8 +320,8 @@ public Result grantResource(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "grantUDFFunc", description = "GRANT_UDF_FUNC_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "udfIds", description = "UDF_IDS", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "udfIds", description = "UDF_IDS", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/grant-udf-func") @ResponseStatus(HttpStatus.OK) @@ -343,8 +344,8 @@ public Result grantUDFFunc(@Parameter(hidden = true) @RequestAttribute(value = C */ @Operation(summary = "grantNamespace", description = "GRANT_NAMESPACE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "namespaceIds", description = "NAMESPACE_IDS", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "namespaceIds", description = "NAMESPACE_IDS", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/grant-namespace") @ResponseStatus(HttpStatus.OK) @@ -367,8 +368,8 @@ public Result grantNamespace(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "grantDataSource", description = "GRANT_DATASOURCE_NOTES") @Parameters({ - @Parameter(name = "userId", description = "USER_ID", required = true, schema =@Schema( implementation = int.class, example = "100")), - @Parameter(name = "datasourceIds", description = "DATASOURCE_IDS", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "userId", description = "USER_ID", required = true, schema = @Schema(implementation = int.class, example = "100")), + @Parameter(name = "datasourceIds", description = "DATASOURCE_IDS", required = true, schema = @Schema(implementation = String.class)) }) @PostMapping(value = "/grant-datasource") @ResponseStatus(HttpStatus.OK) @@ -437,7 +438,7 @@ public Result listAll(@RequestAttribute(value = Constants.SESSION_USER) User log */ @Operation(summary = "verifyUserName", description = "VERIFY_USER_NAME_NOTES") @Parameters({ - @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "userName", description = "USER_NAME", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/verify-user-name") @ResponseStatus(HttpStatus.OK) @@ -457,7 +458,7 @@ public Result verifyUserName(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "unauthorizedUser", description = "UNAUTHORIZED_USER_NOTES") @Parameters({ - @Parameter(name = "alertgroupId", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "alertgroupId", description = "ALERT_GROUP_ID", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/unauth-user") @ResponseStatus(HttpStatus.OK) @@ -478,7 +479,7 @@ public Result unauthorizedUser(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "authorizedUser", description = "AUTHORIZED_USER_NOTES") @Parameters({ - @Parameter(name = "alertgroupId", description = "ALERT_GROUP_ID", required = true, schema =@Schema( implementation = String.class)) + @Parameter(name = "alertgroupId", description = "ALERT_GROUP_ID", required = true, schema = @Schema(implementation = String.class)) }) @GetMapping(value = "/authed-user") @ResponseStatus(HttpStatus.OK) @@ -505,10 +506,10 @@ public Result authorizedUser(@Parameter(hidden = true) @RequestAttribute(value = */ @Operation(summary = "registerUser", description = "REGISTER_USER_NOTES") @Parameters({ - @Parameter(name = "userName", description = "USER_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "repeatPassword", description = "REPEAT_PASSWORD", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "email", description = "EMAIL", required = true, schema =@Schema( implementation = String.class)), + @Parameter(name = "userName", description = "USER_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "userPassword", description = "USER_PASSWORD", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "repeatPassword", description = "REPEAT_PASSWORD", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "email", description = "EMAIL", required = true, schema = @Schema(implementation = String.class)), }) @PostMapping("/register") @ResponseStatus(HttpStatus.OK) @@ -533,7 +534,7 @@ public Result registerUser(@RequestParam(value = "userName") String user */ @Operation(summary = "activateUser", description = "ACTIVATE_USER_NOTES") @Parameters({ - @Parameter(name = "userName", description = "USER_NAME", schema =@Schema( implementation = String.class)), + @Parameter(name = "userName", description = "USER_NAME", schema = @Schema(implementation = String.class)), }) @PostMapping("/activate") @ResponseStatus(HttpStatus.OK) @@ -553,7 +554,7 @@ public Result activateUser(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "batchActivateUser", description = "BATCH_ACTIVATE_USER_NOTES") @Parameters({ - @Parameter(name = "userNames", description = "USER_NAMES", required = true, schema =@Schema( implementation = List.class)), + @Parameter(name = "userNames", description = "USER_NAMES", required = true, schema = @Schema(implementation = List.class)), }) @PostMapping("/batch/activate") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java index e3c836278464..e3ab8bb1e795 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkFlowLineageController.java @@ -21,11 +21,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.TASK_WITH_DEPENDENT_ERROR; import static org.apache.dolphinscheduler.common.Constants.SESSION_USER; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ApiException; @@ -54,6 +49,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * work flow lineage controller */ @@ -126,9 +127,9 @@ public Result> queryWorkFlowLineage(@Parameter(hidden = true */ @Operation(summary = "verifyTaskCanDelete", description = "VERIFY_TASK_CAN_DELETE") @Parameters({ - @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class)), - @Parameter(name = "taskCode", description = "TASK_DEFINITION_CODE", required = true, schema =@Schema( implementation = long.class, example = "123456789")), + @Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class)), + @Parameter(name = "taskCode", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")), }) @PostMapping(value = "/tasks/verify-delete") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java index fdfb6e0fe8c5..09bd65a06f95 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkerGroupController.java @@ -22,18 +22,13 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_WORKER_GROUP_FAIL; import static org.apache.dolphinscheduler.api.enums.Status.SAVE_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.exceptions.ApiException; import org.apache.dolphinscheduler.api.service.WorkerGroupService; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; -import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.entity.User; +import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils; import java.util.Map; @@ -49,6 +44,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * worker group controller */ @@ -71,11 +72,11 @@ public class WorkerGroupController extends BaseController { */ @Operation(summary = "saveWorkerGroup", description = "CREATE_WORKER_GROUP_NOTES") @Parameters({ - @Parameter(name = "id", description = "WORKER_GROUP_ID", schema =@Schema( implementation = int.class, example = "10", defaultValue = "0")), - @Parameter(name = "name", description = "WORKER_GROUP_NAME", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "addrList", description = "WORKER_ADDR_LIST", required = true, schema =@Schema( implementation = String.class)), - @Parameter(name = "description", description = "WORKER_DESC", required = false, schema =@Schema( implementation = String.class)), - @Parameter(name = "otherParamsJson", description = "WORKER_PARMS_JSON", required = false, schema =@Schema( implementation = String.class)), + @Parameter(name = "id", description = "WORKER_GROUP_ID", schema = @Schema(implementation = int.class, example = "10", defaultValue = "0")), + @Parameter(name = "name", description = "WORKER_GROUP_NAME", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "addrList", description = "WORKER_ADDR_LIST", required = true, schema = @Schema(implementation = String.class)), + @Parameter(name = "description", description = "WORKER_DESC", required = false, schema = @Schema(implementation = String.class)), + @Parameter(name = "otherParamsJson", description = "WORKER_PARMS_JSON", required = false, schema = @Schema(implementation = String.class)), }) @PostMapping() @ResponseStatus(HttpStatus.OK) @@ -103,9 +104,9 @@ public Result saveWorkerGroup(@Parameter(hidden = true) @RequestAttribute(value */ @Operation(summary = "queryAllWorkerGroupsPaging", description = "QUERY_WORKER_GROUP_PAGING_NOTES") @Parameters({ - @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema =@Schema( implementation = int.class, example = "1")), - @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema =@Schema( implementation = int.class, example = "20")), - @Parameter(name = "searchVal", description = "SEARCH_VAL", schema =@Schema( implementation = String.class)) + @Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")), + @Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "20")), + @Parameter(name = "searchVal", description = "SEARCH_VAL", schema = @Schema(implementation = String.class)) }) @GetMapping() @ResponseStatus(HttpStatus.OK) @@ -150,7 +151,7 @@ public Result queryAllWorkerGroups(@Parameter(hidden = true) @RequestAttribute(v */ @Operation(summary = "deleteWorkerGroupById", description = "DELETE_WORKER_GROUP_BY_ID_NOTES") @Parameters({ - @Parameter(name = "id", description = "WORKER_GROUP_ID", required = true, schema =@Schema( implementation = int.class, example = "10")), + @Parameter(name = "id", description = "WORKER_GROUP_ID", required = true, schema = @Schema(implementation = int.class, example = "10")), }) @DeleteMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java index c2a76d665de8..1e7426d259d9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java @@ -22,11 +22,6 @@ import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST; import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_DEFINITION_ERROR; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.dto.workflow.WorkflowCreateRequest; import org.apache.dolphinscheduler.api.dto.workflow.WorkflowFilterRequest; @@ -52,6 +47,12 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; + /** * workflow controller */ @@ -91,7 +92,7 @@ public Result createWorkflow(@Parameter(hidden = true) @Reque */ @Operation(summary = "delete", description = "DELETE_WORKFLOWS_NOTES") @Parameters({ - @Parameter(name = "code", description = "WORKFLOW_CODE", schema =@Schema( implementation = long.class, example = "123456", required = true)) + @Parameter(name = "code", description = "WORKFLOW_CODE", schema = @Schema(implementation = long.class, example = "123456", required = true)) }) @DeleteMapping(value = "/{code}") @ResponseStatus(HttpStatus.OK) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java index dd7d713d45d0..3b9d5d25db26 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/CreateTokenRequest.java @@ -17,10 +17,10 @@ package org.apache.dolphinscheduler.api.dto; - import io.swagger.v3.oas.annotations.media.Schema; public class CreateTokenRequest { + @Schema(example = "1", required = true) Integer userId; diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java index e28e687cb7e5..149bf0548f3c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/PageQueryDto.java @@ -18,13 +18,12 @@ package org.apache.dolphinscheduler.api.dto; import lombok.Data; -import io.swagger.v3.oas.annotations.media.Schema;; import io.swagger.v3.oas.annotations.media.Schema; /** * page query dto */ -@Schema(name ="QUERY-PAGE-INFO") +@Schema(name = "QUERY-PAGE-INFO") @Data public class PageQueryDto { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java index 2d1cf19cc228..1d1977e21ea4 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectCreateRequest.java @@ -17,8 +17,8 @@ package org.apache.dolphinscheduler.api.dto.project; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import io.swagger.v3.oas.annotations.media.Schema; /** * project create request diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java index 43ceb7a5c6f9..c6f219d3483c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectQueryRequest.java @@ -19,16 +19,16 @@ import org.apache.dolphinscheduler.api.dto.PageQueryDto; +import lombok.Data; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - -import io.swagger.v3.oas.annotations.media.Schema;; -import lombok.Data; +import io.swagger.v3.oas.annotations.media.Schema; /** * project query request */ -@Schema(name ="PROJECT-QUERY") +@Schema(name = "PROJECT-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java index 7d59afbdb54a..000900bdf101 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/project/ProjectUpdateRequest.java @@ -17,11 +17,11 @@ package org.apache.dolphinscheduler.api.dto.project; +import lombok.Data; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; /** * project update request diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java index 9006b35bb005..574b5270ecd6 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueCreateRequest.java @@ -17,14 +17,13 @@ package org.apache.dolphinscheduler.api.dto.queue; -import io.swagger.v3.oas.annotations.media.Schema;; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import io.swagger.v3.oas.annotations.media.Schema; /** * queue create request */ -@Schema(name ="QUEUE-CREATE") +@Schema(name = "QUEUE-CREATE") @Data public class QueueCreateRequest { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java index 3c14cf4e5ecf..b9f46ce11235 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueQueryRequest.java @@ -19,17 +19,16 @@ import org.apache.dolphinscheduler.api.dto.PageQueryDto; +import lombok.Data; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - -import io.swagger.v3.oas.annotations.media.Schema;; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; /** * queue query request */ -@Schema(name ="QUEUE-QUERY") +@Schema(name = "QUEUE-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java index 2b947ec23a00..a8c2d7a50deb 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueUpdateRequest.java @@ -17,17 +17,16 @@ package org.apache.dolphinscheduler.api.dto.queue; +import lombok.Data; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - -import io.swagger.v3.oas.annotations.media.Schema;; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; /** * queue update request */ -@Schema(name ="QUEUE-UPDATE") +@Schema(name = "QUEUE-UPDATE") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java index 31cba2aeb80f..f72142ac2776 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/queue/QueueVerifyRequest.java @@ -17,14 +17,13 @@ package org.apache.dolphinscheduler.api.dto.queue; -import io.swagger.v3.oas.annotations.media.Schema;; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import io.swagger.v3.oas.annotations.media.Schema; /** * queue verify request */ -@Schema(name ="QUEUE-Verify") +@Schema(name = "QUEUE-Verify") @Data public class QueueVerifyRequest { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java index ac6dc3f7db7e..b0afead0a3f9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleFilterRequest.java @@ -25,14 +25,12 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - -import io.swagger.v3.oas.annotations.media.Schema;; import io.swagger.v3.oas.annotations.media.Schema; /** * schedule query request */ -@Schema(name ="SCHEDULE-QUERY") +@Schema(name = "SCHEDULE-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java index bde05b511b97..634db40ebb8a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/task/TaskFilterRequest.java @@ -24,14 +24,12 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - -import io.swagger.v3.oas.annotations.media.Schema;; import io.swagger.v3.oas.annotations.media.Schema; /** * task query request */ -@Schema(name ="TASK-QUERY") +@Schema(name = "TASK-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java index 838a1fc8f6b1..d2903787e69b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskRelation/TaskRelationFilterRequest.java @@ -24,14 +24,12 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - -import io.swagger.v3.oas.annotations.media.Schema;; import io.swagger.v3.oas.annotations.media.Schema; /** * task relation query request */ -@Schema(name ="TASK-RELATION-QUERY") +@Schema(name = "TASK-RELATION-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java index 32f8b3462908..2f1282aa58dc 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/workflow/WorkflowFilterRequest.java @@ -25,14 +25,12 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; - -import io.swagger.v3.oas.annotations.media.Schema;; import io.swagger.v3.oas.annotations.media.Schema; /** * workflow query response */ -@Schema(name ="WORKFLOW-QUERY") +@Schema(name = "WORKFLOW-QUERY") @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Data From 9a73ff4fc02474c5b74910c75a4bffd0d18d6f8d Mon Sep 17 00:00:00 2001 From: fuchanghai <1105596917@qq.com> Date: Sat, 22 Oct 2022 14:33:25 +0800 Subject: [PATCH 13/14] [improvement-#12416] format --- .../dolphinscheduler/api/controller/AlertGroupController.java | 4 ++-- .../api/controller/ProcessInstanceController.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java index 85c1f5f9916b..d0c6fea342f7 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java @@ -40,12 +40,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java index 11385ba9853b..2d72ed21d5e3 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java @@ -44,12 +44,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus; From 59f52a7f56f467a9e91b29ba07c1034498e98e26 Mon Sep 17 00:00:00 2001 From: fuchanghai <1105596917@qq.com> Date: Sat, 22 Oct 2022 14:47:20 +0800 Subject: [PATCH 14/14] [improvement-#12416] format --- .../dolphinscheduler/api/controller/AlertGroupController.java | 2 -- .../api/controller/ProcessInstanceController.java | 1 - 2 files changed, 3 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java index d0c6fea342f7..37be4e845078 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AlertGroupController.java @@ -37,7 +37,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; @@ -57,7 +56,6 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; - /** * alert group controller */ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java index 2d72ed21d5e3..3d59346e2847 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessInstanceController.java @@ -41,7 +41,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping;