From 77e29b59b239f651bb275ef494f75b889bd3125f Mon Sep 17 00:00:00 2001 From: fuchanghai <33984497+fuchanghai@users.noreply.github.com> Date: Sun, 23 Oct 2022 23:17:53 +0800 Subject: [PATCH] [Improvement] add springdoc-openapi-ui (#12379) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: fuchanghai <‘2875334588@qq.com’> Co-authored-by: Wenjun Ruan --- dolphinscheduler-api/pom.xml | 9 +- .../api/configuration/AppConfiguration.java | 2 +- .../configuration/OpenAPIConfiguration.java | 99 +----- .../OpenAPITranslationConfiguration.java | 88 ----- .../api/controller/AccessTokenController.java | 65 ++-- .../controller/AccessTokenV2Controller.java | 17 +- .../api/controller/AlertGroupController.java | 79 ++--- .../AlertPluginInstanceController.java | 73 ++-- .../api/controller/AuditLogController.java | 33 +- .../api/controller/ClusterController.java | 79 ++--- .../controller/DataAnalysisController.java | 53 ++- .../api/controller/DataQualityController.java | 65 ++-- .../api/controller/DataSourceController.java | 122 ++++--- .../api/controller/EnvironmentController.java | 83 +++-- .../api/controller/ExecutorController.java | 163 +++++---- .../api/controller/FavTaskController.java | 21 +- .../controller/K8sNamespaceController.java | 91 +++-- .../api/controller/LoggerController.java | 62 ++-- .../api/controller/LoginController.java | 25 +- .../api/controller/MonitorController.java | 21 +- .../ProcessDefinitionController.java | 334 +++++++++--------- .../controller/ProcessInstanceController.java | 169 +++++---- .../ProcessTaskRelationController.java | 112 +++--- .../ProcessTaskRelationV2Controller.java | 33 +- .../api/controller/ProjectController.java | 101 +++--- .../api/controller/ProjectV2Controller.java | 93 +++-- .../api/controller/QueueController.java | 61 ++-- .../api/controller/QueueV2Controller.java | 45 ++- .../api/controller/ResourcesController.java | 301 ++++++++-------- .../api/controller/ScheduleV2Controller.java | 37 +- .../api/controller/SchedulerController.java | 144 ++++---- .../controller/TaskDefinitionController.java | 174 +++++---- .../TaskDefinitionV2Controller.java | 45 ++- .../api/controller/TaskGroupController.java | 129 ++++--- .../controller/TaskInstanceController.java | 76 ++-- .../api/controller/TenantController.java | 71 ++-- .../api/controller/UiPluginController.java | 29 +- .../api/controller/UsersController.java | 205 ++++++----- .../controller/WorkFlowLineageController.java | 46 ++- .../api/controller/WorkerGroupController.java | 57 ++- .../api/controller/WorkflowV2Controller.java | 37 +- .../api/dto/CreateTokenRequest.java | 8 +- .../api/dto/PageQueryDto.java | 9 +- .../api/dto/project/ProjectCreateRequest.java | 6 +- .../api/dto/project/ProjectQueryRequest.java | 8 +- .../api/dto/project/ProjectUpdateRequest.java | 8 +- .../api/dto/queue/QueueCreateRequest.java | 9 +- .../api/dto/queue/QueueQueryRequest.java | 8 +- .../api/dto/queue/QueueUpdateRequest.java | 10 +- .../api/dto/queue/QueueVerifyRequest.java | 9 +- .../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 + dolphinscheduler-bom/pom.xml | 13 +- dolphinscheduler-dist/release-docs/LICENSE | 20 +- .../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 +- ...e.txt => LICENSE-springdoc-openapi-ui.txt} | 8 +- ...LICENSE-springdoc-openapi-webmvc-core.txt} | 9 +- .../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 + tools/dependencies/known-dependencies.txt | 30 +- 79 files changed, 1890 insertions(+), 3177 deletions(-) delete mode 100644 dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java 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-core.txt => LICENSE-springdoc-openapi-ui.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-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-api/pom.xml b/dolphinscheduler-api/pom.xml index 7e03f01b6e..cc34dcba1e 100644 --- a/dolphinscheduler-api/pom.xml +++ b/dolphinscheduler-api/pom.xml @@ -134,11 +134,6 @@ spring-context - - io.springfox - springfox-boot-starter - - org.hibernate.validator hibernate-validator @@ -195,6 +190,10 @@ test + + org.springdoc + springdoc-openapi-ui + 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 d671635810..423cf67571 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 class AppConfiguration implements WebMvcConfigurer { 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 deab4dd345..349445616b 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,18 @@ */ 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 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; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; /** - * * swager2 config class - * */ @Configuration @ConditionalOnWebApplication @@ -50,73 +35,27 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMappi 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(); + public OpenAPI apiV1Info1() { + return new OpenAPI() + .info(new Info() + .title("Dolphin Scheduler Api Docs") + .description("Dolphin Scheduler Api Docs") + .version("V1")); } - private ApiInfo apiV1Info() { - return new ApiInfoBuilder() - .title("Dolphin Scheduler Api Docs") - .description("Dolphin Scheduler Api Docs") - .version("V1") + @Bean + public GroupedOpenApi publicApi1() { + return GroupedOpenApi.builder() + .group("v1") + .pathsToExclude("/v2/**") .build(); } @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/**"))) + public GroupedOpenApi publicApi2() { + return GroupedOpenApi.builder() + .group("v2") + .pathsToMatch("/v2/**") .build(); } - - private ApiInfo apiV2Info() { - return new ApiInfoBuilder() - .title("Dolphin Scheduler Api Docs") - .description("Dolphin Scheduler Api Docs") - .version("V2") - .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 deleted file mode 100644 index 4e1c67bd0b..0000000000 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/OpenAPITranslationConfiguration.java +++ /dev/null @@ -1,88 +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; - -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 - @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, notes, 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); - } - } -} 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 6105694900..7bcc129275 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +47,16 @@ 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.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 */ -@Api(tags = "ACCESS_TOKEN_TAG") +@Tag(name = "ACCESS_TOKEN_TAG") @RestController @RequestMapping("/access-tokens") public class AccessTokenController extends BaseController { @@ -74,17 +73,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 +99,7 @@ public class AccessTokenController extends BaseController { * @param expireTime expire time * @return token string */ - @ApiIgnore + @Parameter(hidden = true) @PostMapping(value = "/generate") @ResponseStatus(HttpStatus.CREATED) @ApiException(GENERATE_TOKEN_ERROR) @@ -121,17 +120,17 @@ public class AccessTokenController extends BaseController { * @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 +151,15 @@ public class AccessTokenController extends BaseController { * @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 +172,12 @@ public class AccessTokenController extends BaseController { * @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 +193,18 @@ public class AccessTokenController extends BaseController { * @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 dcc1e0948d..f643e69cd5 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 @@ -28,8 +28,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.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; import org.springframework.web.bind.annotation.PostMapping; @@ -39,14 +37,15 @@ import org.springframework.web.bind.annotation.RequestMapping; 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; +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 */ -@Api(tags = "ACCESS_TOKEN_TAG") +@Tag(name = "ACCESS_TOKEN_TAG") @RestController @RequestMapping("/v2/access-tokens") public class AccessTokenV2Controller extends BaseController { @@ -61,13 +60,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 68e4af12a0..c649f5de0b 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 @@ -33,8 +33,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +50,16 @@ 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.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 group controller */ -@Api(tags = "ALERT_GROUP_TAG") +@Tag(name = "ALERT_GROUP_TAG") @RestController @RequestMapping("/alert-groups") public class AlertGroupController extends BaseController { @@ -78,17 +77,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 +102,12 @@ public class AlertGroupController extends BaseController { * @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 +122,17 @@ public class AlertGroupController extends BaseController { * @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 +151,15 @@ public class AlertGroupController extends BaseController { * @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 +175,18 @@ public class AlertGroupController extends BaseController { * @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 +204,15 @@ public class AlertGroupController extends BaseController { * @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 +225,14 @@ public class AlertGroupController extends BaseController { * @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 08a9bf61ed..8cabca9556 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 @@ -33,8 +33,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +50,16 @@ 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.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 */ -@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 class AlertPluginInstanceController extends BaseController { * @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 class AlertPluginInstanceController extends BaseController { * @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 class AlertPluginInstanceController extends BaseController { * @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 class AlertPluginInstanceController extends BaseController { * @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 class AlertPluginInstanceController extends BaseController { * @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 class AlertPluginInstanceController extends BaseController { * @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 bd7ab42a8a..a2a3e335fd 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 @@ -28,8 +28,6 @@ import org.apache.dolphinscheduler.common.enums.AuditOperationType; 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; import org.springframework.web.bind.annotation.GetMapping; @@ -39,12 +37,13 @@ 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.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; -@Api(tags = "AUDIT_LOG_TAG") +@Tag(name = "AUDIT_LOG_TAG") @RestController @RequestMapping("projects/audit") public class AuditLogController extends BaseController { @@ -65,21 +64,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 48cc0045f5..457e19d7ed 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +44,16 @@ 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.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 */ -@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 class ClusterController extends BaseController { * @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 class ClusterController extends BaseController { * @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 class ClusterController extends BaseController { * @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 class ClusterController extends BaseController { * @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 class ClusterController extends BaseController { * @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 class ClusterController extends BaseController { * @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 5f7c71bf8b..41b4ba49b7 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 @@ -30,8 +30,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; @@ -43,15 +41,16 @@ 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.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 */ -@Api(tags = "DATA_ANALYSIS_TAG") +@Tag(name = "DATA_ANALYSIS_TAG") @RestController @RequestMapping("projects/analysis") public class DataAnalysisController extends BaseController { @@ -68,17 +67,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 +96,17 @@ public class DataAnalysisController extends BaseController { * @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 +123,15 @@ public class DataAnalysisController extends BaseController { * @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 +144,12 @@ public class DataAnalysisController extends BaseController { * @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 +161,12 @@ public class DataAnalysisController extends BaseController { * @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 aefa1d306b..fd91605ab3 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 @@ -31,8 +31,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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; @@ -44,15 +42,16 @@ 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.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 */ -@Api(tags = "DATA_QUALITY_SERVICE") +@Tag(name = "DATA_QUALITY_SERVICE") @RestController @RequestMapping("/data-quality") public class DataQualityController extends BaseController { @@ -68,9 +67,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 +88,19 @@ public class DataQualityController extends BaseController { * @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 +120,7 @@ public class DataQualityController extends BaseController { * 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 +142,20 @@ public class DataQualityController extends BaseController { * @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 +179,9 @@ public class DataQualityController extends BaseController { * @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 8127e8bd8b..169d9bddf8 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 @@ -44,8 +44,6 @@ import org.apache.dolphinscheduler.service.utils.CommonUtils; 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 +60,16 @@ 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 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 */ -@Api(tags = "DATA_SOURCE_TAG") +@Tag(name = "DATA_SOURCE_TAG") @RestController @RequestMapping("datasources") public class DataSourceController extends BaseController { @@ -87,13 +85,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 +105,16 @@ 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 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 +129,16 @@ public class DataSourceController extends BaseController { * @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 +152,16 @@ public class DataSourceController extends BaseController { * @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 +177,17 @@ public class DataSourceController extends BaseController { * @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 +207,12 @@ 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} * @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 +227,15 @@ public class DataSourceController extends BaseController { * @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 +247,15 @@ public class DataSourceController extends BaseController { * @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 +267,15 @@ public class DataSourceController extends BaseController { * @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 +287,15 @@ public class DataSourceController extends BaseController { * @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 +309,15 @@ public class DataSourceController extends BaseController { * @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 +330,19 @@ public class DataSourceController extends BaseController { * @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 +352,10 @@ public class DataSourceController extends BaseController { 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 7d5db7217c..b7914cead6 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +44,16 @@ 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.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 */ -@Api(tags = "ENVIRONMENT_TAG") +@Tag(name = "ENVIRONMENT_TAG") @RestController @RequestMapping("environment") public class EnvironmentController extends BaseController { @@ -71,18 +70,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 +102,19 @@ public class EnvironmentController extends BaseController { * @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 +131,15 @@ public class EnvironmentController extends BaseController { * @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 +154,17 @@ public class EnvironmentController extends BaseController { * @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 +185,15 @@ public class EnvironmentController extends BaseController { * @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 +206,12 @@ public class EnvironmentController extends BaseController { * @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 +223,15 @@ public class EnvironmentController extends BaseController { * @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 2c142e62b9..115cb67d38 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 @@ -41,8 +41,6 @@ import org.apache.dolphinscheduler.common.utils.JSONUtils; 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 +64,16 @@ 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 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 */ -@Api(tags = "EXECUTOR_TAG") +@Tag(name = "EXECUTOR_TAG") @RestController @RequestMapping("projects/{projectCode}/executors") public class ExecutorController extends BaseController { @@ -106,32 +104,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 +192,32 @@ public class ExecutorController extends BaseController { * @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 +270,10 @@ public class ExecutorController extends BaseController { 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,17 +293,17 @@ public class ExecutorController extends BaseController { * @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, @@ -322,11 +321,11 @@ public class ExecutorController extends BaseController { * @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 +372,9 @@ public class ExecutorController extends BaseController { * @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 +388,9 @@ public class ExecutorController extends BaseController { /** * 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 +413,25 @@ public class ExecutorController extends BaseController { * @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 91d620e9d0..158b12ef75 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 @@ -30,8 +30,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.List; import javax.annotation.Resource; @@ -46,13 +44,14 @@ import org.springframework.web.bind.annotation.RequestMapping; 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 io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; /** * fav controller */ -@Api(tags = "FAVOURITE") +@Tag(name = "FAVOURITE") @RestController @RequestMapping("/favourite") public class FavTaskController extends BaseController { @@ -66,12 +65,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 +81,12 @@ public class FavTaskController extends BaseController { * @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 +98,12 @@ public class FavTaskController extends BaseController { * @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 58181f372d..1477f8b73e 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 @@ -35,8 +35,6 @@ import org.apache.dolphinscheduler.dao.entity.K8sNamespace; 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 +50,16 @@ 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.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 */ -@Api(tags = "K8S_NAMESPACE_TAG") +@Tag(name = "K8S_NAMESPACE_TAG") @RestController @RequestMapping("/k8s-namespace") public class K8sNamespaceController extends BaseController { @@ -77,17 +76,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 +110,18 @@ public class K8sNamespaceController extends BaseController { * @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 +140,17 @@ public class K8sNamespaceController extends BaseController { * @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 +169,16 @@ public class K8sNamespaceController extends BaseController { * @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 +192,15 @@ public class K8sNamespaceController extends BaseController { * @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 +213,15 @@ public class K8sNamespaceController extends BaseController { * @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 +234,15 @@ public class K8sNamespaceController extends BaseController { * @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 +254,12 @@ public class K8sNamespaceController extends BaseController { * @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 d3c27a3911..0909d4d85c 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 @@ -28,8 +28,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +41,16 @@ import org.springframework.web.bind.annotation.ResponseBody; 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 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 */ -@Api(tags = "LOGGER_TAG") +@Tag(name = "LOGGER_TAG") @RestController @RequestMapping("/log") public class LoggerController extends BaseController { @@ -69,17 +67,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 +91,15 @@ public class LoggerController extends BaseController { * @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 +119,19 @@ public class LoggerController extends BaseController { * @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 +146,17 @@ public class LoggerController extends BaseController { * @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 e991021cdd..d5364342be 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 @@ -30,8 +30,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.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 +46,16 @@ import org.springframework.web.bind.annotation.RequestMapping; 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; +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 */ -@Api(tags = "LOGIN_TAG") +@Tag(name = "LOGIN_TAG") @RestController @RequestMapping("") public class LoginController extends BaseController { @@ -76,10 +75,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 +123,11 @@ public class LoginController extends BaseController { * @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 a5b72ba8ed..ae83591f07 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 @@ -28,8 +28,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.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 +38,14 @@ import org.springframework.web.bind.annotation.RequestMapping; 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 io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; /** * monitor controller */ -@Api(tags = "MONITOR_TAG") +@Tag(name = "MONITOR_TAG") @RestController @RequestMapping("/monitor") public class MonitorController extends BaseController { @@ -60,12 +59,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 +75,12 @@ public class MonitorController extends BaseController { * @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 +91,12 @@ public class MonitorController extends BaseController { * @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 6efadf7b45..ae9549248b 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 @@ -48,8 +48,6 @@ import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; 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 +69,16 @@ import org.springframework.web.bind.annotation.ResponseStatus; 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; +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 */ -@Api(tags = "PROCESS_DEFINITION_TAG") +@Tag(name = "PROCESS_DEFINITION_TAG") @RestController @RequestMapping("projects/{projectCode}/process-definition") public class ProcessDefinitionController extends BaseController { @@ -106,19 +104,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 +142,17 @@ public class ProcessDefinitionController extends BaseController { * @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 +168,17 @@ public class ProcessDefinitionController extends BaseController { * @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 +193,17 @@ public class ProcessDefinitionController extends BaseController { * @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 +228,21 @@ public class ProcessDefinitionController extends BaseController { * @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 +281,18 @@ public class ProcessDefinitionController extends BaseController { * @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 +316,17 @@ public class ProcessDefinitionController extends BaseController { * @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 +343,17 @@ public class ProcessDefinitionController extends BaseController { * @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 +370,18 @@ public class ProcessDefinitionController extends BaseController { * @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 +397,16 @@ public class ProcessDefinitionController extends BaseController { * @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 +421,16 @@ public class ProcessDefinitionController extends BaseController { * @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 +444,13 @@ public class ProcessDefinitionController extends BaseController { * @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 +462,13 @@ public class ProcessDefinitionController extends BaseController { * @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 +485,21 @@ public class ProcessDefinitionController extends BaseController { * @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 +527,17 @@ public class ProcessDefinitionController extends BaseController { * @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 +552,15 @@ public class ProcessDefinitionController extends BaseController { * @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 +575,15 @@ public class ProcessDefinitionController extends BaseController { * @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 +597,15 @@ public class ProcessDefinitionController extends BaseController { * @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 +617,16 @@ public class ProcessDefinitionController extends BaseController { * @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 +641,16 @@ public class ProcessDefinitionController extends BaseController { * @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 +664,16 @@ public class ProcessDefinitionController extends BaseController { * @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 +689,15 @@ public class ProcessDefinitionController extends BaseController { * @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 +714,13 @@ public class ProcessDefinitionController extends BaseController { * @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 +734,15 @@ public class ProcessDefinitionController extends BaseController { * @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 +766,18 @@ public class ProcessDefinitionController extends BaseController { * @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 +807,20 @@ public class ProcessDefinitionController extends BaseController { * @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 +855,18 @@ public class ProcessDefinitionController extends BaseController { * @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 6b75b1f094..c6e807e47e 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,16 +17,7 @@ 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 static org.apache.dolphinscheduler.api.enums.Status.*; import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; import org.apache.dolphinscheduler.api.enums.Status; @@ -39,8 +30,6 @@ 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 java.io.IOException; @@ -65,16 +54,16 @@ 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 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 */ -@Api(tags = "PROCESS_INSTANCE_TAG") +@Tag(name = "PROCESS_INSTANCE_TAG") @RestController @RequestMapping("/projects/{projectCode}/process-instances") public class ProcessInstanceController extends BaseController { @@ -100,24 +89,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 +137,16 @@ public class ProcessInstanceController extends BaseController { * @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 +166,24 @@ public class ProcessInstanceController extends BaseController { * @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 +207,16 @@ public class ProcessInstanceController extends BaseController { * @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 +232,18 @@ public class ProcessInstanceController extends BaseController { * @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 +261,16 @@ public class ProcessInstanceController extends BaseController { * @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 +284,16 @@ public class ProcessInstanceController extends BaseController { * @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 +308,16 @@ public class ProcessInstanceController extends BaseController { * @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 +330,16 @@ public class ProcessInstanceController extends BaseController { * @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 +353,16 @@ public class ProcessInstanceController extends BaseController { * @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 +377,10 @@ public class ProcessInstanceController extends BaseController { * @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 83ed8a1618..34cdaebad3 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 @@ -30,8 +30,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.Constants; import org.apache.dolphinscheduler.dao.entity.User; -import springfox.documentation.annotations.ApiIgnore; - import java.util.HashMap; import java.util.Map; @@ -47,16 +45,16 @@ 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 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 */ -@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 +72,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 +109,18 @@ public class ProcessTaskRelationController extends BaseController { * @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 +136,18 @@ public class ProcessTaskRelationController extends BaseController { * @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 +163,18 @@ public class ProcessTaskRelationController extends BaseController { * @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 +189,17 @@ public class ProcessTaskRelationController extends BaseController { * @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 +212,17 @@ public class ProcessTaskRelationController extends BaseController { * @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 +237,19 @@ public class ProcessTaskRelationController extends BaseController { * @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 b434eeb0c7..8430651220 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +46,16 @@ import org.springframework.web.bind.annotation.RequestMapping; 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.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 */ -@Api(tags = "PROCESS_TASK_RELATION_TAG") +@Tag(name = "PROCESS_TASK_RELATION_TAG") @RestController @RequestMapping("v2/relations") public class ProcessTaskRelationV2Controller extends BaseController { @@ -71,12 +70,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 +89,15 @@ public class ProcessTaskRelationV2Controller extends BaseController { * @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 +113,15 @@ public class ProcessTaskRelationV2Controller extends BaseController { * @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 4a0235d037..1b3f2def46 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 @@ -35,8 +35,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +50,16 @@ 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.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 */ -@Api(tags = "PROJECT_TAG") +@Tag(name = "PROJECT_TAG") @RestController @RequestMapping("projects") public class ProjectController extends BaseController { @@ -78,16 +77,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 +101,18 @@ public class ProjectController extends BaseController { * @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 +127,15 @@ public class ProjectController extends BaseController { * @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 +149,17 @@ public class ProjectController extends BaseController { * @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 +181,15 @@ public class ProjectController extends BaseController { * @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 +201,15 @@ public class ProjectController extends BaseController { * @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 +221,15 @@ public class ProjectController extends BaseController { * @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 +241,15 @@ public class ProjectController extends BaseController { * @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 +260,12 @@ public class ProjectController extends BaseController { * @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 +275,12 @@ public class ProjectController extends BaseController { * @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 +290,12 @@ public class ProjectController extends BaseController { * @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 788680a059..012efc666e 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 @@ -45,8 +45,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +59,16 @@ 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.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 */ -@Api(tags = "PROJECT_TAG") +@Tag(name = "PROJECT_TAG") @RestController @RequestMapping("/v2/projects") public class ProjectV2Controller extends BaseController { @@ -84,12 +83,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 +103,12 @@ public class ProjectV2Controller extends BaseController { * @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 +123,15 @@ public class ProjectV2Controller extends BaseController { * @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 +144,17 @@ public class ProjectV2Controller extends BaseController { * @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 +173,15 @@ public class ProjectV2Controller extends BaseController { * @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 +194,15 @@ public class ProjectV2Controller extends BaseController { * @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 +215,15 @@ public class ProjectV2Controller extends BaseController { * @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 +236,15 @@ public class ProjectV2Controller extends BaseController { * @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 +256,15 @@ public class ProjectV2Controller extends BaseController { * @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 +275,15 @@ public class ProjectV2Controller extends BaseController { * @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 +294,12 @@ public class ProjectV2Controller extends BaseController { * @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 ea115e2d5f..e13e23a1df 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 @@ -30,8 +30,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +42,16 @@ 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.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 */ -@Api(tags = "QUEUE_TAG") +@Tag(name = "QUEUE_TAG") @RestController @RequestMapping("/queues") public class QueueController extends BaseController { @@ -66,12 +65,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 +83,17 @@ public class QueueController extends BaseController { * @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 +115,16 @@ public class QueueController extends BaseController { * @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 +139,17 @@ public class QueueController extends BaseController { * @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 +164,16 @@ public class QueueController extends BaseController { * @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 f5eefc0b52..814c9b6187 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 @@ -39,8 +39,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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; @@ -53,15 +51,16 @@ import org.springframework.web.bind.annotation.RequestMapping; 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.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 */ -@Api(tags = "QUEUE_TAG") +@Tag(name = "QUEUE_TAG") @RestController @RequestMapping("/v2/queues") public class QueueV2Controller extends BaseController { @@ -75,12 +74,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 +91,17 @@ public class QueueV2Controller extends BaseController { * @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 +121,12 @@ public class QueueV2Controller extends BaseController { * @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,15 +141,15 @@ public class QueueV2Controller extends BaseController { * @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, + 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(), @@ -165,12 +164,12 @@ public class QueueV2Controller extends BaseController { * @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 8c2f65788b..e2f3c6f33e 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 @@ -53,8 +53,6 @@ import org.apache.dolphinscheduler.dao.entity.User; 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 +77,16 @@ import org.springframework.web.bind.annotation.ResponseStatus; 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.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 */ -@Api(tags = "RESOURCES_TAG") +@Tag(name = "RESOURCES_TAG") @RestController @RequestMapping("resources") public class ResourcesController extends BaseController { @@ -108,18 +107,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 +133,19 @@ public class ResourcesController extends BaseController { * * @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 +167,18 @@ public class ResourcesController extends BaseController { * @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 +195,15 @@ public class ResourcesController extends BaseController { * @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 +219,19 @@ public class ResourcesController extends BaseController { * @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 +254,15 @@ public class ResourcesController extends BaseController { * @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 +275,16 @@ public class ResourcesController extends BaseController { * @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 +297,15 @@ public class ResourcesController extends BaseController { * @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 +320,17 @@ public class ResourcesController extends BaseController { * @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 +347,16 @@ public class ResourcesController extends BaseController { * @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 +368,20 @@ public class ResourcesController extends BaseController { * * @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 +405,15 @@ public class ResourcesController extends BaseController { * @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 +430,15 @@ public class ResourcesController extends BaseController { * @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 +463,22 @@ public class ResourcesController extends BaseController { * @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 +498,16 @@ public class ResourcesController extends BaseController { * @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 +526,22 @@ public class ResourcesController extends BaseController { * @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 +563,17 @@ public class ResourcesController extends BaseController { * @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 +591,15 @@ public class ResourcesController extends BaseController { * @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 +611,16 @@ public class ResourcesController extends BaseController { * @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 +632,15 @@ public class ResourcesController extends BaseController { * @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 +652,15 @@ public class ResourcesController extends BaseController { * @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 +673,15 @@ public class ResourcesController extends BaseController { * @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 +694,15 @@ public class ResourcesController extends BaseController { * @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 +716,15 @@ public class ResourcesController extends BaseController { * @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 +737,15 @@ public class ResourcesController extends BaseController { * @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 36afacc834..12e294b7b1 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 @@ -35,8 +35,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +48,16 @@ import org.springframework.web.bind.annotation.RequestMapping; 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.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 */ -@Api(tags = "SCHEDULER_TAG") +@Tag(name = "SCHEDULER_TAG") @RestController @RequestMapping("/v2/schedules") public class ScheduleV2Controller extends BaseController { @@ -73,12 +72,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 +89,15 @@ public class ScheduleV2Controller extends BaseController { * @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 +111,12 @@ public class ScheduleV2Controller extends BaseController { * @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 +130,12 @@ public class ScheduleV2Controller extends BaseController { * @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 +148,12 @@ public class ScheduleV2Controller extends BaseController { * @ * @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 dc52ab6c7a..b64a5d0f4f 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 @@ -39,8 +39,6 @@ import org.apache.dolphinscheduler.common.enums.WarningType; 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 +54,16 @@ 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 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 */ -@Api(tags = "SCHEDULE_TAG") +@Tag(name = "SCHEDULE_TAG") @RestController @RequestMapping("/projects/{projectCode}/schedules") public class SchedulerController extends BaseController { @@ -92,23 +90,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 +136,23 @@ public class SchedulerController extends BaseController { * @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 +175,15 @@ public class SchedulerController extends BaseController { * @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 +197,15 @@ public class SchedulerController extends BaseController { * @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 +224,18 @@ public class SchedulerController extends BaseController { * @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 +259,16 @@ public class SchedulerController extends BaseController { * @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 +281,12 @@ public class SchedulerController extends BaseController { * @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 +298,15 @@ public class SchedulerController extends BaseController { * @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 +326,23 @@ public class SchedulerController extends BaseController { * @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 8050b51ab4..1d1befb361 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 @@ -39,8 +39,6 @@ import org.apache.dolphinscheduler.common.enums.TaskExecuteType; 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 +56,16 @@ 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 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 */ -@Api(tags = "TASK_DEFINITION_TAG") +@Tag(name = "TASK_DEFINITION_TAG") @RestController @RequestMapping("projects/{projectCode}/task-definition") public class TaskDefinitionController extends BaseController { @@ -83,17 +81,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 +108,19 @@ public class TaskDefinitionController extends BaseController { * @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 +138,18 @@ public class TaskDefinitionController extends BaseController { * @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 +167,19 @@ public class TaskDefinitionController extends BaseController { * @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 +199,18 @@ public class TaskDefinitionController extends BaseController { * @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 +230,17 @@ public class TaskDefinitionController extends BaseController { * @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 +256,17 @@ public class TaskDefinitionController extends BaseController { * @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 +282,16 @@ public class TaskDefinitionController extends BaseController { * @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 +305,16 @@ public class TaskDefinitionController extends BaseController { * @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 +333,22 @@ public class TaskDefinitionController extends BaseController { * @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 +372,15 @@ public class TaskDefinitionController extends BaseController { * @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 +395,18 @@ public class TaskDefinitionController extends BaseController { * @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 fa88c27b5b..52258fa30f 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 @@ -35,8 +35,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +48,16 @@ import org.springframework.web.bind.annotation.RequestMapping; 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.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 */ -@Api(tags = "TASK_DEFINITION_TAG") +@Tag(name = "TASK_DEFINITION_TAG") @RestController @RequestMapping("v2/tasks") public class TaskDefinitionV2Controller extends BaseController { @@ -73,12 +72,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 +89,15 @@ public class TaskDefinitionV2Controller extends BaseController { * @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 +111,15 @@ public class TaskDefinitionV2Controller extends BaseController { * @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 +134,15 @@ public class TaskDefinitionV2Controller extends BaseController { * @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 +155,12 @@ public class TaskDefinitionV2Controller extends BaseController { * @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 9b2592afdf..fe91848e29 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.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 +44,16 @@ 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.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 */ -@Api(tags = "task group") +@Tag(name = "task group") @RestController @RequestMapping("/task-group") public class TaskGroupController extends BaseController { @@ -72,19 +71,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 +103,19 @@ public class TaskGroupController extends BaseController { * @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 +132,17 @@ public class TaskGroupController extends BaseController { * @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 +160,17 @@ public class TaskGroupController extends BaseController { * @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 +187,17 @@ public class TaskGroupController extends BaseController { * @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 +213,15 @@ public class TaskGroupController extends BaseController { * @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 +235,15 @@ public class TaskGroupController extends BaseController { * @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 +256,15 @@ public class TaskGroupController extends BaseController { * @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 +277,16 @@ public class TaskGroupController extends BaseController { * @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 +308,20 @@ public class TaskGroupController extends BaseController { * @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 157905fc3d..e8d9acf967 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.dao.entity.User; 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 +45,16 @@ 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 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 */ -@Api(tags = "TASK_INSTANCE_TAG") +@Tag(name = "TASK_INSTANCE_TAG") @RestController @RequestMapping("/projects/{projectCode}/task-instances") public class TaskInstanceController extends BaseController { @@ -81,27 +79,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 +133,16 @@ public class TaskInstanceController extends BaseController { * @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 +156,16 @@ public class TaskInstanceController extends BaseController { * @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 +178,16 @@ public class TaskInstanceController extends BaseController { * @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 d0b4db85e4..ee6aea9150 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +47,16 @@ 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.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 */ -@Api(tags = "TENANT_TAG") +@Tag(name = "TENANT_TAG") @RestController @RequestMapping("/tenants") public class TenantController extends BaseController { @@ -74,17 +73,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 +101,17 @@ public class TenantController extends BaseController { * @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 +131,12 @@ public class TenantController extends BaseController { * @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 +151,18 @@ public class TenantController extends BaseController { * @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 +179,15 @@ public class TenantController extends BaseController { * @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 +200,15 @@ public class TenantController extends BaseController { * @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 e45b9a4e98..a8b5fd5f60 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 @@ -27,8 +27,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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,10 +39,11 @@ 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.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 @@ -52,7 +51,7 @@ import io.swagger.annotations.ApiOperation; * 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 +59,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 965b35afa1..dcaf7a9b81 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 @@ -42,8 +42,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +59,16 @@ 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.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 */ -@Api(tags = "USERS_TAG") +@Tag(name = "USERS_TAG") @RestController @RequestMapping("/users") public class UsersController extends BaseController { @@ -91,21 +90,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 +126,17 @@ public class UsersController extends BaseController { * @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 +163,22 @@ public class UsersController extends BaseController { * @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 +200,15 @@ public class UsersController extends BaseController { * @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 +222,16 @@ public class UsersController extends BaseController { * @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 +246,16 @@ public class UsersController extends BaseController { * @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 +270,16 @@ public class UsersController extends BaseController { * @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 +294,16 @@ public class UsersController extends BaseController { * @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 +318,16 @@ public class UsersController extends BaseController { * @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 +342,16 @@ public class UsersController extends BaseController { * @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 +366,16 @@ public class UsersController extends BaseController { * @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 +388,12 @@ public class UsersController extends BaseController { * @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 +404,12 @@ public class UsersController extends BaseController { * @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 +436,15 @@ public class UsersController extends BaseController { * @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 +456,15 @@ public class UsersController extends BaseController { * @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 +477,15 @@ public class UsersController extends BaseController { * @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 +504,12 @@ public class UsersController extends BaseController { * @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 +532,15 @@ public class UsersController extends BaseController { * * @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 +552,15 @@ public class UsersController extends BaseController { * * @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 8355fe9322..ad9404d022 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 @@ -32,8 +32,6 @@ import org.apache.dolphinscheduler.dao.entity.User; 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 +49,16 @@ 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 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 */ -@Api(tags = "WORK_FLOW_LINEAGE_TAG") +@Tag(name = "WORK_FLOW_LINEAGE_TAG") @RestController @RequestMapping("projects/{projectCode}/lineages") public class WorkFlowLineageController extends BaseController { @@ -70,12 +68,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 +85,12 @@ public class WorkFlowLineageController extends BaseController { } } - @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 +101,12 @@ public class WorkFlowLineageController extends BaseController { } } - @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 +125,18 @@ public class WorkFlowLineageController extends BaseController { * @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 0947e7b5dd..115c20c76f 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 @@ -30,8 +30,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +44,16 @@ 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.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 */ -@Api(tags = "WORKER_GROUP_TAG") +@Tag(name = "WORKER_GROUP_TAG") @RestController @RequestMapping("/worker-groups") public class WorkerGroupController extends BaseController { @@ -71,19 +70,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 +102,17 @@ public class WorkerGroupController extends BaseController { * @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 +132,12 @@ public class WorkerGroupController extends BaseController { * @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 +149,15 @@ public class WorkerGroupController extends BaseController { * @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 +169,12 @@ public class WorkerGroupController extends BaseController { * @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 f99b033d01..26f23888fe 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 @@ -34,8 +34,6 @@ import org.apache.dolphinscheduler.common.constants.Constants; 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 +47,16 @@ import org.springframework.web.bind.annotation.RequestMapping; 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.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 */ -@Api(tags = "WORKFLOW_TAG") +@Tag(name = "WORKFLOW_TAG") @RestController @RequestMapping("/v2/workflows") public class WorkflowV2Controller extends BaseController { @@ -72,12 +71,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 +90,15 @@ public class WorkflowV2Controller extends BaseController { * @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 +112,12 @@ public class WorkflowV2Controller extends BaseController { * @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 +132,12 @@ public class WorkflowV2Controller extends BaseController { * @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 +150,12 @@ public class WorkflowV2Controller extends BaseController { * @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 c0b8520e2e..3b9d5d25db 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; +import io.swagger.v3.oas.annotations.media.Schema; public class CreateTokenRequest { - @ApiModelProperty(example = "1", required = true) + @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 d527c9fd5f..149bf0548f 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,18 @@ 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; /** * 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 21ad4d75be..1d1977e21e 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 @@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.api.dto.project; import lombok.Data; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * project create request @@ -26,9 +26,9 @@ import io.swagger.annotations.ApiModelProperty; @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 942be6857d..c6f219d348 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 @@ -23,19 +23,17 @@ 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; /** * 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 69cb3b563c..000900bdf1 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 @@ -21,7 +21,7 @@ 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; /** * project update request @@ -31,12 +31,12 @@ import io.swagger.annotations.ApiModelProperty; @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 c318200f5a..574b5270ec 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 @@ -18,19 +18,18 @@ package org.apache.dolphinscheduler.api.dto.queue; import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * 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 3bdd2293cf..b9f46ce112 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 @@ -23,19 +23,17 @@ 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; /** * 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 7d2bbdc42f..a8c2d7a50d 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 @@ -21,22 +21,20 @@ 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; /** * 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 6b07a7bb7d..f72142ac27 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 @@ -18,19 +18,18 @@ package org.apache.dolphinscheduler.api.dto.queue; import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * 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 f324c23c5a..592e5ddb99 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 lombok.Data; 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 @@ import io.swagger.annotations.ApiModelProperty; @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 120e773e0f..b0afead0a3 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,26 +25,24 @@ 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; /** * 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 80443a948a..6effbd5eb8 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.JsonIgnoreProperties; 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 @@ import io.swagger.annotations.ApiModelProperty; @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 7f4f96e3bb..1e651ee6e3 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 org.apache.dolphinscheduler.plugin.task.api.enums.TaskTimeoutStrategy; 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 @@ import io.swagger.annotations.ApiModelProperty; @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 14d29965f6..634db40ebb 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,26 +24,24 @@ 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; /** * 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 d0725b29cf..b5a8ea7a46 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 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; /** * task update request @@ -42,63 +42,63 @@ import io.swagger.annotations.ApiModelProperty; @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 05e6b7b4f0..2c92024db3 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 org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; 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 @@ import io.swagger.annotations.ApiModelProperty; @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 f81d1cea6e..bd45212d4b 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 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; /** * 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 39e32dcad7..d2903787e6 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,26 +24,24 @@ 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; /** * 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 3c82868058..0f0e998281 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 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; /** * task relation update request @@ -39,10 +39,10 @@ import io.swagger.annotations.ApiModelProperty; @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 85552c9904..a8f8114b3a 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 org.apache.dolphinscheduler.dao.entity.ProcessDefinition; 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 @@ import io.swagger.annotations.ApiModelProperty; @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 5a5681754c..2f1282aa58 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,29 +25,27 @@ 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; /** * 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 103bf5612e..7e3d90d46a 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 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; /** * workflow update request @@ -38,31 +38,31 @@ import io.swagger.annotations.ApiModelProperty; @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 aa68578219..8e27ac2cce 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: diff --git a/dolphinscheduler-bom/pom.xml b/dolphinscheduler-bom/pom.xml index aacfc896f1..337312e0dd 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 @@ -98,6 +97,7 @@ 1.31 4.1.1 2.17.282 + 1.6.9 @@ -561,11 +561,6 @@ javax.servlet-api ${javax.servlet-api.version} - - io.springfox - springfox-boot-starter - ${springfox.version} - com.github.rholder @@ -753,6 +748,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 2ad573a241..c4948c45f4 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 @@ -377,22 +376,18 @@ 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 - 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-ui 1.6.9: https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui/1.6.9, 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 @@ -588,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 f052b4665d..0000000000 --- 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 7b1adee7af..0000000000 --- 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 7b1adee7af..0000000000 --- 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 980a15ac24..7a4a3ea242 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-core.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-ui.txt similarity index 98% rename from dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-core.txt rename to dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-ui.txt index 980a15ac24..835428fbaa 100644 --- a/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-core.txt +++ b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springdoc-openapi-ui.txt @@ -1,4 +1,4 @@ - Apache License + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -178,7 +178,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 +186,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 +198,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 980a15ac24..7a4a3ea242 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-swagger-common.txt b/dolphinscheduler-dist/release-docs/licenses/LICENSE-springfox-swagger-common.txt deleted file mode 100644 index 980a15ac24..0000000000 --- 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 980a15ac24..0000000000 --- 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 980a15ac24..0000000000 --- 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 980a15ac24..7a4a3ea242 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 0000000000..657c7a2da8 --- /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 0000000000..decadab03c --- /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 diff --git a/tools/dependencies/known-dependencies.txt b/tools/dependencies/known-dependencies.txt index 9a6c44d584..1b8e9304b0 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,32 +309,20 @@ 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 spring-tx-5.3.22.jar spring-web-5.3.22.jar spring-webmvc-5.3.22.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 +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-1.5.20.jar -swagger-annotations-2.1.2.jar -swagger-models-1.5.20.jar -swagger-models-2.1.2.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 @@ -365,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