From 0dcded3465e1ad751e561bbbcbf4db5d07a70e73 Mon Sep 17 00:00:00 2001 From: zhu-mingye <934230207@qq.com> Date: Fri, 15 Sep 2023 21:42:52 +0800 Subject: [PATCH] refactor api model --- .../org/dinky/configure/Knife4jConfig.java | 7 +- .../org/dinky/controller/APIController.java | 119 +++++++++++++- .../org/dinky/controller/AdminController.java | 10 ++ .../controller/AlertGroupController.java | 33 +++- .../controller/AlertHistoryController.java | 8 + .../controller/AlertInstanceController.java | 50 +++++- .../dinky/controller/AlertRuleController.java | 10 ++ ...ller.java => AlertTemplateController.java} | 8 +- .../dinky/controller/CatalogueController.java | 37 ++++- .../ClusterConfigurationController.java | 29 ++++ .../controller/ClusterInstanceController.java | 47 ++++++ .../dinky/controller/DataBaseController.java | 152 ++++++++++++++++++ .../dinky/controller/DocumentController.java | 39 +++++ .../dinky/controller/FlinkConfController.java | 2 + .../controller/FlinkProxyController.java | 2 +- .../dinky/controller/FragmentController.java | 29 ++++ .../org/dinky/controller/GitController.java | 80 +++++++++ .../dinky/controller/HistoryController.java | 2 + .../controller/JobInstanceController.java | 107 ++++++++++++ .../org/dinky/controller/LdapController.java | 3 + .../org/dinky/controller/LogController.java | 17 ++ .../org/dinky/controller/MenuController.java | 10 ++ .../dinky/controller/MonitorController.java | 24 +++ .../controller/PrintTableController.java | 3 + .../dinky/controller/ProcessController.java | 5 + .../dinky/controller/ResourceController.java | 54 +++++++ .../org/dinky/controller/RoleController.java | 36 +++++ .../dinky/controller/RoleMenuController.java | 7 + .../controller/RowPermissionsController.java | 22 +++ .../controller/SavePointsController.java | 9 ++ .../dinky/controller/SchedulerController.java | 68 ++++++++ .../org/dinky/controller/SseController.java | 3 + .../dinky/controller/StatementController.java | 10 ++ .../dinky/controller/StudioController.java | 106 ++++++++++++ .../dinky/controller/SysConfigController.java | 8 + .../dinky/controller/SystemController.java | 2 + .../org/dinky/controller/TaskController.java | 38 +++++ .../controller/TaskVersionController.java | 6 + .../dinky/controller/TenantController.java | 28 ++++ .../org/dinky/controller/TokenController.java | 4 + .../org/dinky/controller/UDFController.java | 25 +++ .../org/dinky/controller/UserController.java | 90 +++++++++++ .../java/org/dinky/data/dto/APICancelDTO.java | 15 ++ .../org/dinky/data/dto/APIExecuteJarDTO.java | 25 +++ .../org/dinky/data/dto/APIExecuteSqlDTO.java | 67 +++++++- .../org/dinky/data/dto/APIExplainSqlDTO.java | 15 ++ .../org/dinky/data/dto/APISavePointDTO.java | 27 ++++ .../dinky/data/dto/APISavePointTaskDTO.java | 10 ++ .../dinky/data/dto/AbstractStatementDTO.java | 15 ++ .../java/org/dinky/data/dto/AlertRuleDTO.java | 50 ++++++ .../dinky/data/dto/AssignMenuToRoleDto.java | 11 ++ .../org/dinky/data/dto/CatalogueTaskDTO.java | 37 +++++ .../org/dinky/data/dto/GitAnalysisJarDTO.java | 21 +++ .../org/dinky/data/dto/GitProjectDTO.java | 72 +++++++-- .../org/dinky/data/dto/JarClassesDTO.java | 15 ++ .../java/org/dinky/data/dto/LoginDTO.java | 12 ++ .../org/dinky/data/dto/MetricsLayoutDTO.java | 52 +++++- .../org/dinky/data/dto/ModifyPasswordDTO.java | 22 +++ .../java/org/dinky/data/dto/ResourcesDTO.java | 21 +++ .../java/org/dinky/data/dto/RoleMenuDto.java | 19 ++- .../java/org/dinky/data/dto/SessionDTO.java | 38 ----- .../main/java/org/dinky/data/dto/SqlDTO.java | 20 +++ .../java/org/dinky/data/dto/StudioCADTO.java | 19 ++- .../java/org/dinky/data/dto/StudioDDLDTO.java | 42 +++++ .../org/dinky/data/dto/StudioExecuteDTO.java | 107 +++++++++++- .../dinky/data/dto/StudioMetaStoreDTO.java | 24 +++ .../data/dto/TaskRollbackVersionDTO.java | 10 ++ .../data/dto/TaskVersionConfigureDTO.java | 99 +++++++++--- .../dinky/data/dto/TaskVersionHistoryDTO.java | 42 +++++ .../java/org/dinky/data/dto/TreeNodeDTO.java | 37 +++++ .../main/java/org/dinky/data/dto/UserDTO.java | 14 ++ .../java/org/dinky/data/model/AlertGroup.java | 7 + .../org/dinky/data/model/AlertHistory.java | 21 +++ .../org/dinky/data/model/AlertInstance.java | 19 +++ .../java/org/dinky/data/model/AlertRule.java | 16 +- .../java/org/dinky/data/model/Catalogue.java | 7 + .../java/org/dinky/data/model/Cluster.java | 49 ++++++ .../data/model/ClusterConfiguration.java | 24 +++ .../java/org/dinky/data/model/ConfigItem.java | 6 + .../java/org/dinky/data/model/DataBase.java | 19 +++ .../java/org/dinky/data/model/Document.java | 47 ++++++ .../java/org/dinky/data/model/FileNode.java | 64 +++----- .../dinky/data/model/FragmentVariable.java | 8 + .../java/org/dinky/data/model/GitProject.java | 36 +++-- .../java/org/dinky/data/model/History.java | 25 +++ .../org/dinky/data/model/HomeResource.java | 23 ++- .../main/java/org/dinky/data/model/Jar.java | 21 +++ .../java/org/dinky/data/model/JobHistory.java | 70 ++++++++ .../org/dinky/data/model/JobInfoDetail.java | 25 +++ .../org/dinky/data/model/JobInstance.java | 64 ++++++++ .../dinky/data/model/JobInstanceCount.java | 40 ++--- .../dinky/data/model/JobInstanceStatus.java | 77 +++++++++ .../data/model/JobManagerConfiguration.java | 10 ++ .../dinky/data/model/JobModelOverview.java | 13 +- .../dinky/data/model/JobStatusOverView.java | 27 ++++ .../org/dinky/data/model/JobTypeOverView.java | 20 ++- .../data/model/LdapUserIdentification.java | 16 ++ .../java/org/dinky/data/model/LoginLog.java | 40 ++++- .../main/java/org/dinky/data/model/Menu.java | 42 ++++- .../java/org/dinky/data/model/Metrics.java | 40 +++-- .../java/org/dinky/data/model/OperateLog.java | 72 +++++++-- .../java/org/dinky/data/model/Resources.java | 68 ++++++-- .../main/java/org/dinky/data/model/Role.java | 49 ++++-- .../java/org/dinky/data/model/RoleMenu.java | 29 ++++ .../org/dinky/data/model/RowPermissions.java | 60 ++++++- .../java/org/dinky/data/model/Savepoints.java | 33 +++- .../org/dinky/data/model/SqlGeneration.java | 50 +++--- .../java/org/dinky/data/model/Statement.java | 10 ++ .../java/org/dinky/data/model/SysConfig.java | 31 +++- .../java/org/dinky/data/model/SysToken.java | 75 ++++++++- .../main/java/org/dinky/data/model/Task.java | 96 +++++++++++ .../data/model/TaskContainerConfigInfo.java | 16 ++ .../org/dinky/data/model/TaskExtConfig.java | 13 +- .../data/model/TaskManagerConfiguration.java | 39 +++++ .../org/dinky/data/model/TaskUdfConfig.java | 8 + .../org/dinky/data/model/TaskVersion.java | 29 ++-- .../java/org/dinky/data/model/Tenant.java | 17 ++ .../org/dinky/data/model/UDFTemplate.java | 9 +- .../dinky/data/model/UploadFileRecord.java | 1 + .../main/java/org/dinky/data/model/User.java | 36 ++++- .../java/org/dinky/data/model/UserRole.java | 32 +++- .../java/org/dinky/data/model/UserTenant.java | 35 +++- .../dinky/data/params/AssignRoleParams.java | 11 +- .../data/params/AssignUserToTenantParams.java | 14 +- .../data/params/GitProjectSortJarParams.java | 12 +- .../dinky/data/properties/OssProperties.java | 53 ++++-- .../org/dinky/data/result/APIJobResult.java | 52 ++++++ .../org/dinky/data/result/PageResult.java | 12 +- .../org/dinky/data/result/ProTableResult.java | 28 +++- .../java/org/dinky/data/result/Result.java | 42 ++++- .../org/dinky/data/result/StepResult.java | 29 +++- .../data/result/TaskOperatingResult.java | 33 +++- .../java/org/dinky/data/vo/CascaderVO.java | 16 +- .../main/java/org/dinky/data/vo/MetaVo.java | 17 +- .../java/org/dinky/data/vo/MetricsVO.java | 23 +++ .../main/java/org/dinky/data/vo/RouterVo.java | 34 +++- .../main/java/org/dinky/data/vo/UserVo.java | 11 ++ .../org/dinky/mybatis/model/SuperEntity.java | 16 ++ .../src/main/resources/application.properties | 2 +- .../src/main/resources/application.yml | 1 + dinky-common/pom.xml | 4 + .../java/org/dinky/data/model/QueryData.java | 48 ++++++ .../main/java/org/dinky/job/JobConfig.java | 138 +++++++++++++++- .../main/java/org/dinky/job/JobResult.java | 61 +++++++ .../org/dinky/executor/ExecutorSetting.java | 43 +++++ dinky-gateway/pom.xml | 4 + .../org/dinky/gateway/config/AppConfig.java | 24 ++- .../dinky/gateway/config/ClusterConfig.java | 26 +++ .../org/dinky/gateway/config/FlinkConfig.java | 50 ++++++ .../dinky/gateway/config/GatewayConfig.java | 31 ++++ .../org/dinky/gateway/config/K8sConfig.java | 33 ++++ .../gateway/model/FlinkClusterConfig.java | 29 ++++ .../java/org/dinky/gateway/model/JobInfo.java | 20 +++ .../gateway/result/KubernetesResult.java | 21 +++ .../dinky/gateway/result/SavePointResult.java | 15 ++ .../org/dinky/gateway/result/TestResult.java | 15 ++ .../org/dinky/gateway/result/YarnResult.java | 21 +++ .../dinky/metadata/driver/DriverConfig.java | 44 +++++ dinky-metadata/pom.xml | 7 + 159 files changed, 4670 insertions(+), 361 deletions(-) rename dinky-admin/src/main/java/org/dinky/controller/{AlertTemplateConteroller.java => AlertTemplateController.java} (91%) delete mode 100644 dinky-admin/src/main/java/org/dinky/data/dto/SessionDTO.java diff --git a/dinky-admin/src/main/java/org/dinky/configure/Knife4jConfig.java b/dinky-admin/src/main/java/org/dinky/configure/Knife4jConfig.java index 891b0d7195..c9bf73b39e 100644 --- a/dinky-admin/src/main/java/org/dinky/configure/Knife4jConfig.java +++ b/dinky-admin/src/main/java/org/dinky/configure/Knife4jConfig.java @@ -23,6 +23,7 @@ import java.util.Collection; import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; @@ -44,6 +45,7 @@ import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver; +import cn.dev33.satoken.config.SaTokenConfig; import lombok.RequiredArgsConstructor; import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration; import springfox.documentation.builders.ApiInfoBuilder; @@ -64,6 +66,9 @@ public class Knife4jConfig { @Value("${dinky.version}") private String dinkyVersion; + @Autowired + SaTokenConfig saTokenConfigure; + private final OpenApiExtensionResolver openApiExtensionResolver; @Bean(value = "defaultApi2") @@ -99,7 +104,7 @@ public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping( CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties, Environment environment) { - List> allEndpoints = new ArrayList(); + List> allEndpoints = new ArrayList<>(); Collection webEndpoints = webEndpointsSupplier.getEndpoints(); allEndpoints.addAll(webEndpoints); allEndpoints.addAll(servletEndpointsSupplier.getEndpoints()); diff --git a/dinky-admin/src/main/java/org/dinky/controller/APIController.java b/dinky-admin/src/main/java/org/dinky/controller/APIController.java index 10b48a2c83..b5dc6eeedb 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/APIController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/APIController.java @@ -19,14 +19,12 @@ package org.dinky.controller; -import org.dinky.data.annotation.Log; import org.dinky.data.dto.APICancelDTO; import org.dinky.data.dto.APIExecuteJarDTO; import org.dinky.data.dto.APIExecuteSqlDTO; import org.dinky.data.dto.APIExplainSqlDTO; import org.dinky.data.dto.APISavePointDTO; import org.dinky.data.dto.APISavePointTaskDTO; -import org.dinky.data.enums.BusinessType; import org.dinky.data.enums.Status; import org.dinky.data.model.JobInstance; import org.dinky.data.result.APIJobResult; @@ -50,6 +48,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -75,6 +75,7 @@ public class APIController { @GetMapping("/submitTask") @ApiOperation("Submit Task") // @Log(title = "Submit Task", businessType = BusinessType.SUBMIT) + @ApiImplicitParam(name = "id", value = "Task Id", required = true, dataType = "Integer") public Result submitTask(@RequestParam Integer id) { taskService.initTenantByTaskId(id); return Result.succeed(taskService.submitTask(id), Status.EXECUTE_SUCCESS); @@ -83,6 +84,12 @@ public Result submitTask(@RequestParam Integer id) { @PostMapping("/executeSql") @ApiOperation("Execute Sql") // @Log(title = "Execute Sql", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "apiExecuteSqlDTO", + value = "API Execute Sql DTO", + required = true, + dataType = "APIExecuteSqlDTO", + dataTypeClass = APIExecuteSqlDTO.class) public Result executeSql(@RequestBody APIExecuteSqlDTO apiExecuteSqlDTO) { return Result.succeed(apiService.executeSql(apiExecuteSqlDTO), Status.EXECUTE_SUCCESS); } @@ -90,38 +97,74 @@ public Result executeSql(@RequestBody APIExecuteSqlDTO apiExecuteS @PostMapping("/explainSql") @ApiOperation("Explain Sql") // @Log(title = "Explain Sql", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "apiExecuteSqlDTO", + value = "API Execute Sql DTO", + required = true, + dataType = "APIExecuteSqlDTO", + dataTypeClass = APIExecuteSqlDTO.class) public Result explainSql(@RequestBody APIExplainSqlDTO apiExecuteSqlDTO) { return Result.succeed(apiService.explainSql(apiExecuteSqlDTO), Status.EXECUTE_SUCCESS); } @PostMapping("/getJobPlan") @ApiOperation("Get Job Plan") + @ApiImplicitParam( + name = "apiExecuteSqlDTO", + value = "API Execute Sql DTO", + required = true, + dataType = "APIExecuteSqlDTO", + dataTypeClass = APIExecuteSqlDTO.class) public Result getJobPlan(@RequestBody APIExplainSqlDTO apiExecuteSqlDTO) { return Result.succeed(apiService.getJobPlan(apiExecuteSqlDTO), Status.EXECUTE_SUCCESS); } @PostMapping("/getStreamGraph") @ApiOperation("Get Stream Graph") + @ApiImplicitParam( + name = "apiExecuteSqlDTO", + value = "API Execute Sql DTO", + required = true, + dataType = "APIExecuteSqlDTO", + dataTypeClass = APIExecuteSqlDTO.class) public Result getStreamGraph(@RequestBody APIExplainSqlDTO apiExecuteSqlDTO) { return Result.succeed(apiService.getStreamGraph(apiExecuteSqlDTO), Status.EXECUTE_SUCCESS); } @GetMapping("/getJobData") @ApiOperation("Get Job Data") + @ApiImplicitParam( + name = "jobId", + value = "Job Id", + required = true, + dataType = "String", + dataTypeClass = String.class) public Result getJobData(@RequestParam String jobId) { return Result.succeed(studioService.getJobData(jobId)); } @PostMapping("/cancel") - @Log(title = "Cancel Flink Job", businessType = BusinessType.TRIGGER) + // @Log(title = "Cancel Flink Job", businessType = BusinessType.TRIGGER) @ApiOperation("Cancel Flink Job") + @ApiImplicitParam( + name = "apiCancelDTO", + value = "API Cancel DTO", + required = true, + dataType = "APICancelDTO", + dataTypeClass = APICancelDTO.class) public Result cancel(@RequestBody APICancelDTO apiCancelDTO) { return Result.succeed(apiService.cancel(apiCancelDTO), Status.EXECUTE_SUCCESS); } @PostMapping("/savepoint") - @Log(title = "Savepoint Trigger", businessType = BusinessType.TRIGGER) + // @Log(title = "Savepoint Trigger", businessType = BusinessType.TRIGGER) @ApiOperation("Savepoint Trigger") + @ApiImplicitParam( + name = "apiSavePointDTO", + value = "API SavePoint DTO", + required = true, + dataType = "APISavePointDTO", + dataTypeClass = APISavePointDTO.class) public Result savepoint(@RequestBody APISavePointDTO apiSavePointDTO) { return Result.succeed(apiService.savepoint(apiSavePointDTO), Status.EXECUTE_SUCCESS); } @@ -129,6 +172,12 @@ public Result savepoint(@RequestBody APISavePointDTO apiSavePoi @PostMapping("/executeJar") @ApiOperation("Execute Jar") // @Log(title = "Execute Jar", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "apiExecuteJarDTO", + value = "API Execute Jar DTO", + required = true, + dataType = "APIExecuteJarDTO", + dataTypeClass = APIExecuteJarDTO.class) public Result executeJar(@RequestBody APIExecuteJarDTO apiExecuteJarDTO) { return Result.succeed(apiService.executeJar(apiExecuteJarDTO), Status.EXECUTE_SUCCESS); } @@ -136,6 +185,12 @@ public Result executeJar(@RequestBody APIExecuteJarDTO apiExecuteJ @PostMapping("/savepointTask") @ApiOperation("Savepoint Task") // @Log(title = "Savepoint Task", businessType = BusinessType.TRIGGER) + @ApiImplicitParam( + name = "apiSavePointTaskDTO", + value = "API SavePoint Task DTO", + required = true, + dataType = "APISavePointTaskDTO", + dataTypeClass = APISavePointTaskDTO.class) public Result savepointTask(@RequestBody APISavePointTaskDTO apiSavePointTaskDTO) { return Result.succeed( taskService.savepointTask(apiSavePointTaskDTO.getTaskId(), apiSavePointTaskDTO.getType()), "执行成功"); @@ -145,6 +200,12 @@ public Result savepointTask(@RequestBody APISavePointTaskDTO apiSavePoi @GetMapping("/restartTask") @ApiOperation("Restart Task") // @Log(title = "Restart Task", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) public Result restartTask(@RequestParam Integer id) { taskService.initTenantByTaskId(id); return Result.succeed(taskService.restartTask(id, null), Status.RESTART_SUCCESS); @@ -154,6 +215,20 @@ public Result restartTask(@RequestParam Integer id) { @GetMapping("/selectSavePointRestartTask") @ApiOperation("Select SavePoint Restart Task") // @Log(title = "Select SavePoint Restart Task", businessType = BusinessType.EXECUTE) + @ApiImplicitParams({ + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class), + @ApiImplicitParam( + name = "savePointPath", + value = "SavePoint Path", + required = true, + dataType = "String", + dataTypeClass = String.class) + }) public Result restartTask(@RequestParam Integer id, @RequestParam String savePointPath) { taskService.initTenantByTaskId(id); return Result.succeed(taskService.restartTask(id, savePointPath), Status.RESTART_SUCCESS); @@ -163,6 +238,12 @@ public Result restartTask(@RequestParam Integer id, @RequestParam Str @GetMapping("/onLineTask") @ApiOperation("Online Task") // @Log(title = "Online Task", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) public Result onLineTask(@RequestParam Integer id) { taskService.initTenantByTaskId(id); return taskService.onLineTask(id); @@ -172,6 +253,12 @@ public Result onLineTask(@RequestParam Integer id) { @GetMapping("/offLineTask") @ApiOperation("Offline Task") // @Log(title = "Offline Task", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) public Result offLineTask(@RequestParam Integer id) { taskService.initTenantByTaskId(id); return taskService.offLineTask(id, null); @@ -181,6 +268,12 @@ public Result offLineTask(@RequestParam Integer id) { @GetMapping("/reOnLineTask") @ApiOperation("ReOnline Task") // @Log(title = "ReOnline Task", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) public Result reOnLineTask(@RequestParam Integer id) { taskService.initTenantByTaskId(id); return taskService.reOnLineTask(id, null); @@ -190,6 +283,12 @@ public Result reOnLineTask(@RequestParam Integer id) { @GetMapping("/selectSavePointReOnLineTask") @ApiOperation("Select SavePoint ReOnline Task") // @Log(title = "Select SavePoint ReOnline Task", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) public Result selectSavePointReOnLineTask(@RequestParam Integer id, @RequestParam String savePointPath) { taskService.initTenantByTaskId(id); return taskService.reOnLineTask(id, savePointPath); @@ -199,6 +298,12 @@ public Result selectSavePointReOnLineTask(@RequestParam Integer id, @ @GetMapping("/getJobInstance") @ApiOperation("Get Job Instance") // @Log(title = "Get Job Instance", businessType = BusinessType.QUERY) + @ApiImplicitParam( + name = "id", + value = "Job Instance Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) public Result getJobInstance(@RequestParam Integer id) { jobInstanceService.initTenantByJobInstanceId(id); return Result.succeed(jobInstanceService.getById(id)); @@ -208,6 +313,12 @@ public Result getJobInstance(@RequestParam Integer id) { @GetMapping("/getJobInstanceByTaskId") @ApiOperation("Get Job Instance By Task Id") // @Log(title = "Get Job Instance By Task Id", businessType = BusinessType.QUERY) + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) public Result getJobInstanceByTaskId(@RequestParam Integer id) { taskService.initTenantByTaskId(id); return Result.succeed(jobInstanceService.getJobInstanceByTaskId(id)); diff --git a/dinky-admin/src/main/java/org/dinky/controller/AdminController.java b/dinky-admin/src/main/java/org/dinky/controller/AdminController.java index dc762e5c30..09be4930d3 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AdminController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AdminController.java @@ -39,6 +39,7 @@ import cn.dev33.satoken.stp.SaTokenInfo; import cn.dev33.satoken.stp.StpUtil; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -64,6 +65,7 @@ public class AdminController { * @return {@link Result}{@link UserDTO} obtain the user's UserDTO */ @PostMapping("/login") + @ApiImplicitParam(name = "loginDTO", value = "LoginDTO", required = true, dataTypeClass = LoginDTO.class) @ApiOperation(value = "Login", notes = "Login") public Result login(@RequestBody LoginDTO loginDTO) { return userService.loginUser(loginDTO); @@ -102,6 +104,7 @@ public Result getCurrentUserInfo() { */ @PostMapping("/chooseTenant") @SaCheckLogin + @ApiImplicitParam(name = "tenantId", value = "tenantId", required = true, dataTypeClass = Integer.class) @ApiOperation(value = "Choose Tenant To Login", notes = "Choose Tenant To Login") public Result switchingTenant(@RequestParam("tenantId") Integer tenantId) { return userService.chooseTenant(tenantId); @@ -118,4 +121,11 @@ public Result switchingTenant(@RequestParam("tenantId") Integer tenantId public Result getTokenInfo() { return Result.succeed(StpUtil.getTokenInfo()); } + + @GetMapping("/keepAlive") + @SaCheckLogin + @ApiOperation(value = "Query Current User Token Info", notes = "Query Current User Token Info") + public Result keepAlive() { + return Result.succeed(StpUtil.getTokenInfo()); + } } diff --git a/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java b/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java index 6cec3bdcb9..c33f6f9a0a 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java @@ -43,6 +43,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -67,6 +68,12 @@ public class AlertGroupController { */ @PutMapping @Log(title = "Insert OR Update AlertGroup ", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "alertGroup", + value = "AlertGroup", + required = true, + dataType = "AlertGroup", + dataTypeClass = AlertGroup.class) @ApiOperation("Insert OR Update AlertGroup") public Result saveOrUpdateAlertGroup(@RequestBody AlertGroup alertGroup) throws Exception { if (alertGroupService.saveOrUpdate(alertGroup)) { @@ -83,6 +90,12 @@ public Result saveOrUpdateAlertGroup(@RequestBody AlertGroup alertGroup) t * @return {@link ProTableResult} with {@link AlertGroup} */ @PostMapping + @ApiImplicitParam( + name = "para", + value = "JsonNode", + required = true, + dataType = "JsonNode", + dataTypeClass = JsonNode.class) @ApiOperation("Query AlertGroup List") public ProTableResult listAlertGroups(@RequestBody JsonNode para) { return alertGroupService.selectForProTable(para); @@ -106,8 +119,14 @@ public Result> listEnabledAllAlertGroups() { */ @PutMapping("/enable") @ApiOperation("Update AlertGroup Status") + @ApiImplicitParam( + name = "id", + value = "AlertGroup Id", + required = true, + dataTypeClass = Integer.class, + dataType = "Integer") @Log(title = "Update AlertGroup Status", businessType = BusinessType.UPDATE) - public Result> modifyAlertGroupStatus(@RequestParam("id") Integer id) { + public Result modifyAlertGroupStatus(@RequestParam("id") Integer id) { if (alertGroupService.modifyAlertGroupStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); } else { @@ -123,6 +142,12 @@ public Result> modifyAlertGroupStatus(@RequestParam("id") Integ */ @DeleteMapping("/delete") @ApiOperation("Delete AlertGroup By Id") + @ApiImplicitParam( + name = "id", + value = "AlertGroup Id", + required = true, + dataTypeClass = Integer.class, + dataType = "Integer") @Log(title = "Delete AlertGroup By Id", businessType = BusinessType.DELETE) public Result deleteGroupById(@RequestParam("id") Integer id) { if (alertGroupService.deleteGroupById(id)) { @@ -139,6 +164,12 @@ public Result deleteGroupById(@RequestParam("id") Integer id) { * @return {@link ProTableResult} with {@link AlertHistory} */ @PostMapping("/history") + @ApiImplicitParam( + name = "para", + value = "JsonNode", + dataType = "JsonNode", + required = true, + dataTypeClass = JsonNode.class) @ApiOperation("Query AlertHistory List") public ProTableResult listAlertHistory(@RequestBody JsonNode para) { return alertHistoryService.selectForProTable(para); diff --git a/dinky-admin/src/main/java/org/dinky/controller/AlertHistoryController.java b/dinky-admin/src/main/java/org/dinky/controller/AlertHistoryController.java index ca373c2702..0954c7cd13 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AlertHistoryController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AlertHistoryController.java @@ -33,6 +33,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -54,6 +55,13 @@ public class AlertHistoryController { /** 动态查询列表 */ @PostMapping @ApiOperation("Query Alert History") + @ApiImplicitParam( + name = "para", + value = "Query Alert History", + dataTypeClass = JsonNode.class, + paramType = "body", + required = true, + dataType = "JsonNode") @Log(title = "Query Alert History", businessType = BusinessType.QUERY) public ProTableResult listAlertHistoryRecord(@RequestBody JsonNode para) { return alertHistoryService.selectForProTable(para); diff --git a/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java b/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java index be40cb28eb..926f12fbbb 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java @@ -41,8 +41,11 @@ import org.springframework.web.bind.annotation.RestController; import com.fasterxml.jackson.databind.JsonNode; +import com.github.xiaoymin.knife4j.annotations.DynamicParameter; +import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -67,6 +70,13 @@ public class AlertInstanceController { @PutMapping @Log(title = "Insert OR Update AlertInstance", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert OR Update AlertInstance") + @ApiImplicitParam( + name = "alertInstance", + value = "AlertInstance", + dataType = "AlertInstance", + paramType = "body", + required = true, + dataTypeClass = AlertInstance.class) public Result saveOrUpdate(@RequestBody AlertInstance alertInstance) throws Exception { if (alertInstanceService.saveOrUpdate(alertInstance)) { AlertPool.remove(alertInstance.getName()); @@ -84,6 +94,13 @@ public Result saveOrUpdate(@RequestBody AlertInstance alertInstance) throw */ @PostMapping @ApiOperation("Query AlertInstance List") + @ApiImplicitParam( + name = "para", + value = "Query Condition", + dataType = "JsonNode", + paramType = "body", + required = true, + dataTypeClass = JsonNode.class) public ProTableResult listAlertInstances(@RequestBody JsonNode para) { return alertInstanceService.selectForProTable(para); } @@ -97,7 +114,14 @@ public ProTableResult listAlertInstances(@RequestBody JsonNode pa @DeleteMapping("/delete") @Log(title = "Delete AlertInstance By Id", businessType = BusinessType.DELETE) @ApiOperation("Delete AlertInstance By Id") - public Result deleteAlertInstanceById(@RequestParam("id") Integer id) { + @ApiImplicitParam( + name = "id", + value = "AlertInstance Id", + dataType = "Integer", + paramType = "query", + required = true, + dataTypeClass = Integer.class) + public Result deleteAlertInstanceById(@RequestParam("id") Integer id) { if (alertInstanceService.deleteAlertInstance(id)) { return Result.succeed(Status.DELETE_SUCCESS); } else { @@ -114,7 +138,14 @@ public Result deleteAlertInstanceById(@RequestParam("id") Integer @PutMapping("/enable") @Log(title = "Update AlertInstance Status", businessType = BusinessType.UPDATE) @ApiOperation("Update AlertInstance Status") - public Result modifyAlertInstanceStatus(@RequestParam("id") Integer id) { + @ApiImplicitParam( + name = "id", + value = "AlertInstance Id", + dataType = "Integer", + paramType = "query", + required = true, + dataTypeClass = Integer.class) + public Result modifyAlertInstanceStatus(@RequestParam("id") Integer id) { if (alertInstanceService.modifyAlertInstanceStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); } else { @@ -129,6 +160,14 @@ public Result modifyAlertInstanceStatus(@RequestParam("id") Integ */ @GetMapping("/listEnabledAll") @ApiOperation("Query AlertInstance List Of Enable") + @DynamicResponseParameters( + properties = { + @DynamicParameter(name = "success", value = "Result Success", dataTypeClass = Boolean.class), + @DynamicParameter(name = "data", value = "Result AlertInstance Data", dataTypeClass = List.class), + @DynamicParameter(name = "code", value = "Result Code", dataTypeClass = Integer.class), + @DynamicParameter(name = "msg", value = "Result Message", dataTypeClass = String.class), + @DynamicParameter(name = "time", value = "Result Time", dataTypeClass = String.class), + }) public Result> listEnabledAll() { return Result.succeed(alertInstanceService.listEnabledAll()); } @@ -142,6 +181,13 @@ public Result> listEnabledAll() { @PostMapping("/sendTest") @Log(title = "Test Send To AlertInstance", businessType = BusinessType.TEST) @ApiOperation("Test Send To AlertInstance") + @ApiImplicitParam( + name = "alertInstance", + value = "AlertInstance", + dataType = "AlertInstance", + paramType = "body", + required = true, + dataTypeClass = AlertInstance.class) public Result sendAlertMsgTest(@RequestBody AlertInstance alertInstance) { AlertResult alertResult = alertInstanceService.testAlert(alertInstance); if (alertResult.getSuccess()) { diff --git a/dinky-admin/src/main/java/org/dinky/controller/AlertRuleController.java b/dinky-admin/src/main/java/org/dinky/controller/AlertRuleController.java index 1a0953a8ef..856a7d7f7b 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AlertRuleController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AlertRuleController.java @@ -20,6 +20,8 @@ package org.dinky.controller; import org.dinky.configure.schedule.Alert.JobAlerts; +import org.dinky.data.annotation.Log; +import org.dinky.data.enums.BusinessType; import org.dinky.data.enums.Status; import org.dinky.data.model.AlertRule; import org.dinky.data.result.ProTableResult; @@ -39,18 +41,22 @@ import com.fasterxml.jackson.databind.JsonNode; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @RestController @RequestMapping("/api/alertRule") +@Api(tags = "Alert Rule Controller") public class AlertRuleController { private final AlertRuleService alertRuleService; private final JobAlerts jobAlerts; @PostMapping("/list") + @ApiOperation("Query alert rules list") public ProTableResult list(@RequestBody JsonNode para) { ProTableResult result = alertRuleService.selectForProTable(para); // The reason for this is to deal with internationalization @@ -70,6 +76,8 @@ public ProTableResult list(@RequestBody JsonNode para) { dataType = "AlertRule", paramType = "body", dataTypeClass = AlertRule.class) + @ApiOperation("Save or update alert rule") + @Log(title = "Save or update alert rule", businessType = BusinessType.INSERT_OR_UPDATE) public Result saveOrUpdateAlertRule(@RequestBody AlertRule alertRule) { boolean saved = alertRuleService.saveOrUpdate(alertRule); if (saved) { @@ -88,6 +96,8 @@ public Result saveOrUpdateAlertRule(@RequestBody AlertRule alertRule) { paramType = "query", dataTypeClass = Integer.class, example = "1") + @ApiOperation("Delete alert rule") + @Log(title = "Delete alert rule", businessType = BusinessType.DELETE) public Result deleteAlertRuleById(@RequestParam Integer id) { if (alertRuleService.removeById(id)) { return Result.succeed(Status.DELETE_SUCCESS); diff --git a/dinky-admin/src/main/java/org/dinky/controller/AlertTemplateConteroller.java b/dinky-admin/src/main/java/org/dinky/controller/AlertTemplateController.java similarity index 91% rename from dinky-admin/src/main/java/org/dinky/controller/AlertTemplateConteroller.java rename to dinky-admin/src/main/java/org/dinky/controller/AlertTemplateController.java index 7cb0362b1f..23cfa49357 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AlertTemplateConteroller.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AlertTemplateController.java @@ -36,23 +36,28 @@ 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.ApiOperation; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @RestController @RequestMapping("/api/alertTemplate") -public class AlertTemplateConteroller { +@Api(tags = "Alert Template Controller") +public class AlertTemplateController { private final AlertTemplateService alertTemplateService; @GetMapping + @ApiOperation("Query alert templates list") public Result> list() { return Result.succeed(alertTemplateService.list()); } @DeleteMapping @Log(title = "Delete AlertTemplate ", businessType = BusinessType.DELETE) + @ApiOperation("Delete alert template") @ApiImplicitParam( name = "id", value = "AlertTemplate ID", @@ -69,6 +74,7 @@ public Result deleteAlertTemplateById(@RequestParam Integer id) { @PutMapping @Log(title = "Insert OR Update AlertTemplate ", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiOperation("Insert OR Update alert template") @ApiImplicitParam( name = "alertTemplate", value = "AlertTemplate", diff --git a/dinky-admin/src/main/java/org/dinky/controller/CatalogueController.java b/dinky-admin/src/main/java/org/dinky/controller/CatalogueController.java index e9e58e442b..f921ea57b7 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/CatalogueController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/CatalogueController.java @@ -44,6 +44,8 @@ import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ZipUtil; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -105,6 +107,12 @@ public Result upload(MultipartFile file, @PathVariable Integer id) { @PutMapping("saveOrUpdateCatalogue") @Log(title = "Insert Or Update Catalogue", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update Catalogue") + @ApiImplicitParam( + name = "catalogue", + value = "catalogue", + required = true, + dataType = "Catalogue", + dataTypeClass = Catalogue.class) public Result saveOrUpdateCatalogue(@RequestBody Catalogue catalogue) { if (catalogueService.saveOrUpdateOrRename(catalogue)) { return Result.succeed(Status.SAVE_SUCCESS); @@ -132,6 +140,12 @@ public Result> getCatalogueTree() { @PutMapping("/saveOrUpdateCatalogueAndTask") @Log(title = "Create Catalogue And Task", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Create Catalogue And Task") + @ApiImplicitParam( + name = "catalogueTaskDTO", + value = "catalogueTaskDTO", + required = true, + dataType = "CatalogueTaskDTO", + dataTypeClass = CatalogueTaskDTO.class) public Result createTask(@RequestBody CatalogueTaskDTO catalogueTaskDTO) { Catalogue catalogue = catalogueService.saveOrUpdateCatalogueAndTask(catalogueTaskDTO); if (catalogue.getId() != null) { @@ -150,6 +164,20 @@ public Result createTask(@RequestBody CatalogueTaskDTO catalogueTaskD @PutMapping("/moveCatalogue") @Log(title = "Move Catalogue", businessType = BusinessType.UPDATE) @ApiOperation("Move Catalogue") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "originCatalogueId", + value = "originCatalogueId", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class), + @ApiImplicitParam( + name = "targetParentId", + value = "targetParentId", + required = true, + dataType = "Integer", + dataTypeClass = Integer.class) + }) public Result moveCatalogue( @RequestParam("originCatalogueId") Integer originCatalogueId, @RequestParam("targetParentId") Integer targetParentId) { @@ -167,8 +195,14 @@ public Result moveCatalogue( */ @PostMapping("/copyTask") @Log(title = "Copy Task", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "catalogue", + value = "catalogue", + required = true, + dataType = "Catalogue", + dataTypeClass = Catalogue.class) @ApiOperation("Copy Task") - public Result copyTask(@RequestBody Catalogue catalogue) { + public Result copyTask(@RequestBody Catalogue catalogue) { if (catalogueService.copyTask(catalogue)) { return Result.succeed(Status.COPY_SUCCESS); } else { @@ -184,6 +218,7 @@ public Result copyTask(@RequestBody Catalogue catalogue) { @DeleteMapping("deleteCatalogueById") @Log(title = "Delete Catalogue By Id", businessType = BusinessType.DELETE) @ApiOperation("Delete Catalogue By Id") + @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Integer", dataTypeClass = Integer.class) public Result deleteCatalogueById(@RequestParam Integer id) { return catalogueService.deleteCatalogueById(id); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java b/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java index c9ec3c0d96..60a50e5bd0 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java @@ -42,6 +42,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -67,6 +68,13 @@ public class ClusterConfigurationController { @PutMapping @Log(title = "Insert Or Update Cluster Config", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update Cluster Config") + @ApiImplicitParam( + name = "clusterConfiguration", + value = "Cluster Configuration", + dataType = "ClusterConfiguration", + paramType = "body", + required = true, + dataTypeClass = ClusterConfiguration.class) public Result saveOrUpdateClusterConfig(@RequestBody ClusterConfiguration clusterConfiguration) { Integer id = clusterConfiguration.getId(); TestResult testResult = clusterConfigurationService.testGateway(clusterConfiguration); @@ -86,6 +94,12 @@ public Result saveOrUpdateClusterConfig(@RequestBody ClusterConfiguration */ @PostMapping @ApiOperation("Cluster Config List") + @ApiImplicitParam( + name = "para", + value = "Cluster Configuration", + dataType = "JsonNode", + paramType = "body", + required = true) public ProTableResult listClusterConfigList(@RequestBody JsonNode para) { return clusterConfigurationService.selectForProTable(para); } @@ -97,6 +111,12 @@ public ProTableResult listClusterConfigList(@RequestBody J */ @GetMapping("/listEnabledAll") @ApiOperation("Cluster Config List Enabled All") + @ApiImplicitParam( + name = "para", + value = "Cluster Configuration", + dataType = "JsonNode", + paramType = "body", + required = true) public Result> listEnabledAllClusterConfig() { return Result.succeed(clusterConfigurationService.listEnabledAllClusterConfig()); } @@ -110,6 +130,7 @@ public Result> listEnabledAllClusterConfig() { @DeleteMapping("/delete") @Log(title = "Cluster Config Delete by id", businessType = BusinessType.DELETE) @ApiOperation("Cluster Config Delete by id") + @ApiImplicitParam(name = "id", value = "id", dataType = "Integer", paramType = "query", required = true) public Result deleteById(@RequestParam("id") Integer id) { boolean removeById = clusterConfigurationService.removeById(id); if (removeById) { @@ -128,6 +149,7 @@ public Result deleteById(@RequestParam("id") Integer id) { @PutMapping("/enable") @Log(title = "Modify Cluster Config Status", businessType = BusinessType.UPDATE) @ApiOperation("Modify Cluster Config Status") + @ApiImplicitParam(name = "id", value = "id", dataType = "Integer", paramType = "query", required = true) public Result modifyClusterConfigStatus(@RequestParam("id") Integer id) { if (clusterConfigurationService.modifyClusterConfigStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); @@ -145,6 +167,13 @@ public Result modifyClusterConfigStatus(@RequestParam("id") Integer id) { @PostMapping("/testConnect") @Log(title = "Test Connection", businessType = BusinessType.TEST) @ApiOperation("Test Connection") + @ApiImplicitParam( + name = "clusterConfiguration", + value = "Cluster Configuration", + dataType = "ClusterConfiguration", + paramType = "body", + required = true, + dataTypeClass = ClusterConfiguration.class) public Result testConnect(@RequestBody ClusterConfiguration clusterConfiguration) { TestResult testResult = clusterConfigurationService.testGateway(clusterConfiguration); if (testResult.isAvailable()) { diff --git a/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java b/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java index 3a741ca016..e8fbb55ae8 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java @@ -43,6 +43,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -68,6 +69,13 @@ public class ClusterInstanceController { @PutMapping @Log(title = "Insert Or Update Cluster Instance", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update Cluster Instance") + @ApiImplicitParam( + name = "cluster", + value = "Cluster Instance", + dataType = "Cluster", + paramType = "body", + required = true, + dataTypeClass = Cluster.class) public Result saveOrUpdateClusterInstance(@RequestBody Cluster cluster) throws Exception { cluster.setAutoRegisters(false); clusterInstanceService.registersCluster(cluster); @@ -83,6 +91,14 @@ public Result saveOrUpdateClusterInstance(@RequestBody Cluster cluster) th @PutMapping("/enable") @Log(title = "Update Cluster Instance Status", businessType = BusinessType.UPDATE) @ApiOperation("Update Cluster Instance Status") + @ApiImplicitParam( + name = "id", + value = "Cluster Instance Id", + dataType = "Integer", + paramType = "query", + required = true, + dataTypeClass = Integer.class, + example = "1") public Result modifyClusterInstanceStatus(@RequestParam Integer id) { Boolean enabled = clusterInstanceService.modifyClusterInstanceStatus(id); if (enabled) { @@ -102,6 +118,14 @@ public Result modifyClusterInstanceStatus(@RequestParam Integer id) { @Log(title = "Delete Cluster Instance by id", businessType = BusinessType.DELETE) @ApiOperation("Delete Cluster Instance by id") @Transactional(rollbackFor = Exception.class) + @ApiImplicitParam( + name = "id", + value = "Cluster Instance Id", + dataType = "Integer", + paramType = "query", + required = true, + dataTypeClass = Integer.class, + example = "1") public Result deleteClusterInstanceById(@RequestParam Integer id) { Boolean deleted = clusterInstanceService.deleteClusterInstanceById(id); if (deleted) { @@ -119,6 +143,13 @@ public Result deleteClusterInstanceById(@RequestParam Integer id) { */ @PostMapping @ApiOperation("Cluster Instance List") + @ApiImplicitParam( + name = "para", + value = "Query Parameters", + dataType = "JsonNode", + paramType = "body", + required = true, + dataTypeClass = JsonNode.class) public ProTableResult listClusters(@RequestBody JsonNode para) { return clusterInstanceService.selectForProTable(para); } @@ -185,6 +216,14 @@ public Result recycleCluster() { @GetMapping("/killCluster") @Log(title = "Cluster Instance Kill", businessType = BusinessType.UPDATE) @ApiOperation("Cluster Instance Kill") + @ApiImplicitParam( + name = "id", + value = "Cluster Instance Id", + dataType = "Integer", + paramType = "query", + required = true, + dataTypeClass = Integer.class, + example = "1") public Result killClusterInstance(@RequestParam("id") Integer id) { clusterInstanceService.killCluster(id); return Result.succeed("Kill Cluster Succeed."); @@ -193,6 +232,14 @@ public Result killClusterInstance(@RequestParam("id") Integer id) { @PutMapping("/deploySessionClusterInstance") @Log(title = "Deploy Session Cluster Instance", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Deploy Session Cluster Instance") + @ApiImplicitParam( + name = "id", + value = "Cluster Instance Id", + dataType = "Integer", + paramType = "query", + required = true, + dataTypeClass = Integer.class, + example = "1") public Result deploySessionClusterInstance(@RequestParam("id") Integer id) { return Result.succeed(clusterInstanceService.deploySessionCluster(id), Status.CLUSTER_INSTANCE_DEPLOY); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java b/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java index 79d3feabef..bb3765853c 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java @@ -49,8 +49,12 @@ import org.springframework.web.bind.annotation.RestController; import com.fasterxml.jackson.databind.JsonNode; +import com.github.xiaoymin.knife4j.annotations.DynamicParameter; +import com.github.xiaoymin.knife4j.annotations.DynamicParameters; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -78,6 +82,13 @@ public class DataBaseController { @PutMapping @Log(title = "Insert Or Update DataBase", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update DataBase") + @ApiImplicitParam( + name = "database", + value = "DataBase", + required = true, + dataType = "DataBase", + paramType = "body", + dataTypeClass = DataBase.class) public Result saveOrUpdateDataBase(@RequestBody DataBase database) { if (databaseService.saveOrUpdateDataBase(database)) { DriverPool.remove(database.getName()); @@ -95,6 +106,13 @@ public Result saveOrUpdateDataBase(@RequestBody DataBase database) { */ @PostMapping @ApiOperation("DataBase Get All") + @ApiImplicitParam( + name = "para", + value = "JsonNode", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public ProTableResult listDataBases(@RequestBody JsonNode para) { final ProTableResult result = databaseService.selectForProTable(para); // 密码不返回 @@ -115,6 +133,13 @@ public ProTableResult listDataBases(@RequestBody JsonNode para) { @DeleteMapping("/delete") @Log(title = "DataBase Delete By Id", businessType = BusinessType.DELETE) @ApiOperation("DataBase Delete By Id") + @ApiImplicitParam( + name = "id", + value = "DataBase Id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result deleteDataBaseById(@RequestParam Integer id) { if (databaseService.removeById(id)) { return Result.succeed(Status.DELETE_SUCCESS); @@ -131,6 +156,13 @@ public Result deleteDataBaseById(@RequestParam Integer id) { @PutMapping("/enable") @Log(title = "DataBase Enable Or Disable By Id", businessType = BusinessType.UPDATE) @ApiOperation("DataBase Enable Or Disable By Id") + @ApiImplicitParam( + name = "id", + value = "DataBase Id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result modifyDataSourceStatus(@RequestParam Integer id) { if (databaseService.modifyDataSourceStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); @@ -159,6 +191,13 @@ public Result> listEnabledAll() { @PostMapping("/testConnect") @Log(title = "DataBase Test Connect", businessType = BusinessType.TEST) @ApiOperation("DataBase Test Connect") + @ApiImplicitParam( + name = "database", + value = "DataBase", + required = true, + dataType = "DataBase", + paramType = "body", + dataTypeClass = DataBase.class) public Result testConnect(@RequestBody DataBase database) { String msg = databaseService.testConnect(database); boolean isHealthy = Asserts.isEquals(CommonConstant.HEALTHY, msg); @@ -178,6 +217,14 @@ public Result testConnect(@RequestBody DataBase database) { @PutMapping("/checkHeartBeatByDataSourceId") @Log(title = "DataBase Check Heart Beat By Id", businessType = BusinessType.TEST) @ApiOperation("DataBase Check Heart Beat By Id") + @ApiImplicitParam( + name = "id", + value = "DataBase Id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class, + example = "1") public Result checkHeartBeatByDataSourceId(@RequestParam Integer id) { DataBase dataBase = databaseService.getById(id); Asserts.checkNotNull(dataBase, Status.DATASOURCE_NOT_EXIST.getMessage()); @@ -203,6 +250,14 @@ public Result checkHeartBeatByDataSourceId(@RequestParam Integer id) { @Cacheable(cacheNames = "metadata_schema", key = "#id") @GetMapping("/getSchemasAndTables") @ApiOperation("Get All Schemas And Tables") + @ApiImplicitParam( + name = "id", + value = "DataBase Id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class, + example = "1") public Result> getSchemasAndTables(@RequestParam Integer id) { return Result.succeed(databaseService.getSchemasAndTables(id)); } @@ -216,6 +271,14 @@ public Result> getSchemasAndTables(@RequestParam Integer id) { @CacheEvict(cacheNames = "metadata_schema", key = "#id") @GetMapping("/unCacheSchemasAndTables") @ApiOperation("Clear Cache Of Schemas And Tables") + @ApiImplicitParam( + name = "id", + value = "DataBase Id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class, + example = "1") public Result unCacheSchemasAndTables(@RequestParam Integer id) { return Result.succeed(Status.DATASOURCE_CLEAR_CACHE_SUCCESS); } @@ -230,6 +293,54 @@ public Result unCacheSchemasAndTables(@RequestParam Integer id) { */ @GetMapping("/listColumns") @ApiOperation("Get Columns Of Table") + @ApiImplicitParams( + value = { + @ApiImplicitParam( + name = "id", + value = "DataBase Id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class, + example = "1"), + @ApiImplicitParam( + name = "schemaName", + value = "Schema Name", + required = true, + dataType = "String", + paramType = "query", + dataTypeClass = String.class, + example = "public"), + @ApiImplicitParam( + name = "tableName", + value = "Table Name", + required = true, + dataType = "String", + paramType = "query", + dataTypeClass = String.class, + example = "user") + }) + @DynamicParameters( + properties = { + @DynamicParameter( + name = "id", + value = "DataBase Id", + required = true, + dataTypeClass = Integer.class, + example = "1"), + @DynamicParameter( + name = "schemaName", + value = "Schema Name", + required = true, + dataTypeClass = String.class, + example = "public"), + @DynamicParameter( + name = "tableName", + value = "Table Name", + required = true, + dataTypeClass = String.class, + example = "user") + }) public Result> listColumns( @RequestParam Integer id, @RequestParam String schemaName, @RequestParam String tableName) { return Result.succeed(databaseService.listColumns(id, schemaName, tableName)); @@ -243,6 +354,13 @@ public Result> listColumns( */ @PostMapping("/queryData") @ApiOperation("Query Data Of Table") + @ApiImplicitParam( + name = "queryData", + value = "Query Data", + required = true, + dataType = "QueryData", + paramType = "body", + dataTypeClass = QueryData.class) public Result queryData(@RequestBody QueryData queryData) { JdbcSelectResult jdbcSelectResult = databaseService.queryData(queryData); if (jdbcSelectResult.isSuccess()) { @@ -261,6 +379,13 @@ public Result queryData(@RequestBody QueryData queryData) { @PostMapping("/execSql") @Log(title = "Exec Sql", businessType = BusinessType.EXECUTE) @ApiOperation("Exec Sql") + @ApiImplicitParam( + name = "queryData", + value = "Query Data", + required = true, + dataType = "QueryData", + paramType = "body", + dataTypeClass = QueryData.class) public Result execSql(@RequestBody QueryData queryData) { JdbcSelectResult jdbcSelectResult = databaseService.execSql(queryData); if (jdbcSelectResult.isSuccess()) { @@ -280,6 +405,33 @@ public Result execSql(@RequestBody QueryData queryData) { */ @GetMapping("/getSqlGeneration") @ApiOperation("Get Sql Generation") + @ApiImplicitParams( + value = { + @ApiImplicitParam( + name = "id", + value = "DataBase Id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class, + example = "1"), + @ApiImplicitParam( + name = "schemaName", + value = "Schema Name", + required = true, + dataType = "String", + paramType = "query", + dataTypeClass = String.class, + example = "public"), + @ApiImplicitParam( + name = "tableName", + value = "Table Name", + required = true, + dataType = "String", + paramType = "query", + dataTypeClass = String.class, + example = "user") + }) public Result getSqlGeneration( @RequestParam Integer id, @RequestParam String schemaName, @RequestParam String tableName) { return Result.succeed(databaseService.getSqlGeneration(id, schemaName, tableName)); diff --git a/dinky-admin/src/main/java/org/dinky/controller/DocumentController.java b/dinky-admin/src/main/java/org/dinky/controller/DocumentController.java index 6f57f8b84a..96c2c14d68 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/DocumentController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/DocumentController.java @@ -41,6 +41,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -65,6 +66,13 @@ public class DocumentController { @PutMapping @Log(title = "Insert Or Update Document", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update Document") + @ApiImplicitParam( + name = "document", + value = "Document", + required = true, + dataType = "Document", + paramType = "body", + dataTypeClass = Document.class) public Result saveOrUpdateDocument(@RequestBody Document document) throws Exception { if (documentService.saveOrUpdate(document)) { return Result.succeed(Status.SAVE_SUCCESS); @@ -81,6 +89,13 @@ public Result saveOrUpdateDocument(@RequestBody Document document) throws */ @PostMapping @ApiOperation("Document Query List") + @ApiImplicitParam( + name = "para", + value = "Query Condition", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public ProTableResult listDocuments(@RequestBody JsonNode para) { return documentService.selectForProTable(para); } @@ -94,6 +109,14 @@ public ProTableResult listDocuments(@RequestBody JsonNode para) { @DeleteMapping("/delete") @Log(title = "Document Delete By id", businessType = BusinessType.DELETE) @ApiOperation("Document Delete By id") + @ApiImplicitParam( + name = "id", + value = "Document Id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class, + example = "1") public Result deleteById(@RequestParam Integer id) { if (documentService.removeById(id)) { return Result.succeed(Status.DELETE_SUCCESS); @@ -111,6 +134,14 @@ public Result deleteById(@RequestParam Integer id) { @PutMapping("/enable") @Log(title = "Update Document Status", businessType = BusinessType.UPDATE) @ApiOperation("Update Document Status") + @ApiImplicitParam( + name = "id", + value = "Document Id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class, + example = "1") public Result modifyDocumentStatus(@RequestParam Integer id) { if (documentService.modifyDocumentStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); @@ -128,6 +159,14 @@ public Result modifyDocumentStatus(@RequestParam Integer id) { */ @GetMapping("/getFillAllByVersion") @ApiOperation("Get Document By Version") + @ApiImplicitParam( + name = "version", + value = "Document Version", + required = true, + dataType = "String", + paramType = "query", + dataTypeClass = String.class, + example = "1.0.0") public Result> getFillAllByVersion(@RequestParam String version) { return Result.succeed(documentService.getFillAllByVersion(version)); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/FlinkConfController.java b/dinky-admin/src/main/java/org/dinky/controller/FlinkConfController.java index 0162ef77d3..a67687c612 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/FlinkConfController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/FlinkConfController.java @@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @RestController @@ -40,6 +41,7 @@ @RequestMapping("/api/flinkConf") public class FlinkConfController { @GetMapping("/configOptions") + @ApiOperation("Query Flink Configuration Options") public Result> loadDataByGroup() { final String[] nameList = { "org.apache.flink.configuration.CoreOptions", diff --git a/dinky-admin/src/main/java/org/dinky/controller/FlinkProxyController.java b/dinky-admin/src/main/java/org/dinky/controller/FlinkProxyController.java index 5056c1e09e..2b342ae1a7 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/FlinkProxyController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/FlinkProxyController.java @@ -47,7 +47,7 @@ import lombok.SneakyThrows; @Controller -@Api(tags = "Flink Proxy Controller", hidden = true) +@Api(tags = "Flink Proxy Controller", hidden = true, description = "Flink Proxy API") @RequestMapping(FlinkProxyController.API) public class FlinkProxyController { public static final String API = "/api/flink/"; diff --git a/dinky-admin/src/main/java/org/dinky/controller/FragmentController.java b/dinky-admin/src/main/java/org/dinky/controller/FragmentController.java index e92c4f41ef..62e299187e 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/FragmentController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/FragmentController.java @@ -39,6 +39,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -62,6 +63,13 @@ public class FragmentController { @PutMapping @Log(title = "Insert Or Update Fragment", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update Fragment") + @ApiImplicitParam( + name = "fragmentVariable", + value = "FragmentVariable", + required = true, + dataType = "FragmentVariable", + paramType = "body", + dataTypeClass = FragmentVariable.class) public Result saveOrUpdateFragment(@RequestBody FragmentVariable fragmentVariable) { if (fragmentVariableService.saveOrUpdate(fragmentVariable)) { return Result.succeed(Status.SAVE_SUCCESS); @@ -79,6 +87,13 @@ public Result saveOrUpdateFragment(@RequestBody FragmentVariable fragmentV @PostMapping @Log(title = "FragmentVariable List", businessType = BusinessType.QUERY) @ApiOperation("FragmentVariable List") + @ApiImplicitParam( + name = "para", + value = "JsonNode", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public ProTableResult listFragmentVariable(@RequestBody JsonNode para) { final ProTableResult result = fragmentVariableService.selectForProTable(para); // 敏感值不返回 @@ -101,6 +116,13 @@ public ProTableResult listFragmentVariable(@RequestBody JsonNo @DeleteMapping("/delete") @Log(title = "FragmentVariable Delete", businessType = BusinessType.DELETE) @ApiOperation("FragmentVariable Delete") + @ApiImplicitParam( + name = "id", + value = "FragmentVariable Id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class) public Result deleteById(@RequestParam Integer id) { if (fragmentVariableService.removeById(id)) { return Result.succeed(Status.DELETE_SUCCESS); @@ -118,6 +140,13 @@ public Result deleteById(@RequestParam Integer id) { @PutMapping("/enable") @Log(title = "Update FragmentVariable Status", businessType = BusinessType.UPDATE) @ApiOperation("Update FragmentVariable Status") + @ApiImplicitParam( + name = "id", + value = "FragmentVariable Id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class) public Result modifyFragmentStatus(@RequestParam Integer id) { if (fragmentVariableService.modifyFragmentStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); diff --git a/dinky-admin/src/main/java/org/dinky/controller/GitController.java b/dinky-admin/src/main/java/org/dinky/controller/GitController.java index 56b0ce4dea..81c4a473cf 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/GitController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/GitController.java @@ -56,6 +56,7 @@ import cn.hutool.core.io.FileUtil; import cn.hutool.core.lang.Dict; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -79,6 +80,13 @@ public class GitController { @PutMapping("/saveOrUpdate") @Log(title = "Insert Or Update GitProject", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update GitProject") + @ApiImplicitParam( + name = "gitProject", + value = "GitProject", + required = true, + dataType = "GitProject", + paramType = "body", + dataTypeClass = GitProject.class) public Result saveOrUpdateGitProject(@Validated @RequestBody GitProjectDTO gitProject) { gitProjectService.saveOrUpdate(gitProject); GitRepository gitRepository = new GitRepository(BeanUtil.copyProperties(gitProject, GitProjectDTO.class)); @@ -95,6 +103,13 @@ public Result saveOrUpdateGitProject(@Validated @RequestBody GitProjectDTO @PostMapping("/dragendSortProject") @Log(title = "GitProject Sort", businessType = BusinessType.UPDATE) @ApiOperation("GitProject Sort") + @ApiImplicitParam( + name = "sortList", + value = "after sorter data", + required = true, + dataType = "Map", + paramType = "body", + dataTypeClass = Map.class) public Result dragendSortProject(@RequestBody Map sortList) { if (sortList == null) { return Result.failed(Status.GIT_PROJECT_NOT_FOUND); @@ -112,6 +127,13 @@ public Result dragendSortProject(@RequestBody Map sortList) { @PostMapping("/dragendSortJar") @Log(title = "GitProject Jar Sort", businessType = BusinessType.UPDATE) @ApiOperation("GitProject Jar Sort") + @ApiImplicitParam( + name = "gitProjectSortJarParams", + value = "after sorter data", + required = true, + dataType = "GitProjectSortJarParams", + paramType = "body", + dataTypeClass = GitProjectSortJarParams.class) public Result dragendSortJar(@RequestBody GitProjectSortJarParams gitProjectSortJarParams) { GitProject gitProjectServiceById = gitProjectService.getById(gitProjectSortJarParams.getProjectId()); if (gitProjectServiceById == null) { @@ -133,6 +155,13 @@ public Result dragendSortJar(@RequestBody GitProjectSortJarParams gitProje */ @PostMapping("/getBranchList") @ApiOperation("GitProject Get Branch List") + @ApiImplicitParam( + name = "gitProjectDTO", + value = "GitProjectDTO", + required = true, + dataType = "GitProjectDTO", + paramType = "body", + dataTypeClass = GitProjectDTO.class) public Result> getBranchList(@RequestBody GitProjectDTO gitProjectDTO) { GitRepository gitRepository = new GitRepository(gitProjectDTO); return Result.succeed(gitRepository.getBranchList()); @@ -147,6 +176,13 @@ public Result> getBranchList(@RequestBody GitProjectDTO gitProjectD @DeleteMapping("/deleteProject") @Log(title = "Delete GitProject by id", businessType = BusinessType.DELETE) @ApiOperation("Delete GitProject by id") + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result deleteProject(@RequestParam("id") Integer id) { gitProjectService.removeProjectAndCodeCascade(id); return Result.succeed(); @@ -161,6 +197,13 @@ public Result deleteProject(@RequestParam("id") Integer id) { @PutMapping("/updateEnable") @Log(title = "Enable or Disable GitProject by id", businessType = BusinessType.UPDATE) @ApiOperation("Enable or Disable GitProject by id") + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result modifyGitProjectStatus(@RequestParam("id") Integer id) { if (gitProjectService.modifyGitProjectStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); @@ -176,6 +219,13 @@ public Result modifyGitProjectStatus(@RequestParam("id") Integer id) { */ @PostMapping("/getProjectList") @ApiOperation("Get GitProject List") + @ApiImplicitParam( + name = "params", + value = "params", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public ProTableResult getAllProject(@RequestBody JsonNode params) { return gitProjectService.selectForProTable(params); } @@ -188,6 +238,13 @@ public ProTableResult getAllProject(@RequestBody JsonNode params) { */ @PostMapping("/getOneDetails") @ApiOperation("Get GitProject Details by id") + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result getOneDetails(@RequestParam("id") Integer id) { return Result.succeed(gitProjectService.getById(id)); } @@ -199,6 +256,15 @@ public Result getOneDetails(@RequestParam("id") Integer id) { * @return {@link Result} of {@link Void} */ @PutMapping("/build") + @Log(title = "Build GitProject by id", businessType = BusinessType.UPDATE) + @ApiOperation("Build GitProject by id") + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result buildGitProject(@RequestParam("id") Integer id) { GitProject gitProject = gitProjectService.getById(id); @@ -223,6 +289,13 @@ public Result buildGitProject(@RequestParam("id") Integer id) { @GetMapping(path = "/build-step-logs", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @Log(title = "GitProject Build Step Logs", businessType = BusinessType.QUERY) @ApiOperation("GitProject Build Step Logs") + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public SseEmitter buildStepLogs(@RequestParam("id") Integer id) { SseEmitter emitter = new SseEmitterUTF8(TimeUnit.MINUTES.toMillis(30)); GitProject gitProject = gitProjectService.getById(id); @@ -243,6 +316,13 @@ public SseEmitter buildStepLogs(@RequestParam("id") Integer id) { */ @GetMapping("/getProjectCode") @ApiOperation("Get GitProject Code") + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result> getProjectCode(@RequestParam("id") Integer id) { return Result.succeed(gitProjectService.getProjectCode(id)); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/HistoryController.java b/dinky-admin/src/main/java/org/dinky/controller/HistoryController.java index 2125584485..426872c0c8 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/HistoryController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/HistoryController.java @@ -31,6 +31,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -57,6 +58,7 @@ public class HistoryController { */ @PostMapping @ApiOperation("Query History List") + @ApiImplicitParam(name = "para", value = "Query Parameters", dataType = "JsonNode", paramType = "body") public ProTableResult listHistory(@RequestBody JsonNode para) { return historyService.selectForProTable(para); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/JobInstanceController.java b/dinky-admin/src/main/java/org/dinky/controller/JobInstanceController.java index 6040d71f12..aff51aa103 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/JobInstanceController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/JobInstanceController.java @@ -49,6 +49,8 @@ import cn.hutool.core.lang.Dict; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -70,6 +72,13 @@ public class JobInstanceController { /** 动态查询列表 */ @PostMapping + @ApiImplicitParam( + name = "para", + value = "Query parameters", + dataType = "JsonNode", + paramType = "body", + required = true, + dataTypeClass = JsonNode.class) public ProTableResult listJobInstances(@RequestBody JsonNode para) { return jobInstanceService.listJobInstances(para); } @@ -87,6 +96,12 @@ public Result getStatusCount() { /** 获取Job实例的所有信息 */ @GetMapping("/getJobInfoDetail") @ApiOperation("Get job info detail") + @ApiImplicitParam( + name = "id", + value = "Job instance id", + dataType = "Integer", + paramType = "query", + required = true) public Result getJobInfoDetail(@RequestParam Integer id) { return Result.succeed(jobInstanceService.getJobInfoDetail(id)); } @@ -95,6 +110,12 @@ public Result getJobInfoDetail(@RequestParam Integer id) { @GetMapping("/refreshJobInfoDetail") @ApiOperation("Refresh job info detail") @Log(title = "Refresh job info detail", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "id", + value = "Job instance id", + dataType = "Integer", + paramType = "query", + required = true) public Result refreshJobInfoDetail(@RequestParam Integer id) { return Result.succeed(taskService.refreshJobInfoDetail(id), Status.RESTART_SUCCESS); } @@ -102,6 +123,12 @@ public Result refreshJobInfoDetail(@RequestParam Integer id) { /** 获取单任务实例的血缘分析 */ @GetMapping("/getLineage") @ApiOperation("Get lineage of a single task instance") + @ApiImplicitParam( + name = "id", + value = "Task instance id", + dataType = "Integer", + paramType = "query", + required = true) public Result getLineage(@RequestParam Integer id) { return Result.succeed(jobInstanceService.getLineage(id), Status.RESTART_SUCCESS); } @@ -109,6 +136,12 @@ public Result getLineage(@RequestParam Integer id) { /** 获取 JobManager 的信息 */ @GetMapping("/getJobManagerInfo") @ApiOperation("Get job manager info") + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true) public Result getJobManagerInfo(@RequestParam String address) { JobManagerConfiguration jobManagerConfiguration = new JobManagerConfiguration(); if (Asserts.isNotNullString(address)) { @@ -119,24 +152,48 @@ public Result getJobManagerInfo(@RequestParam String ad @GetMapping("/getJobManagerLog") @ApiOperation("Get job manager log") + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true) public Result getJobManagerLog(@RequestParam String address) { return Result.succeed(FlinkAPI.build(address).getJobManagerLog(), ""); } @GetMapping("/getJobManagerStdOut") @ApiOperation("Get job manager stdout") + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true) public Result getJobManagerStdOut(@RequestParam String address) { return Result.succeed(FlinkAPI.build(address).getJobManagerStdOut(), ""); } @GetMapping("/getJobManagerThreadDump") @ApiOperation("Get job manager ThreadDump") + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true) public Result getJobManagerThreadDump(@RequestParam String address) { return Result.succeed(FlinkAPI.build(address).getJobManagerThreadDump(), ""); } @GetMapping("/getTaskManagerList") @ApiOperation("Get task manager List") + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true) public Result> getTaskManagerList(@RequestParam String address) { Set taskManagerConfigurationList = new HashSet<>(); if (Asserts.isNotNullString(address)) { @@ -151,12 +208,41 @@ public Result> getTaskManagerList(@RequestParam St /** 获取 TaskManager 的信息 */ @GetMapping("/getTaskManagerLog") @ApiOperation("Get task manager log") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true), + @ApiImplicitParam( + name = "containerId", + value = "TaskManager container id", + dataType = "String", + paramType = "query", + required = true) + }) public Result getTaskManagerLog(@RequestParam String address, @RequestParam String containerId) { return Result.succeed(FlinkAPI.build(address).getTaskManagerLog(containerId), ""); } @GetMapping("/getJobMetricsItems") @ApiOperation(" getJobMetricsItems List") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true), + @ApiImplicitParam(name = "jobId", value = "Job id", dataType = "String", paramType = "query", required = true), + @ApiImplicitParam( + name = "verticeId", + value = "Vertice id", + dataType = "String", + paramType = "query", + required = true) + }) public Result getJobMetricsItems( @RequestParam String address, @RequestParam String jobId, @RequestParam String verticeId) { return Result.succeed(FlinkAPI.build(address).getJobMetricesItems(jobId, verticeId)); @@ -164,6 +250,27 @@ public Result getJobMetricsItems( @GetMapping("/getJobMetricsData") @ApiOperation(" getJobMetrics Data") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "address", + value = "JobManager address", + dataType = "String", + paramType = "query", + required = true), + @ApiImplicitParam(name = "jobId", value = "Job id", dataType = "String", paramType = "query", required = true), + @ApiImplicitParam( + name = "verticeId", + value = "Vertice id", + dataType = "String", + paramType = "query", + required = true), + @ApiImplicitParam( + name = "metrics", + value = "Metrics", + dataType = "String", + paramType = "query", + required = true) + }) public Result getJobMetricsItems( @RequestParam String address, @RequestParam String jobId, diff --git a/dinky-admin/src/main/java/org/dinky/controller/LdapController.java b/dinky-admin/src/main/java/org/dinky/controller/LdapController.java index d37f6474a3..b72ce1d25c 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/LdapController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/LdapController.java @@ -44,6 +44,7 @@ import cn.dev33.satoken.annotation.SaIgnore; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -97,6 +98,7 @@ public Result> listUser() { @PostMapping("/importUsers") @ApiOperation("Import users from LDAP server") @Log(title = "Import users from LDAP server", businessType = BusinessType.IMPORT) + @ApiImplicitParam(name = "users", value = "User list", required = true, dataType = "List") public Result importUsers(@RequestBody List users) { boolean b = userService.saveBatch(users); if (b) { @@ -114,6 +116,7 @@ public Result importUsers(@RequestBody List users) { @PostMapping("/testLogin") @ApiOperation("Test login to LDAP server") @Log(title = "Test login to LDAP server", businessType = BusinessType.TEST) + @ApiImplicitParam(name = "loginDTO", value = "Login information", required = true, dataType = "LoginDTO") public Result login(@RequestBody LoginDTO loginDTO) { try { return Result.succeed(ldapService.authenticate(loginDTO)); diff --git a/dinky-admin/src/main/java/org/dinky/controller/LogController.java b/dinky-admin/src/main/java/org/dinky/controller/LogController.java index 132aaa6833..344aade11d 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/LogController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/LogController.java @@ -38,6 +38,8 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -55,12 +57,27 @@ public class LogController { @GetMapping("/loginRecord/{userId}") @ApiOperation("Query Login Log List") + @ApiImplicitParam(name = "userId", value = "User ID", required = true, dataType = "Integer", paramType = "path") public Result> queryLoginLogRecord(@PathVariable Integer userId) { return Result.succeed(loginLogService.loginRecord(userId)); } @PostMapping("/operateLog/{userId}") @ApiOperation("Query Operate Log List") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "userId", + value = "User ID", + required = true, + dataType = "Integer", + paramType = "path"), + @ApiImplicitParam( + name = "para", + value = "Query Parameters", + required = true, + dataType = "JsonNode", + paramType = "body") + }) public ProTableResult queryOperateLogRecord(@RequestBody JsonNode para, @PathVariable Integer userId) { return operateLogService.operateRecord(para, userId); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/MenuController.java b/dinky-admin/src/main/java/org/dinky/controller/MenuController.java index f662630bc3..eba2814409 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/MenuController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/MenuController.java @@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -61,6 +62,13 @@ public class MenuController { @PutMapping("addOrUpdate") @Log(title = "Insert Or Update Menu ", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update Menu") + @ApiImplicitParam( + name = "menu", + value = "Menu", + dataType = "Menu", + paramType = "body", + required = true, + dataTypeClass = Menu.class) public Result saveOrUpdateMenu(@RequestBody Menu menu) { if (menuService.saveOrUpdate(menu)) { return Result.succeed(Status.SAVE_SUCCESS); @@ -90,6 +98,7 @@ public Result> listMenus() { @DeleteMapping("/delete") @ApiOperation("Delete Menu By Id") @Log(title = "Delete Menu By Id", businessType = BusinessType.DELETE) + @ApiImplicitParam(name = "id", value = "Menu Id", dataType = "Integer", paramType = "query", required = true) public Result deleteMenuById(@RequestParam("id") Integer id) { return menuService.deleteMenuById(id); } @@ -102,6 +111,7 @@ public Result deleteMenuById(@RequestParam("id") Integer id) { */ @GetMapping(value = "/roleMenus") @ApiOperation("Load Role Menu") + @ApiImplicitParam(name = "roleId", value = "Role Id", dataType = "Integer", paramType = "query", required = true) public Result roleMenuTreeSelect(@RequestParam("id") Integer roleId) { List menus = menuService.buildMenuTree(menuService.list()); RoleMenuDto menuVO = RoleMenuDto.builder() diff --git a/dinky-admin/src/main/java/org/dinky/controller/MonitorController.java b/dinky-admin/src/main/java/org/dinky/controller/MonitorController.java index a18bae00aa..9d396a001e 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/MonitorController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/MonitorController.java @@ -56,6 +56,8 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Opt; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -75,6 +77,10 @@ public class MonitorController { @GetMapping("/getSysData") @ApiOperation("Get System Data") + @ApiImplicitParams({ + @ApiImplicitParam(name = "startTime", value = "Start Time", required = true, dataType = "Long"), + @ApiImplicitParam(name = "endTime", value = "End Time", required = false, dataType = "Long") + }) public Result> getData(@RequestParam Long startTime, Long endTime) { List data = monitorService.getData( DateUtil.date(startTime), @@ -85,6 +91,11 @@ public Result> getData(@RequestParam Long startTime, Long endTim @GetMapping("/getFlinkData") @ApiOperation("Get Flink Data") + @ApiImplicitParams({ + @ApiImplicitParam(name = "startTime", value = "Start Time", required = true, dataType = "Long"), + @ApiImplicitParam(name = "endTime", value = "End Time", required = false, dataType = "Long"), + @ApiImplicitParam(name = "taskIds", value = "Task Ids", required = true, dataType = "String") + }) public Result> getFlinkData(@RequestParam Long startTime, Long endTime, String taskIds) { JsonNodeFactory nodeFactory = JsonNodeFactory.instance; ObjectNode para = nodeFactory.objectNode(); @@ -102,6 +113,10 @@ public Result> getFlinkData(@RequestParam Long startTime, Long e @GetMapping(value = "/getLastUpdateData", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @ApiOperation("Get Last Update Data") + @ApiImplicitParams({ + @ApiImplicitParam(name = "lastTime", value = "Last Time", required = false, dataType = "Long"), + @ApiImplicitParam(name = "layoutName", value = "Layout Name", required = true, dataType = "String") + }) public SseEmitter getLastUpdateData(Long lastTime, String layoutName) { SseEmitter emitter = new SseEmitterUTF8(TimeUnit.MINUTES.toMillis(30)); return monitorService.sendLatestData( @@ -113,6 +128,14 @@ public SseEmitter getLastUpdateData(Long lastTime, String layoutName) { @PutMapping("/saveFlinkMetrics/{layout}") @ApiOperation("Save Flink Metrics") @Log(title = "Save Flink Metrics", businessType = BusinessType.INSERT) + @ApiImplicitParams({ + @ApiImplicitParam(name = "layout", value = "Layout Name", required = true, dataType = "String"), + @ApiImplicitParam( + name = "metricsList", + value = "Metrics List", + required = true, + dataType = "List") + }) public Result saveFlinkMetricLayout( @PathVariable(value = "layout") String layoutName, @RequestBody List metricsList) { monitorService.saveFlinkMetricLayout(layoutName, metricsList); @@ -128,6 +151,7 @@ public Result>> getMetricsLayout() { @GetMapping("/getMetricsLayoutByName") @ApiOperation("Get Metrics Layout by task to Display") + @ApiImplicitParam(name = "layoutName", value = "Layout Name", required = true, dataType = "String") public Result> getMetricsLayoutByName(@RequestParam String layoutName) { return Result.succeed(monitorService.getMetricsLayoutByName(layoutName)); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/PrintTableController.java b/dinky-admin/src/main/java/org/dinky/controller/PrintTableController.java index e5a8f98976..263fe6fe71 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/PrintTableController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/PrintTableController.java @@ -31,6 +31,7 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -44,12 +45,14 @@ public class PrintTableController { @GetMapping(value = "/subscribe/print", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @ApiOperation("Subscribe p table") + @ApiImplicitParam(name = "table", value = "table name", required = true, dataType = "String", paramType = "query") public SseEmitter subscribe(@RequestParam String table) { return printTableService.registerListenEntry(table); } @PutMapping("/unSubscribe/print") @ApiOperation("UnSubscribe print table") + @ApiImplicitParam(name = "table", value = "table name", required = true, dataType = "String", paramType = "query") public Result unsubscribe(@RequestParam String table) { printTableService.unRegisterListenEntry(table); return Result.succeed(); diff --git a/dinky-admin/src/main/java/org/dinky/controller/ProcessController.java b/dinky-admin/src/main/java/org/dinky/controller/ProcessController.java index 5ba7afe4c8..99a7b447a6 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/ProcessController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/ProcessController.java @@ -36,6 +36,7 @@ import cn.dev33.satoken.stp.StpUtil; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -60,6 +61,10 @@ public class ProcessController { */ @GetMapping("/listAllProcess") @ApiOperation("List all process") + @ApiImplicitParam( + name = "active", + value = "true: list active process, false: list inactive process", + dataType = "Boolean") public ProTableResult listAllProcess(@RequestParam boolean active) { List processEntities = processService.listAllProcess(active); return ProTableResult.builder() diff --git a/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java b/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java index ff79e26357..afa31fcfb2 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java @@ -38,6 +38,8 @@ 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 lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -53,6 +55,13 @@ public class ResourceController { @PostMapping("/createFolder") @ApiOperation("Create Folder") @Log(title = "Create Folder", businessType = BusinessType.INSERT) + @ApiImplicitParam( + name = "resourcesDTO", + value = "ResourcesDTO", + required = true, + dataType = "ResourcesDTO", + paramType = "body", + dataTypeClass = ResourcesDTO.class) public Result createFolder(@RequestBody ResourcesDTO resourcesDTO) { return Result.succeed(resourcesService.createFolder( resourcesDTO.getId(), resourcesDTO.getFileName(), resourcesDTO.getDescription())); @@ -61,6 +70,13 @@ public Result createFolder(@RequestBody ResourcesDTO resourcesDTO) @PostMapping("/rename") @ApiOperation("Rename Folder/File") @Log(title = "Rename Folder/File", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "resourcesDTO", + value = "ResourcesDTO", + required = true, + dataType = "ResourcesDTO", + paramType = "body", + dataTypeClass = ResourcesDTO.class) public Result rename(@RequestBody ResourcesDTO resourcesDTO) { resourcesService.rename(resourcesDTO.getId(), resourcesDTO.getFileName(), resourcesDTO.getDescription()); return Result.succeed(); @@ -68,18 +84,53 @@ public Result rename(@RequestBody ResourcesDTO resourcesDTO) { @GetMapping("/showByTree") @ApiOperation("Query Folder/File Tree") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "pid", + value = "Parent ID", + required = true, + dataType = "Integer", + paramType = "query"), + @ApiImplicitParam( + name = "showFloorNum", + value = "Show Floor Number", + required = true, + dataType = "Integer", + paramType = "query") + }) public Result> showByTree(Integer pid, Integer showFloorNum) { return Result.succeed(resourcesService.showByTree(pid, showFloorNum)); } @GetMapping("/getContentByResourceId") @ApiOperation("Query Resource Content") + @ApiImplicitParam(name = "id", value = "Resource ID", required = true, dataType = "Integer", paramType = "query") public Result getContentByResourceId(@RequestParam Integer id) { return Result.data(resourcesService.getContentByResourceId(id)); } @PostMapping("/uploadFile") @ApiOperation("Upload File") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "pid", + value = "Parent ID", + required = true, + dataType = "Integer", + paramType = "query"), + @ApiImplicitParam( + name = "desc", + value = "Description", + required = true, + dataType = "String", + paramType = "query"), + @ApiImplicitParam( + name = "file", + value = "File", + required = true, + dataType = "MultipartFile", + paramType = "query") + }) @Log(title = "Upload File To Resource", businessType = BusinessType.UPLOAD) public Result uploadFile(Integer pid, String desc, @RequestParam("file") MultipartFile file) { resourcesService.uploadFile(pid, desc, file); @@ -87,6 +138,9 @@ public Result uploadFile(Integer pid, String desc, @RequestParam("file") M } @DeleteMapping("/remove") + @ApiOperation("Remove Folder/File") + @Log(title = "Remove Folder/File", businessType = BusinessType.DELETE) + @ApiImplicitParam(name = "id", value = "Resource ID", required = true, dataType = "Integer", paramType = "query") public Result remove(Integer id) { resourcesService.remove(id); return Result.succeed(); diff --git a/dinky-admin/src/main/java/org/dinky/controller/RoleController.java b/dinky-admin/src/main/java/org/dinky/controller/RoleController.java index 17f6f16f72..7e70b8a064 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/RoleController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/RoleController.java @@ -45,6 +45,7 @@ import cn.hutool.core.lang.Dict; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -68,6 +69,13 @@ public class RoleController { @PutMapping("/addedOrUpdateRole") @ApiOperation("Insert Or Update Role") @Log(title = "Insert Or Update Role", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "role", + value = "role", + required = true, + dataType = "Role", + paramType = "body", + dataTypeClass = Role.class) public Result addedOrUpdateRole(@RequestBody Role role) { return roleService.addedOrUpdateRole(role); } @@ -80,6 +88,13 @@ public Result addedOrUpdateRole(@RequestBody Role role) { @DeleteMapping("/delete") @ApiOperation("Delete Role By Id") @Log(title = "Delete Role By Id", businessType = BusinessType.DELETE) + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class) public Result deleteRoleById(@RequestParam Integer id) { return roleService.deleteRoleById(id); } @@ -92,6 +107,13 @@ public Result deleteRoleById(@RequestParam Integer id) { */ @PostMapping @ApiOperation("Query Role List") + @ApiImplicitParam( + name = "para", + value = "para", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public ProTableResult listRoles(@RequestBody JsonNode para) { return roleService.selectForProTable(para, true); } @@ -104,6 +126,13 @@ public ProTableResult listRoles(@RequestBody JsonNode para) { */ @GetMapping(value = "/getRolesAndIdsByUserId") @ApiOperation("Query Role List By UserId") + @ApiImplicitParam( + name = "id", + value = "id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class) public Result getRolesAndIdsByUserId(@RequestParam Integer id) { List roleList = roleService.list(); @@ -118,6 +147,13 @@ public Result getRolesAndIdsByUserId(@RequestParam Integer id) { @GetMapping(value = "/getUserListByRoleId") @ApiOperation("Query User List By RoleId") + @ApiImplicitParam( + name = "roleId", + value = "roleId", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class) public Result> getUserListByRoleId(@RequestParam Integer roleId) { List userRoleList = roleService.getUserListByRoleId(roleId); return Result.succeed(userRoleList); diff --git a/dinky-admin/src/main/java/org/dinky/controller/RoleMenuController.java b/dinky-admin/src/main/java/org/dinky/controller/RoleMenuController.java index 323dddc004..ccfd317941 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/RoleMenuController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/RoleMenuController.java @@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -55,6 +56,12 @@ public class RoleMenuController { @PostMapping("assignMenuToRole") @Log(title = "Assign Menus to Role ", businessType = BusinessType.GRANT) @ApiOperation("Assign Menus to Role") + @ApiImplicitParam( + name = "assignMenuToRoleDto", + value = "Assign Menu To Role Dto", + required = true, + dataType = "AssignMenuToRoleDto", + paramType = "body") public Result assignMenuToRole(@RequestBody AssignMenuToRoleDto assignMenuToRoleDto) { return roleMenuService.assignMenuToRole(assignMenuToRoleDto); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/RowPermissionsController.java b/dinky-admin/src/main/java/org/dinky/controller/RowPermissionsController.java index abad16d6f5..93efa6b19b 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/RowPermissionsController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/RowPermissionsController.java @@ -39,6 +39,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -60,6 +61,13 @@ public class RowPermissionsController { @PutMapping @ApiOperation("Insert Or Update RowPermissions") @Log(title = "Insert Or Update RowPermissions", businessType = BusinessType.INSERT) + @ApiImplicitParam( + name = "roleSelectPermissions", + value = "RowPermissions", + dataType = "RowPermissions", + paramType = "body", + required = true, + dataTypeClass = RowPermissions.class) public Result saveOrUpdateRowPermissions(@RequestBody RowPermissions roleSelectPermissions) { if (roleSelectPermissionsService.saveOrUpdate(roleSelectPermissions)) { return Result.succeed(Status.SAVE_SUCCESS); @@ -77,6 +85,13 @@ public Result saveOrUpdateRowPermissions(@RequestBody RowPermissions roleSelectP @DeleteMapping("/delete") @ApiOperation("Delete RowPermissions By Id") @Log(title = "Delete RowPermissions By Id", businessType = BusinessType.DELETE) + @ApiImplicitParam( + name = "id", + value = "RowPermissions Id", + dataType = "Integer", + paramType = "query", + required = true, + dataTypeClass = Integer.class) public Result delete(@RequestParam("id") Integer id) { if (roleSelectPermissionsService.removeById(id)) { @@ -93,6 +108,13 @@ public Result delete(@RequestParam("id") Integer id) { */ @PostMapping @ApiOperation("Query RowPermissions List") + @ApiImplicitParam( + name = "para", + value = "Query Condition", + dataType = "JsonNode", + paramType = "body", + required = true, + dataTypeClass = JsonNode.class) public ProTableResult listRowPermissions(@RequestBody JsonNode para) { return roleSelectPermissionsService.selectForProTable(para); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/SavePointsController.java b/dinky-admin/src/main/java/org/dinky/controller/SavePointsController.java index d65a335c5d..683acebbfb 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/SavePointsController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/SavePointsController.java @@ -36,6 +36,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -62,6 +63,13 @@ public class SavePointsController { */ @PostMapping @ApiOperation("Query SavePoint List") + @ApiImplicitParam( + name = "para", + value = "Query Params", + dataType = "JsonNode", + paramType = "body", + required = true, + dataTypeClass = JsonNode.class) public ProTableResult listSavePoints(@RequestBody JsonNode para) { return savepointsService.selectForProTable(para); } @@ -74,6 +82,7 @@ public ProTableResult listSavePoints(@RequestBody JsonNode para) { */ @GetMapping("/listSavepointsByTaskId") @ApiOperation("Query SavePoint List By TaskId") + @ApiImplicitParam(name = "taskID", value = "Task ID", dataType = "Integer", paramType = "query", required = true) public Result> listSavePointsByTaskId(@RequestParam Integer taskID) { return Result.succeed(savepointsService.listSavepointsByTaskId(taskID)); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/SchedulerController.java b/dinky-admin/src/main/java/org/dinky/controller/SchedulerController.java index 2f9ddc1b39..212974d0c3 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/SchedulerController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/SchedulerController.java @@ -56,6 +56,8 @@ import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; 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 lombok.RequiredArgsConstructor; @@ -74,6 +76,13 @@ public class SchedulerController { /** 获取任务定义 */ @GetMapping("/task") @ApiOperation("Get Task Definition") + @ApiImplicitParam( + name = "dinkyTaskId", + value = "Dinky Task id", + required = true, + dataType = "Long", + paramType = "query", + example = "1") public Result getTaskDefinition(@ApiParam(value = "dinky任务id") @RequestParam Long dinkyTaskId) { Catalogue catalogue = catalogueService.getOne(new LambdaQueryWrapper().eq(Catalogue::getTaskId, dinkyTaskId)); @@ -107,6 +116,13 @@ public Result getTaskDefinition(@ApiParam(value = "dinky任务id /** 获取前置任务定义集合 */ @GetMapping("/upstream/tasks") @ApiOperation("Get Upstream Task Definition") + @ApiImplicitParam( + name = "dinkyTaskId", + value = "Dinky Task id", + required = true, + dataType = "Long", + paramType = "query", + example = "1") public Result> getTaskMainInfos(@ApiParam(value = "dinky任务id") @RequestParam Long dinkyTaskId) { Catalogue catalogue = catalogueService.getOne(new LambdaQueryWrapper().eq(Catalogue::getTaskId, dinkyTaskId)); @@ -127,6 +143,28 @@ public Result> getTaskMainInfos(@ApiParam(value = "dinky任 /** 创建任务定义 */ @PostMapping("/task") @ApiOperation("Create Task Definition") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "dinkyTaskId", + value = "Dinky Task id", + required = true, + dataType = "Long", + paramType = "query", + example = "1"), + @ApiImplicitParam( + name = "upstreamCodes", + value = "Upstream Task Codes", + required = false, + dataType = "String", + paramType = "query", + example = "1,2,3"), + @ApiImplicitParam( + name = "taskRequest", + value = "Task Request", + required = true, + dataType = "TaskRequest", + paramType = "body"), + }) public Result createTaskDefinition( @ApiParam(value = "前置任务编号 逗号隔开") @RequestParam(required = false) String upstreamCodes, @ApiParam(value = "dinky任务id") @RequestParam Long dinkyTaskId, @@ -178,6 +216,36 @@ public Result createTaskDefinition( /** 更新任务定义 */ @PutMapping("/task") @ApiOperation("Update Task Definition") + @ApiImplicitParams({ + @ApiImplicitParam( + name = "projectCode", + value = "Project Code", + required = true, + dataType = "Long", + paramType = "query", + example = "1"), + @ApiImplicitParam( + name = "processCode", + value = "Process Code", + required = true, + dataType = "Long", + paramType = "query", + example = "1"), + @ApiImplicitParam( + name = "taskCode", + value = "Task Code", + required = true, + dataType = "Long", + paramType = "query", + example = "1"), + @ApiImplicitParam( + name = "upstreamCodes", + value = "Upstream Task Codes", + required = false, + dataType = "String", + paramType = "query", + example = "1,2,3") + }) public Result updateTaskDefinition( @ApiParam(value = "项目编号") @RequestParam long projectCode, @ApiParam(value = "工作流定义编号") @RequestParam long processCode, diff --git a/dinky-admin/src/main/java/org/dinky/controller/SseController.java b/dinky-admin/src/main/java/org/dinky/controller/SseController.java index 3c2be95291..a189dacd0b 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/SseController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/SseController.java @@ -33,6 +33,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Opt; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -45,6 +46,7 @@ public class SseController { @GetMapping(value = "/getLastUpdateData", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @ApiOperation("Get Last Update Data") + @ApiImplicitParam(name = "lastTime", value = "last time", required = false, dataType = "Long", paramType = "query") public SseEmitter getLastUpdateData(Long lastTime) { SseEmitter emitter = new SseEmitterUTF8(TimeUnit.MINUTES.toMillis(30)); return monitorService.sendLatestData( @@ -55,6 +57,7 @@ public SseEmitter getLastUpdateData(Long lastTime) { @GetMapping(value = "/getJvmInfo", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @ApiOperation("Get JVM Info") + @ApiImplicitParam(name = "lastTime", value = "last time", required = false, dataType = "Long", paramType = "query") public SseEmitter getJvmInfo(Long lastTime) { SseEmitter emitter = new SseEmitterUTF8(TimeUnit.MINUTES.toMillis(30)); return monitorService.sendJvmInfo(emitter); diff --git a/dinky-admin/src/main/java/org/dinky/controller/StatementController.java b/dinky-admin/src/main/java/org/dinky/controller/StatementController.java index 5650027e1e..b9ba2b6d65 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/StatementController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/StatementController.java @@ -40,6 +40,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -68,6 +69,13 @@ public class StatementController { @PutMapping @ApiOperation("Insert Or Update Statement") @Log(title = "Insert Or Update Statement", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "statement", + value = "Statement", + dataType = "Statement", + paramType = "body", + required = true, + dataTypeClass = Statement.class) public Result saveOrUpdateStatement(@RequestBody Statement statement) { if (statementService.saveOrUpdate(statement)) { return Result.succeed(Status.SAVE_SUCCESS); @@ -84,6 +92,7 @@ public Result saveOrUpdateStatement(@RequestBody Statement statement) { */ @PostMapping @ApiOperation("Query Statement List") + @ApiImplicitParam(name = "para", value = "Query Params", dataType = "JsonNode", paramType = "body", required = true) public ProTableResult listStatements(@RequestBody JsonNode para) { return statementService.selectForProTable(para); } @@ -91,6 +100,7 @@ public ProTableResult listStatements(@RequestBody JsonNode para) { @PostMapping("/getPrintTables") @ApiOperation("Get Print Tables") @SuppressWarnings("unchecked") + @ApiImplicitParam(name = "statement", value = "Statement", dataType = "String", paramType = "body", required = true) public Result> getPrintTables(@RequestBody String statement) { try { Map data = objectMapper.readValue(statement, Map.class); diff --git a/dinky-admin/src/main/java/org/dinky/controller/StudioController.java b/dinky-admin/src/main/java/org/dinky/controller/StudioController.java index 376e123058..3cc7d4f94e 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/StudioController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/StudioController.java @@ -52,6 +52,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -74,6 +76,12 @@ public class StudioController { @PostMapping("/executeSql") @ApiOperation("Execute Sql") @Log(title = "Execute Sql", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "studioExecuteDTO", + value = "Execute Sql", + required = true, + dataType = "StudioExecuteDTO", + paramType = "body") public Result executeSql(@RequestBody StudioExecuteDTO studioExecuteDTO) { try { JobResult jobResult = studioService.executeSql(studioExecuteDTO); @@ -91,6 +99,12 @@ public Result executeSql(@RequestBody StudioExecuteDTO studioExecuteD /** 解释Sql */ @PostMapping("/explainSql") @ApiOperation("Explain Sql") + @ApiImplicitParam( + name = "studioExecuteDTO", + value = "Explain Sql", + required = true, + dataType = "StudioExecuteDTO", + paramType = "body") public Result> explainSql(@RequestBody StudioExecuteDTO studioExecuteDTO) { return Result.succeed(studioService.explainSql(studioExecuteDTO), "解释成功"); } @@ -98,6 +112,12 @@ public Result> explainSql(@RequestBody StudioExecuteDTO s /** 获取执行图 */ @PostMapping("/getStreamGraph") @ApiOperation("Get Stream Graph") + @ApiImplicitParam( + name = "studioExecuteDTO", + value = "Get Stream Graph", + required = true, + dataType = "StudioExecuteDTO", + paramType = "body") public Result getStreamGraph(@RequestBody StudioExecuteDTO studioExecuteDTO) { return Result.succeed(studioService.getStreamGraph(studioExecuteDTO)); } @@ -105,6 +125,12 @@ public Result getStreamGraph(@RequestBody StudioExecuteDTO studioExe /** 获取sql的jobplan */ @PostMapping("/getJobPlan") @ApiOperation("Get Job Execute Plan") + @ApiImplicitParam( + name = "studioExecuteDTO", + value = "Get Job Execute Plan", + required = true, + dataType = "StudioExecuteDTO", + paramType = "body") public Result getJobPlan(@RequestBody StudioExecuteDTO studioExecuteDTO) { try { return Result.succeed(studioService.getJobPlan(studioExecuteDTO)); @@ -118,6 +144,12 @@ public Result getJobPlan(@RequestBody StudioExecuteDTO studioExecute @PostMapping("/executeDDL") @ApiOperation("Execute SQL DDL") @Log(title = "Execute SQL DDL", businessType = BusinessType.EXECUTE) + @ApiImplicitParam( + name = "studioDDLDTO", + value = "Execute SQL DDL", + required = true, + dataType = "StudioDDLDTO", + paramType = "body") public Result executeDDL(@RequestBody StudioDDLDTO studioDDLDTO) { IResult result = studioService.executeDDL(studioDDLDTO); return Result.succeed(result, Status.EXECUTE_SUCCESS); @@ -126,11 +158,19 @@ public Result executeDDL(@RequestBody StudioDDLDTO studioDDLDTO) { /** 根据jobId获取数据 */ @GetMapping("/getJobData") @ApiOperation("Get Job Plan") + @ApiImplicitParam(name = "jobId", value = "Get Job Plan", required = true, dataType = "String", paramType = "query") public Result getJobData(@RequestParam String jobId) { return Result.succeed(studioService.getJobData(jobId)); } /** 根据jobId获取数据 */ @GetMapping("/getCommonSqlData") + @ApiOperation("Get Common Sql Data") + @ApiImplicitParam( + name = "taskId", + value = "Get Common Sql Data", + required = true, + dataType = "Integer", + paramType = "query") public Result getJobData(@RequestParam Integer taskId) { return Result.succeed(studioService.getCommonSqlData(taskId)); } @@ -138,6 +178,12 @@ public Result getJobData(@RequestParam Integer taskId) { /** 获取单任务实例的血缘分析 */ @PostMapping("/getLineage") @ApiOperation("Get Job Lineage") + @ApiImplicitParam( + name = "studioCADTO", + value = "Get Job Lineage", + required = true, + dataType = "StudioCADTO", + paramType = "body") public Result getLineage(@RequestBody StudioCADTO studioCADTO) { LineageResult lineage = studioService.getLineage(studioCADTO); return Asserts.isNull(lineage) ? Result.failed("血缘分析异常") : Result.succeed(lineage, "血缘分析成功"); @@ -146,6 +192,12 @@ public Result getLineage(@RequestBody StudioCADTO studioCADTO) { /** 获取flinkJobs列表 */ @GetMapping("/listJobs") @ApiOperation("List Flink Jobs") + @ApiImplicitParam( + name = "clusterId", + value = "List Flink Jobs", + required = true, + dataType = "Integer", + paramType = "query") public Result listFlinkJobs(@RequestParam Integer clusterId) { List jobs = studioService.listFlinkJobs(clusterId); return Result.succeed(jobs.toArray(new JsonNode[0])); @@ -155,6 +207,15 @@ public Result listFlinkJobs(@RequestParam Integer clusterId) { @GetMapping("/cancel") @ApiOperation("Cancel Flink Job") @Log(title = "Cancel Flink Job", businessType = BusinessType.REMOTE_OPERATION) + @ApiImplicitParams({ + @ApiImplicitParam( + name = "clusterId", + value = "clusterId", + required = true, + dataType = "Integer", + paramType = "query"), + @ApiImplicitParam(name = "jobId", value = "jobId", required = true, dataType = "String", paramType = "query") + }) public Result cancelFlinkJob(@RequestParam Integer clusterId, @RequestParam String jobId) { return Result.succeed(studioService.cancelFlinkJob(clusterId, jobId), Status.STOP_SUCCESS); } @@ -163,6 +224,23 @@ public Result cancelFlinkJob(@RequestParam Integer clusterId, @RequestP @GetMapping("/savepoint") @ApiOperation("Savepoint Trigger") @Log(title = "Savepoint Trigger", businessType = BusinessType.REMOTE_OPERATION) + @ApiImplicitParams({ + @ApiImplicitParam( + name = "clusterId", + value = "clusterId", + required = true, + dataType = "Integer", + paramType = "query"), + @ApiImplicitParam(name = "jobId", value = "jobId", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam( + name = "savePointType", + value = "savePointType", + required = true, + dataType = "String", + paramType = "query"), + @ApiImplicitParam(name = "name", value = "name", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "taskId", value = "taskId", required = true, dataType = "Integer", paramType = "query") + }) public Result savepointTrigger( @RequestParam Integer clusterId, @RequestParam String jobId, @@ -176,6 +254,12 @@ public Result savepointTrigger( /** 获取 Meta Store Catalog 和 Database */ @PostMapping("/getMSCatalogs") @ApiOperation("Get Catalog List") + @ApiImplicitParam( + name = "studioMetaStoreDTO", + value = "Get Catalog List", + required = true, + dataType = "StudioMetaStoreDTO", + paramType = "body") public Result> getMSCatalogs(@RequestBody StudioMetaStoreDTO studioMetaStoreDTO) { return Result.succeed(studioService.getMSCatalogs(studioMetaStoreDTO)); } @@ -183,6 +267,12 @@ public Result> getMSCatalogs(@RequestBody StudioMetaStoreDTO studi /** 获取 Meta Store Schema/Database 信息 */ @PostMapping("/getMSSchemaInfo") @ApiOperation("Get Schema Info") + @ApiImplicitParam( + name = "studioMetaStoreDTO", + value = "Get Schema Info", + required = true, + dataType = "StudioMetaStoreDTO", + paramType = "body") public Result getMSSchemaInfo(@RequestBody StudioMetaStoreDTO studioMetaStoreDTO) { return Result.succeed(studioService.getMSSchemaInfo(studioMetaStoreDTO)); } @@ -190,6 +280,22 @@ public Result getMSSchemaInfo(@RequestBody StudioMetaStoreDTO studioMeta /** 获取 Meta Store Flink Column 信息 */ @GetMapping("/getMSFlinkColumns") @ApiOperation("Get Flink Column List") + @ApiImplicitParams({ + @ApiImplicitParam(name = "envId", value = "envId", required = true, dataType = "Integer", paramType = "query"), + @ApiImplicitParam( + name = "catalog", + value = "catalog", + required = true, + dataType = "String", + paramType = "query"), + @ApiImplicitParam( + name = "database", + value = "database", + required = true, + dataType = "String", + paramType = "query"), + @ApiImplicitParam(name = "table", value = "table", required = true, dataType = "String", paramType = "query") + }) public Result> getMSFlinkColumns( @RequestParam Integer envId, @RequestParam String catalog, diff --git a/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java b/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java index 3886c80606..365bfcb461 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java @@ -40,6 +40,7 @@ import cn.hutool.core.lang.Dict; import cn.hutool.core.map.MapUtil; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -67,6 +68,7 @@ public class SysConfigController { @PostMapping("/modifyConfig") @ApiOperation("Modify System Config") @Log(title = "Modify System Config", businessType = BusinessType.UPDATE) + @ApiImplicitParam(name = "params", value = "System Config", dataType = "Dict") public Result modifyConfig(@RequestBody Dict params) { sysConfigService.updateSysConfigByKv(params.getStr("key"), params.getStr("value")); return Result.succeed(Status.MODIFY_SUCCESS); @@ -88,6 +90,12 @@ public Result>>> getAll() { @GetMapping("/getConfigByType") @ApiOperation("Query One Type System Config List By Key") + @ApiImplicitParam( + name = "type", + value = "System Config Type", + dataType = "String", + required = true, + example = "sys") public Result>> getOneTypeByKey(@RequestParam("type") String type) { Map>> all = sysConfigService.getAll(); // 过滤出 以 type 开头的配置 返回 list diff --git a/dinky-admin/src/main/java/org/dinky/controller/SystemController.java b/dinky-admin/src/main/java/org/dinky/controller/SystemController.java index 0ed9d4c2bb..2efea1db4d 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/SystemController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/SystemController.java @@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -74,6 +75,7 @@ public Result getRootLog() { */ @GetMapping("/readFile") @ApiOperation("Read File By File Path") + @ApiImplicitParam(name = "path", value = "File Path", required = true, dataType = "String") public Result readFile(@RequestParam String path) { return Result.data(systemService.readFile(path)); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/TaskController.java b/dinky-admin/src/main/java/org/dinky/controller/TaskController.java index 32f5a99e17..d67846df58 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/TaskController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/TaskController.java @@ -51,6 +51,7 @@ import cn.hutool.core.lang.Dict; import cn.hutool.core.lang.tree.Tree; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -73,6 +74,13 @@ public class TaskController { @PutMapping @ApiOperation("Insert Or Update Task") @Log(title = "Insert Or Update Task", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "task", + value = "Task", + required = true, + dataType = "Task", + paramType = "body", + dataTypeClass = Task.class) public Result saveOrUpdateTask(@RequestBody Task task) { if (taskService.saveOrUpdateTask(task)) { return Result.succeed(Status.SAVE_SUCCESS); @@ -84,6 +92,13 @@ public Result saveOrUpdateTask(@RequestBody Task task) { /** 动态查询列表 */ @PostMapping @ApiOperation("Query Task List") + @ApiImplicitParam( + name = "para", + value = "Query Condition", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public ProTableResult listTasks(@RequestBody JsonNode para) { return taskService.selectForProTable(para); } @@ -91,7 +106,16 @@ public ProTableResult listTasks(@RequestBody JsonNode para) { /** 批量执行 */ @PostMapping(value = "/submit") @ApiOperation("Batch Execute Task") + @Log(title = "Batch Execute Task", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "para", + value = "Task Id List", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public Result> submit(@RequestBody JsonNode para) { + // todo: 没有批量提交 此处需要重构 if (para.size() > 0) { List results = new ArrayList<>(); List error = new ArrayList<>(); @@ -116,6 +140,13 @@ public Result> submit(@RequestBody JsonNode para) { /** 获取指定ID的信息 */ @GetMapping @ApiOperation("Get Task Info By Id") + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class) public Result getOneById(@RequestParam Integer id) { Task task = taskService.getTaskInfoById(id); return Result.succeed(task); @@ -132,6 +163,13 @@ public Result> listFlinkSQLEnv() { @GetMapping(value = "/exportSql") @ApiOperation("Export Sql") @Log(title = "Export Sql", businessType = BusinessType.EXPORT) + @ApiImplicitParam( + name = "id", + value = "Task Id", + required = true, + dataType = "Integer", + paramType = "query", + dataTypeClass = Integer.class) public Result exportSql(@RequestParam Integer id) { return Result.succeed(taskService.exportSql(id)); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/TaskVersionController.java b/dinky-admin/src/main/java/org/dinky/controller/TaskVersionController.java index 1cf865578b..5ff5234218 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/TaskVersionController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/TaskVersionController.java @@ -19,7 +19,9 @@ package org.dinky.controller; +import org.dinky.data.annotation.Log; import org.dinky.data.dto.TaskVersionHistoryDTO; +import org.dinky.data.enums.BusinessType; import org.dinky.data.model.TaskVersion; import org.dinky.data.result.ProTableResult; import org.dinky.data.result.Result; @@ -36,6 +38,7 @@ import cn.hutool.core.bean.BeanUtil; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -61,6 +64,7 @@ public class TaskVersionController { */ @GetMapping @ApiOperation("Query Task Version list") + @ApiImplicitParam(name = "taskId", value = "Task Id", dataType = "int", paramType = "query", required = true) public Result> listTaskVersions(@RequestParam int taskId) { List taskVersions = versionService.getTaskVersionByTaskId(taskId); List collect = taskVersions.stream() @@ -71,6 +75,8 @@ public Result> listTaskVersions(@RequestParam int ta @DeleteMapping @ApiOperation("Delete Task Version") + @ApiImplicitParam(name = "id", value = "Task Version Id", dataType = "int", paramType = "query", required = true) + @Log(title = "Delete Task Version", businessType = BusinessType.DELETE) public Result deleteVersion(@RequestParam int id) { boolean b = versionService.removeById(id); return Result.succeed(b); diff --git a/dinky-admin/src/main/java/org/dinky/controller/TenantController.java b/dinky-admin/src/main/java/org/dinky/controller/TenantController.java index 53a9dc46d3..1ddce21674 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/TenantController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/TenantController.java @@ -44,6 +44,7 @@ import cn.hutool.core.lang.Dict; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -69,6 +70,12 @@ public class TenantController { @PutMapping @ApiOperation("Insert Or Update Tenant") @Log(title = "Insert Or Update Tenant", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "tenant", + value = "tenant entity", + required = true, + dataType = "Tenant", + paramType = "body") public Result saveOrUpdateTenant(@RequestBody Tenant tenant) { return tenantService.saveOrUpdateTenant(tenant); } @@ -82,6 +89,7 @@ public Result saveOrUpdateTenant(@RequestBody Tenant tenant) { @DeleteMapping("/delete") @ApiOperation("Delete Tenant By Id") @Log(title = "Delete Tenant By Id", businessType = BusinessType.DELETE) + @ApiImplicitParam(name = "id", value = "tenant id", required = true, dataType = "Integer", paramType = "query") public Result removeTenantById(@RequestParam("id") Integer tenantId) { return tenantService.removeTenantById(tenantId); } @@ -94,6 +102,12 @@ public Result removeTenantById(@RequestParam("id") Integer tenantId) { */ @PostMapping @ApiOperation("List Tenants") + @ApiImplicitParam( + name = "para", + value = "ProTable request params", + required = true, + dataType = "JsonNode", + paramType = "body") public ProTableResult listTenants(@RequestBody JsonNode para) { return tenantService.selectForProTable(para, true); } @@ -106,6 +120,12 @@ public ProTableResult listTenants(@RequestBody JsonNode para) { */ @PutMapping(value = "/assignUserToTenant") @ApiOperation("Assign User To Tenant") + @ApiImplicitParam( + name = "assignUserToTenantParams", + value = "assign user to tenant params", + required = true, + dataType = "AssignUserToTenantParams", + paramType = "body") @Log(title = "Assign User To Tenant", businessType = BusinessType.INSERT) public Result assignUserToTenant(@RequestBody AssignUserToTenantParams assignUserToTenantParams) { return tenantService.assignUserToTenant(assignUserToTenantParams); @@ -118,6 +138,7 @@ public Result assignUserToTenant(@RequestBody AssignUserToTenantParams ass * @return {@link Result} with {@link Dict} */ @GetMapping("/getUsersByTenantId") + @ApiImplicitParam(name = "id", value = "tenant id", required = true, dataType = "Integer", paramType = "query") @ApiOperation("Get User List By Tenant Id") public Result> getUserListByTenantId(@RequestParam("id") Integer id) { return Result.succeed(userService.getUserListByTenantId(id)); @@ -125,6 +146,13 @@ public Result> getUserListByTenantId(@RequestParam("id") Integer id) @GetMapping("/getTenantListByUserId") @ApiOperation("Get Tenant List By User Id") + @ApiImplicitParam( + name = "id", + value = "user id", + required = true, + dataType = "Integer", + paramType = "query", + example = "1") public Result> getTenantListByUserId(@RequestParam("id") Integer userId) { return Result.succeed(tenantService.getTenantListByUserId(userId)); } diff --git a/dinky-admin/src/main/java/org/dinky/controller/TokenController.java b/dinky-admin/src/main/java/org/dinky/controller/TokenController.java index 63a599ce4b..50e70c4e88 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/TokenController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/TokenController.java @@ -41,6 +41,7 @@ import cn.hutool.core.lang.UUID; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -63,6 +64,7 @@ public class TokenController { */ @PostMapping("/list") @ApiOperation("Get Token List") + @ApiImplicitParam(name = "params", value = "params", dataType = "JsonNode", paramType = "body", required = true) public ProTableResult listToken(@RequestBody JsonNode params) { return tokenService.selectForProTable(params); } @@ -76,6 +78,7 @@ public ProTableResult listToken(@RequestBody JsonNode params) { @PutMapping("/saveOrUpdateToken") @ApiOperation("Insert or Update Token") @Log(title = "Insert or Update Token", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam(name = "sysToken", value = "sysToken", dataType = "SysToken", paramType = "body", required = true) public Result saveOrUpdateToken(@RequestBody SysToken sysToken) { return tokenService.saveOrUpdate(sysToken) ? Result.succeed(Status.SAVE_SUCCESS) @@ -91,6 +94,7 @@ public Result saveOrUpdateToken(@RequestBody SysToken sysToken) { @DeleteMapping("/delete") @Log(title = "Delete Token By Id", businessType = BusinessType.DELETE) @ApiOperation("Delete Token By Id") + @ApiImplicitParam(name = "id", value = "id", dataType = "Integer", paramType = "query", required = true) @Transactional(rollbackFor = Exception.class) public Result deleteToken(@RequestParam Integer id) { if (tokenService.removeTokenById(id)) { diff --git a/dinky-admin/src/main/java/org/dinky/controller/UDFController.java b/dinky-admin/src/main/java/org/dinky/controller/UDFController.java index 0f556760ee..ef4774aa0b 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/UDFController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/UDFController.java @@ -49,6 +49,7 @@ import cn.hutool.core.lang.Dict; import cn.hutool.core.util.StrUtil; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -119,6 +120,12 @@ public Result> listUdfTemplates() { */ @PostMapping("/list") @ApiOperation("Get UDF Template List") + @ApiImplicitParam( + name = "params", + value = "ProTable Params", + dataType = "JsonNode", + paramType = "body", + required = true) public ProTableResult listUdfTemplates(@RequestBody JsonNode params) { return udfTemplateService.selectForProTable(params); } @@ -132,6 +139,12 @@ public ProTableResult listUdfTemplates(@RequestBody JsonNode params @PutMapping @ApiOperation("Insert or Update UDF Template") @Log(title = "Insert or Update UDF Template", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "udfTemplate", + value = "UDF Template", + dataType = "UDFTemplate", + paramType = "body", + required = true) public Result saveOrUpdateUDFTemplate(@RequestBody UDFTemplate udfTemplate) { return udfTemplateService.saveOrUpdate(udfTemplate) ? Result.succeed(Status.SAVE_SUCCESS) @@ -147,6 +160,12 @@ public Result saveOrUpdateUDFTemplate(@RequestBody UDFTemplate udfTempla @DeleteMapping("/delete") @Log(title = "Delete UDF Template By Id", businessType = BusinessType.DELETE) @ApiOperation("Delete UDF Template By Id") + @ApiImplicitParam( + name = "id", + value = "UDF Template Id", + dataType = "Integer", + paramType = "query", + required = true) @Transactional(rollbackFor = Exception.class) public Result delete(@RequestParam Integer id) { if (udfTemplateService.removeById(id)) { @@ -159,6 +178,12 @@ public Result delete(@RequestParam Integer id) { @PutMapping("/enable") @ApiOperation("Modify UDF Template Status") @Log(title = "Modify UDF Template Status", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "id", + value = "UDF Template Id", + dataType = "Integer", + paramType = "query", + required = true) public Result modifyUDFTemplateStatus(@RequestParam Integer id) { if (udfTemplateService.modifyUDFTemplateStatus(id)) { return Result.succeed(Status.MODIFY_SUCCESS); diff --git a/dinky-admin/src/main/java/org/dinky/controller/UserController.java b/dinky-admin/src/main/java/org/dinky/controller/UserController.java index 9bcbd0c2ca..cc9b8802e4 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/UserController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/UserController.java @@ -46,6 +46,8 @@ import cn.hutool.core.lang.Dict; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -73,6 +75,13 @@ public class UserController { @PutMapping @ApiOperation("Insert Or Update User") @Log(title = "Insert Or Update User", businessType = BusinessType.INSERT_OR_UPDATE) + @ApiImplicitParam( + name = "user", + value = "user", + required = true, + dataType = "User", + paramType = "body", + dataTypeClass = User.class) public Result saveOrUpdateUser(@RequestBody User user) { if (Asserts.isNull(user.getId())) { return userService.registerUser(user); @@ -91,6 +100,13 @@ public Result saveOrUpdateUser(@RequestBody User user) { @PutMapping("/enable") @ApiOperation("Modify User Status") @Log(title = "Modify User Status", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "id", + value = "user id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result modifyUserStatus(@RequestParam("id") Integer id) { if (userService.checkSuperAdmin(id)) { return Result.failed(Status.USER_SUPERADMIN_CANNOT_DISABLE); @@ -111,6 +127,13 @@ public Result modifyUserStatus(@RequestParam("id") Integer id) { */ @PostMapping @ApiOperation("Get User List") + @ApiImplicitParam( + name = "para", + value = "para", + required = true, + dataType = "JsonNode", + paramType = "body", + dataTypeClass = JsonNode.class) public ProTableResult listUser(@RequestBody JsonNode para) { return userService.selectForProTable(para); } @@ -124,6 +147,13 @@ public ProTableResult listUser(@RequestBody JsonNode para) { @DeleteMapping("/delete") @ApiOperation("Delete User By Id") @Log(title = "Delete User By Id", businessType = BusinessType.DELETE) + @ApiImplicitParam( + name = "id", + value = "user id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result deleteUserById(@RequestParam("id") Integer id) { if (userService.removeUser(id)) { return Result.succeed(Status.DELETE_SUCCESS); @@ -141,6 +171,13 @@ public Result deleteUserById(@RequestParam("id") Integer id) { @PostMapping("/modifyPassword") @ApiOperation("Modify Password") @Log(title = "Modify Password", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "modifyPasswordDTO", + value = "modifyPasswordDTO", + required = true, + dataType = "ModifyPasswordDTO", + paramType = "body", + dataTypeClass = ModifyPasswordDTO.class) public Result modifyPassword(@RequestBody ModifyPasswordDTO modifyPasswordDTO) { return userService.modifyPassword(modifyPasswordDTO); } @@ -152,6 +189,15 @@ public Result modifyPassword(@RequestBody ModifyPasswordDTO modifyPassword * @return {@link Result} with {@link Void} */ @PostMapping(value = "/assignRole") + @ApiOperation("Assign Role") + @Log(title = "Assign Role", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "assignRoleParams", + value = "assignRoleParams", + required = true, + dataType = "AssignRoleParams", + paramType = "body", + dataTypeClass = AssignRoleParams.class) public Result assignRole(@RequestBody AssignRoleParams assignRoleParams) { return userService.assignRole(assignRoleParams); } @@ -164,6 +210,13 @@ public Result assignRole(@RequestBody AssignRoleParams assignRoleParams) { */ @GetMapping("/getUserListByTenantId") @ApiOperation("Get User List By Tenant Id") + @ApiImplicitParam( + name = "id", + value = "tenant id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result getUserListByTenantId(@RequestParam("id") Integer id) { List userList = userService.list(); List userIds = userService.getUserIdsByTenantId(id); @@ -174,6 +227,29 @@ public Result getUserListByTenantId(@RequestParam("id") Integer id) { @PutMapping("/updateUserToTenantAdmin") @ApiOperation("Update User To Tenant Admin") @Log(title = "Update User To Tenant Admin", businessType = BusinessType.UPDATE) + @ApiImplicitParams({ + @ApiImplicitParam( + name = "userId", + value = "user id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class), + @ApiImplicitParam( + name = "tenantId", + value = "tenant id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class), + @ApiImplicitParam( + name = "tenantAdminFlag", + value = "tenant admin flag", + required = true, + dataType = "Boolean", + paramType = "path", + dataTypeClass = Boolean.class) + }) public Result modifyUserToTenantAdmin( @RequestParam Integer userId, @RequestParam Integer tenantId, @RequestParam Boolean tenantAdminFlag) { return userService.modifyUserToTenantAdmin(userId, tenantId, tenantAdminFlag); @@ -182,6 +258,13 @@ public Result modifyUserToTenantAdmin( @PutMapping("/recovery") @ApiOperation("Recovery User") @Log(title = "Recovery User", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "id", + value = "user id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result recoveryUser(@RequestParam("id") Integer userId) { return userService.recoveryUser(userId); } @@ -189,6 +272,13 @@ public Result recoveryUser(@RequestParam("id") Integer userId) { @PutMapping("/resetPassword") @ApiOperation("Reset Password") @Log(title = "Reset Password", businessType = BusinessType.UPDATE) + @ApiImplicitParam( + name = "id", + value = "user id", + required = true, + dataType = "Integer", + paramType = "path", + dataTypeClass = Integer.class) public Result resetPassword(@RequestParam("id") Integer userId) { return userService.resetPassword(userId); } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/APICancelDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/APICancelDTO.java index 3937b4bdc1..c8a1576b11 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/APICancelDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/APICancelDTO.java @@ -22,6 +22,8 @@ import org.dinky.gateway.config.GatewayConfig; import org.dinky.job.JobConfig; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -33,10 +35,23 @@ @SuppressWarnings("AlibabaClassNamingShouldBeCamel") @Getter @Setter +@ApiModel(value = "APICancelDTO", description = "API Cancel Data Transfer Object") public class APICancelDTO { + @ApiModelProperty(value = "Job ID", dataType = "String", example = "12345", notes = "The ID of the job to cancel") private String jobId; + + @ApiModelProperty( + value = "Address", + dataType = "String", + example = "http://example.com/api/cancel", + notes = "The address of the cancel API endpoint") private String address; + + @ApiModelProperty( + value = "Gateway Configuration", + dataType = "GatewayConfig", + notes = "The configuration for the gateway") private GatewayConfig gatewayConfig; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteJarDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteJarDTO.java index e79a81bfba..c9e0e9db74 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteJarDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteJarDTO.java @@ -23,6 +23,8 @@ import org.dinky.gateway.enums.SavePointStrategy; import org.dinky.job.JobConfig; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -33,11 +35,34 @@ */ @Getter @Setter +@ApiModel(value = "APIExecuteJarDTO", description = "API Execute JAR Data Transfer Object") public class APIExecuteJarDTO { + @ApiModelProperty( + value = "Type", + dataType = "String", + example = "Flink", + notes = "The type of the JAR execution (e.g., 'Flink')") private String type; + + @ApiModelProperty( + value = "Job Name", + dataType = "String", + example = "MyJob", + notes = "The name of the job to execute") private String jobName; + + @ApiModelProperty( + value = "Savepoint Path", + dataType = "String", + example = "/path/to/savepoint", + notes = "The path to the savepoint to restore from (if applicable)") private String savePointPath; + + @ApiModelProperty( + value = "Gateway Configuration", + dataType = "GatewayConfig", + notes = "The configuration for the gateway") private GatewayConfig gatewayConfig; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteSqlDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteSqlDTO.java index f52921ffb1..78208cdd61 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteSqlDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/APIExecuteSqlDTO.java @@ -25,6 +25,8 @@ import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -35,21 +37,84 @@ */ @Getter @Setter +@ApiModel(value = "APIExecuteSqlDTO", description = "API Execute SQL Data Transfer Object") public class APIExecuteSqlDTO extends AbstractStatementDTO { - // RUN_MODE + @ApiModelProperty( + value = "Execution Type", + dataType = "String", + example = "BATCH", + notes = "The type of SQL execution (e.g., 'BATCH')") private String type; + + @ApiModelProperty( + value = "Use Result", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use the result") private boolean useResult = false; + + @ApiModelProperty( + value = "Use Change Log", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use change logs") private boolean useChangeLog = false; + + @ApiModelProperty( + value = "Use Auto Cancel", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use auto cancel") private boolean useAutoCancel = false; + + @ApiModelProperty( + value = "Use Statement Set", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use a statement set") private boolean useStatementSet = false; + + @ApiModelProperty( + value = "Address", + dataType = "String", + example = "localhost:8080", + notes = "The address for execution") private String address; + + @ApiModelProperty(value = "Job Name", dataType = "String", example = "MyJob", notes = "The name of the job") private String jobName; + + @ApiModelProperty( + value = "Max Row Number", + dataType = "Integer", + example = "100", + notes = "The maximum number of rows") private Integer maxRowNum = 100; + + @ApiModelProperty(value = "Checkpoint", dataType = "Integer", example = "0", notes = "The checkpoint configuration") private Integer checkPoint = 0; + + @ApiModelProperty(value = "Parallelism", dataType = "Integer", notes = "The parallelism for execution") private Integer parallelism; + + @ApiModelProperty( + value = "Savepoint Path", + dataType = "String", + example = "/path/to/savepoint", + notes = "The path to the savepoint to restore from (if applicable)") private String savePointPath; + + @ApiModelProperty( + value = "Configuration", + dataType = "Map", + notes = "Additional configuration settings") private Map configuration; + + @ApiModelProperty( + value = "Gateway Configuration", + dataType = "GatewayConfig", + notes = "The configuration for the gateway") private GatewayConfig gatewayConfig; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java index 47994841d6..1797e72e4a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/APIExplainSqlDTO.java @@ -23,6 +23,8 @@ import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -33,10 +35,23 @@ */ @Getter @Setter +@ApiModel(value = "APIExplainSqlDTO", description = "API Explain SQL Data Transfer Object") public class APIExplainSqlDTO extends AbstractStatementDTO { + @ApiModelProperty( + value = "Use Statement Set", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use a statement set") private boolean useStatementSet = false; + + @ApiModelProperty(value = "Parallelism", dataType = "Integer", notes = "The parallelism for execution") private Integer parallelism; + + @ApiModelProperty( + value = "Configuration", + dataType = "Map", + notes = "Additional configuration settings") private Map configuration; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointDTO.java index f1ce1771a4..ed84f519dd 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointDTO.java @@ -22,6 +22,8 @@ import org.dinky.gateway.config.GatewayConfig; import org.dinky.job.JobConfig; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -32,12 +34,37 @@ */ @Getter @Setter +@ApiModel(value = "APISavePointDTO", description = "API Save Point Data Transfer Object") public class APISavePointDTO { + @ApiModelProperty(value = "Job ID", dataType = "String", example = "job123", notes = "The ID of the job") private String jobId; + + @ApiModelProperty( + value = "Save Point Type", + dataType = "String", + example = "full", + notes = "The type of save point (e.g., last)") private String savePointType; + + @ApiModelProperty( + value = "Save Point", + dataType = "String", + example = "path/to/savepoint", + notes = "The path to the save point") private String savePoint; + + @ApiModelProperty( + value = "Address", + dataType = "String", + example = "localhost:8081", + notes = "The address of the job manager") private String address; + + @ApiModelProperty( + value = "Gateway Configuration", + dataType = "GatewayConfig", + notes = "Gateway configuration details") private GatewayConfig gatewayConfig; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointTaskDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointTaskDTO.java index b50f50ffa0..b698c56432 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointTaskDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/APISavePointTaskDTO.java @@ -21,6 +21,8 @@ import org.dinky.gateway.enums.SavePointType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -31,8 +33,16 @@ */ @Getter @Setter +@ApiModel(value = "APISavePointTaskDTO", description = "API Save Point Task Data Transfer Object") public class APISavePointTaskDTO { + @ApiModelProperty(value = "Task ID", dataType = "Integer", example = "123", notes = "The ID of the task") private Integer taskId; + + @ApiModelProperty( + value = "Type", + dataType = "String", + example = "trigger", + notes = "The type of save point (e.g., trigger)") private String type = SavePointType.TRIGGER.getValue(); } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/AbstractStatementDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/AbstractStatementDTO.java index 89aefc86d9..ef0850455d 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/AbstractStatementDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/AbstractStatementDTO.java @@ -21,16 +21,31 @@ import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + /** * AbstractStatementDTO * * @since 2021/12/29 */ +@ApiModel(value = "AbstractStatementDTO", description = "Abstract Statement Data Transfer Object") public class AbstractStatementDTO { + @ApiModelProperty(value = "Statement", dataType = "String", example = "SELECT * FROM table", notes = "SQL语句") private String statement; + + @ApiModelProperty(value = "Environment ID", dataType = "Integer", example = "1", notes = "环境ID") private Integer envId; + + @ApiModelProperty(value = "Fragment Flag", dataType = "boolean", example = "false", notes = "是否为片段") private boolean fragment = false; + + @ApiModelProperty( + value = "Variables", + dataType = "Map", + example = "{\"key\": \"value\"}", + notes = "变量集合") private Map variables; public String getStatement() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/AlertRuleDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/AlertRuleDTO.java index 40cd8d8cbc..3cb81d8c5a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/AlertRuleDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/AlertRuleDTO.java @@ -19,19 +19,69 @@ package org.dinky.data.dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "AlertRuleDTO", description = "Alert Rule Data Transfer Object") public class AlertRuleDTO { + @ApiModelProperty(value = "Rule ID", dataType = "Integer", example = "1", notes = "The ID of the rule") private Integer id; + + @ApiModelProperty(value = "Template ID", dataType = "Integer", example = "2", notes = "The ID of the template") private Integer templateId; + + @ApiModelProperty( + value = "Rule Name", + dataType = "String", + example = "High CPU Usage", + notes = "The name of the rule") private String name; + + @ApiModelProperty( + value = "Rule Expression", + dataType = "String", + example = "cpuUsage > 90", + notes = "The expression of the rule") private String rule; + + @ApiModelProperty(value = "Rule Type", dataType = "String", example = "Threshold", notes = "The type of the rule") private String ruleType; + + @ApiModelProperty( + value = "Trigger Conditions", + dataType = "String", + example = "CPU usage exceeds 90%", + notes = "The trigger conditions of the rule") private String triggerConditions; + + @ApiModelProperty( + value = "Description", + dataType = "String", + example = "Alert when CPU usage is too high", + notes = "The description of the rule") private String description; + + @ApiModelProperty( + value = "Enabled Flag", + dataType = "Boolean", + example = "true", + notes = "Whether the rule is enabled") private Boolean enabled; + + @ApiModelProperty( + value = "Template Name", + dataType = "String", + example = "High CPU Alert Template", + notes = "The name of the template") private String templateName; + + @ApiModelProperty( + value = "Template Content", + dataType = "String", + example = "Alert template content...", + notes = "The content of the template") private String templateContent; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/AssignMenuToRoleDto.java b/dinky-admin/src/main/java/org/dinky/data/dto/AssignMenuToRoleDto.java index 016fe94245..424c06c056 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/AssignMenuToRoleDto.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/AssignMenuToRoleDto.java @@ -21,6 +21,8 @@ import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -28,7 +30,16 @@ @Data @NoArgsConstructor @AllArgsConstructor +@ApiModel(value = "AssignMenuToRoleDto", description = "DTO for assigning menus to a role") public class AssignMenuToRoleDto { + + @ApiModelProperty(value = "Role ID", dataType = "Integer", example = "1", notes = "The ID of the role") private Integer roleId; + + @ApiModelProperty( + value = "Menu IDs", + dataType = "List", + example = "[1, 2, 3]", + notes = "A list of menu IDs to assign to the role") private List menuIds; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/CatalogueTaskDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/CatalogueTaskDTO.java index 1beadaac8f..f20faba089 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/CatalogueTaskDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/CatalogueTaskDTO.java @@ -21,6 +21,8 @@ import org.dinky.data.model.TaskExtConfig; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -31,16 +33,51 @@ */ @Getter @Setter +@ApiModel(value = "CatalogueTaskDTO", description = "DTO for cataloging tasks") public class CatalogueTaskDTO { + @ApiModelProperty(value = "Task ID", dataType = "Integer", example = "1", notes = "The ID of the task") private Integer id; + + @ApiModelProperty(value = "Tenant ID", dataType = "Integer", example = "1", notes = "The ID of the tenant") private Integer tenantId; + + @ApiModelProperty(value = "Parent ID", dataType = "Integer", example = "2", notes = "The ID of the parent task") private Integer parentId; + + @ApiModelProperty(value = "Task ID", dataType = "Integer", example = "3", notes = "The ID of the associated task") private Integer taskId; + + @ApiModelProperty( + value = "Is Leaf", + dataType = "boolean", + example = "true", + notes = "Specifies whether the task is a leaf node") private boolean isLeaf; + + @ApiModelProperty(value = "Name", dataType = "String", example = "Task 1", notes = "The name of the task") private String name; + + @ApiModelProperty(value = "Type", dataType = "String", example = "SQL", notes = "The type of the task") private String type; + + @ApiModelProperty( + value = "Dialect", + dataType = "String", + example = "MySQL", + notes = "The SQL dialect used by the task") private String dialect; + + @ApiModelProperty( + value = "Note", + dataType = "String", + example = "This is a sample task", + notes = "Additional notes about the task") private String note; + + @ApiModelProperty( + value = "Task Configuration JSON", + dataType = "TaskExtConfig", + notes = "The task's extended configuration in JSON format") private TaskExtConfig configJson; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/GitAnalysisJarDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/GitAnalysisJarDTO.java index 7e62742fb6..82ec2d810b 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/GitAnalysisJarDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/GitAnalysisJarDTO.java @@ -21,14 +21,35 @@ import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; /** @since 0.8.0 */ @Getter @Setter +@ApiModel(value = "GitAnalysisJarDTO", description = "DTO for Git analysis of JAR files") public class GitAnalysisJarDTO { + + @ApiModelProperty( + value = "JAR Path", + dataType = "String", + example = "/path/to/jar.jar", + notes = "The path to the JAR file") private String jarPath; + + @ApiModelProperty( + value = "Class List", + dataType = "List", + example = "[\"com.example.Class1\", \"com.example.Class2\"]", + notes = "List of classes in the JAR file") private List classList; + + @ApiModelProperty( + value = "Order Line", + dataType = "Integer", + example = "1", + notes = "The order line of the JAR file") private Integer orderLine = 1; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/GitProjectDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/GitProjectDTO.java index ef27bb70ce..1243e970e1 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/GitProjectDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/GitProjectDTO.java @@ -21,6 +21,8 @@ import javax.validation.constraints.NotNull; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -30,44 +32,88 @@ */ @Getter @Setter +@ApiModel(value = "GitProjectDTO", description = "DTO for Git project information") public class GitProjectDTO { + + @ApiModelProperty( + value = "Project ID", + dataType = "Long", + example = "1", + notes = "The unique identifier for the project") private Long id; - /** */ - @NotNull + + @ApiModelProperty( + value = "Project Name", + dataType = "String", + example = "MyGitProject", + notes = "The name of the Git project") + @NotNull(message = "Name cannot be null") private String name; - @NotNull + @ApiModelProperty( + value = "Git URL", + dataType = "String", + example = "https://github.com/myusername/myrepo.git", + notes = "The URL of the Git repository") + @NotNull(message = "URL cannot be null") private String url; - /** */ - @NotNull + @ApiModelProperty( + value = "Branch Name", + dataType = "String", + example = "main", + notes = "The name of the Git branch") + @NotNull(message = "Branch cannot be null") private String branch; - /** */ + @ApiModelProperty(value = "Username", dataType = "String", example = "myusername", notes = "The Git username") private String username; - /** */ + @ApiModelProperty(value = "Password", dataType = "String", example = "mypassword", notes = "The Git password") private String password; + @ApiModelProperty( + value = "Private Key", + dataType = "String", + example = "-----BEGIN RSA PRIVATE KEY-----\n... (private key content)", + notes = "The Git private key") private String privateKey; - /** */ + @ApiModelProperty(value = "POM File", dataType = "String", example = "pom.xml", notes = "The name of the POM file") private String pom; - /** */ + @ApiModelProperty( + value = "Build Arguments", + dataType = "String", + example = "-DskipTests", + notes = "Arguments for building the project") private String buildArgs; - /** */ + @ApiModelProperty(value = "Code Type", dataType = "Integer", example = "1", notes = "The code type") private Integer codeType; + @ApiModelProperty(value = "Project Type", dataType = "Integer", example = "2", notes = "The type of the project") private Integer type; - /** */ + @ApiModelProperty( + value = "Project Description", + dataType = "String", + example = "My Git project", + notes = "A description of the Git project") private String description; - /** */ - @NotNull + @ApiModelProperty( + value = "Enabled Flag", + dataType = "Boolean", + example = "true", + notes = "Indicates whether the project is enabled") + @NotNull(message = "Enabled flag cannot be null") private Boolean enabled; + @ApiModelProperty( + value = "Order Line", + dataType = "Integer", + example = "1", + notes = "The order line for the project") private Integer orderLine; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/JarClassesDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/JarClassesDTO.java index 9e38521fd0..e18e4dd4fe 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/JarClassesDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/JarClassesDTO.java @@ -21,10 +21,25 @@ import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "JarClassesDTO", description = "DTO for Jar classes information") public class JarClassesDTO { + + @ApiModelProperty( + value = "Jar File Path", + dataType = "String", + example = "/path/to/my.jar", + notes = "The path to the Jar file") private String jarPath; + + @ApiModelProperty( + value = "List of Classes", + dataType = "List", + example = "[\"com.example.Class1\", \"com.example.Class2\"]", + notes = "A list of class names in the Jar file") private List classList; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/LoginDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/LoginDTO.java index f76b2f5e34..5794585d4a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/LoginDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/LoginDTO.java @@ -19,6 +19,8 @@ package org.dinky.data.dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -29,11 +31,21 @@ */ @Getter @Setter +@ApiModel(value = "LoginDTO", description = "Login DTO") public class LoginDTO { + @ApiModelProperty(value = "username", required = true, example = "admin", dataType = "String") private String username; + + @ApiModelProperty(value = "password", required = true, example = "admin", dataType = "String") private String password; + + @ApiModelProperty(value = "tenantId", required = true, example = "1", dataType = "Integer") private Integer tenantId; + + @ApiModelProperty(value = "autoLogin", required = true, example = "true", dataType = "Boolean") private boolean autoLogin; + + @ApiModelProperty(value = "ldapLogin", required = true, example = "false", dataType = "Boolean") private boolean ldapLogin; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/MetricsLayoutDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/MetricsLayoutDTO.java index 64b9505dfe..cc7107ab91 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/MetricsLayoutDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/MetricsLayoutDTO.java @@ -19,36 +19,72 @@ package org.dinky.data.dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @Getter @Setter +@ApiModel(value = "MetricsLayoutDTO", description = "DTO for Metrics Layout information") public class MetricsLayoutDTO { - /** */ + @ApiModelProperty( + value = "Layout ID", + dataType = "Integer", + example = "1", + notes = "The unique identifier for the layout") private Integer id; + @ApiModelProperty( + value = "Task ID", + dataType = "Integer", + example = "101", + notes = "The identifier of the associated task") private Integer taskId; - /** */ + @ApiModelProperty( + value = "Vertices", + dataType = "String", + example = "vertex1,vertex2,vertex3", + notes = "The vertices associated with the layout") private String vertices; - /** */ + @ApiModelProperty( + value = "Metrics", + dataType = "String", + example = "metric1,metric2,metric3", + notes = "The metrics to display in the layout") private String metrics; - /** */ + @ApiModelProperty(value = "Position", dataType = "Integer", example = "2", notes = "The position of the layout") private Integer position; - /** */ + @ApiModelProperty( + value = "Show Type", + dataType = "String", + example = "table", + notes = "The type of visualization to show") private String showType; - /** */ + @ApiModelProperty( + value = "Show Size", + dataType = "String", + example = "large", + notes = "The size of the visualization") private String showSize; - /** */ + @ApiModelProperty( + value = "Title", + dataType = "String", + example = "Metrics Dashboard", + notes = "The title of the layout") private String title; - /** */ + @ApiModelProperty( + value = "Layout Name", + dataType = "String", + example = "dashboard", + notes = "The name of the layout") private String layoutName; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/ModifyPasswordDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/ModifyPasswordDTO.java index f8c46a47f7..65cd12152a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/ModifyPasswordDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/ModifyPasswordDTO.java @@ -19,6 +19,8 @@ package org.dinky.data.dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -29,10 +31,30 @@ */ @Getter @Setter +@ApiModel(value = "ModifyPasswordDTO", description = "DTO for modifying user password") public class ModifyPasswordDTO { + @ApiModelProperty( + value = "User ID", + dataType = "String", + example = "123", + notes = "The unique identifier of the user") private String id; + + @ApiModelProperty(value = "Username", dataType = "String", example = "john_doe", notes = "The username of the user") private String username; + + @ApiModelProperty( + value = "Current Password", + dataType = "String", + example = "current_password", + notes = "The current password of the user") private String password; + + @ApiModelProperty( + value = "New Password", + dataType = "String", + example = "new_password", + notes = "The new password to set for the user") private String newPassword; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java index 732dc939f0..82105e6c6e 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java @@ -21,13 +21,34 @@ import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @Getter @Setter +@ApiModel(value = "ResourcesDTO", description = "DTO for representing resources") public class ResourcesDTO implements Serializable { + + @ApiModelProperty( + value = "Resource ID", + dataType = "Integer", + example = "1", + notes = "The unique identifier of the resource") private Integer id; + + @ApiModelProperty( + value = "File Name", + dataType = "String", + example = "resource_file.txt", + notes = "The name of the resource file") private String fileName; + + @ApiModelProperty( + value = "Description", + dataType = "String", + example = "A sample resource file", + notes = "A brief description of the resource") private String description; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/RoleMenuDto.java b/dinky-admin/src/main/java/org/dinky/data/dto/RoleMenuDto.java index 034b5958e0..5204f95359 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/RoleMenuDto.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/RoleMenuDto.java @@ -24,6 +24,8 @@ import java.io.Serializable; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -33,13 +35,26 @@ @NoArgsConstructor @AllArgsConstructor @Builder +@ApiModel(value = "RoleMenuDto", description = "DTO for assigning menus to a role") public class RoleMenuDto implements Serializable { - private static final long serialVersionUID = 1L; - + @ApiModelProperty( + value = "Role ID", + dataType = "Integer", + example = "1", + notes = "The unique identifier of the role") private Integer roleId; + @ApiModelProperty( + value = "Selected Menu IDs", + dataType = "List", + example = "[1, 2, 3]", + notes = "A list of menu IDs selected for the role") private List selectedMenuIds; + @ApiModelProperty( + value = "Menus", + dataType = "List", + notes = "A list of menu objects associated with the role") private List menus; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/SessionDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/SessionDTO.java deleted file mode 100644 index ce4e278c16..0000000000 --- a/dinky-admin/src/main/java/org/dinky/data/dto/SessionDTO.java +++ /dev/null @@ -1,38 +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.dinky.data.dto; - -import lombok.Getter; -import lombok.Setter; - -/** - * SessionDTO - * - * @since 2021/7/6 22:10 - */ -@Getter -@Setter -public class SessionDTO { - - private String session; - private String type; - private boolean useRemote; - private Integer clusterId; -} diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/SqlDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/SqlDTO.java index f272200633..ca95cf91e1 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/SqlDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/SqlDTO.java @@ -19,6 +19,8 @@ package org.dinky.data.dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -29,10 +31,28 @@ */ @Getter @Setter +@ApiModel(value = "SqlDTO", description = "DTO for SQL query") public class SqlDTO { + @ApiModelProperty( + value = "SQL Statement", + dataType = "String", + example = "SELECT * FROM users", + notes = "The SQL query statement") private String statement; + + @ApiModelProperty( + value = "Database ID", + dataType = "Integer", + example = "1", + notes = "The identifier of the target database") private Integer databaseId; + + @ApiModelProperty( + value = "Maximum Number of Rows", + dataType = "Integer", + example = "100", + notes = "The maximum number of rows to fetch in the query result") private Integer maxRowNum; public SqlDTO(String statement, Integer databaseId, Integer maxRowNum) { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/StudioCADTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/StudioCADTO.java index 424dd40d68..742b0a3db6 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/StudioCADTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/StudioCADTO.java @@ -19,6 +19,8 @@ package org.dinky.data.dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -29,11 +31,26 @@ */ @Getter @Setter +@ApiModel(value = "StudioCADTO", description = "DTO for Studio SQL query") public class StudioCADTO extends AbstractStatementDTO { - // It's useless for the time being + @ApiModelProperty( + value = "Use Statement Set", + dataType = "Boolean", + example = "true", + notes = "Flag indicating whether to use Statement Set") private Boolean statementSet; + + @ApiModelProperty(value = "Type", dataType = "Integer", example = "1", notes = "The type of the SQL query") private Integer type; + + @ApiModelProperty(value = "Dialect", dataType = "String", example = "MySQL", notes = "The SQL dialect") private String dialect; + + @ApiModelProperty( + value = "Database ID", + dataType = "Integer", + example = "1", + notes = "The identifier of the target database") private Integer databaseId; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/StudioDDLDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/StudioDDLDTO.java index 8a0910850e..af314d2f3b 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/StudioDDLDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/StudioDDLDTO.java @@ -21,6 +21,8 @@ import org.dinky.job.JobConfig; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -31,15 +33,55 @@ */ @Getter @Setter +@ApiModel(value = "StudioDDLDTO", description = "DTO for Studio DDL operations") public class StudioDDLDTO { + @ApiModelProperty(value = "Type", dataType = "String", example = "FlinkSql", notes = "The type of DDL operation") private String type; + + @ApiModelProperty( + value = "Use Result", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use result") private boolean useResult; + + @ApiModelProperty( + value = "Use Session", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use a session") private boolean useSession; + + @ApiModelProperty(value = "Session", dataType = "String", example = "session_id", notes = "The session identifier") private String session; + + @ApiModelProperty( + value = "Use Remote", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use a remote execution") private boolean useRemote; + + @ApiModelProperty( + value = "Cluster ID", + dataType = "Integer", + example = "1", + notes = "The identifier of the cluster") private Integer clusterId; + + @ApiModelProperty( + value = "Statement", + dataType = "String", + example = "CREATE TABLE users (id INT, name VARCHAR(255))", + notes = "The DDL statement") private String statement; + + @ApiModelProperty( + value = "Max Row Number", + dataType = "Integer", + example = "10000", + notes = "The maximum number of rows to return") private Integer maxRowNum = 10000; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/StudioExecuteDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/StudioExecuteDTO.java index 62b72e79ba..045597dd28 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/StudioExecuteDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/StudioExecuteDTO.java @@ -25,6 +25,8 @@ import java.util.HashMap; import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -37,30 +39,133 @@ @Getter @Setter @Slf4j +@ApiModel(value = "StudioExecuteDTO", description = "DTO for executing SQL queries") public class StudioExecuteDTO extends AbstractStatementDTO { - // RUN_MODE + @ApiModelProperty( + value = "Run Mode", + dataType = "String", + example = "BATCH", + notes = "The execution mode for the SQL query") private String type; + + @ApiModelProperty( + value = "Dialect", + dataType = "String", + example = "MySQL", + notes = "The SQL dialect for the query") private String dialect; + + @ApiModelProperty( + value = "Use Result", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use the query result") private boolean useResult; + + @ApiModelProperty( + value = "Use Change Log", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use change logs") private boolean useChangeLog; + + @ApiModelProperty( + value = "Use Auto Cancel", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use auto-canceling") private boolean useAutoCancel; + + @ApiModelProperty( + value = "Use Statement Set", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use a statement set") private boolean statementSet; + + @ApiModelProperty( + value = "Batch Model", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use batch processing") private boolean batchModel; + + @ApiModelProperty( + value = "Use Session", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use a session") private boolean useSession; + + @ApiModelProperty(value = "Session", dataType = "String", example = "session_id", notes = "The session identifier") private String session; + + @ApiModelProperty( + value = "Cluster ID", + dataType = "Integer", + example = "1", + notes = "The identifier of the cluster") private Integer clusterId; + + @ApiModelProperty( + value = "Cluster Configuration ID", + dataType = "Integer", + example = "2", + notes = "The identifier of the cluster configuration") private Integer clusterConfigurationId; + + @ApiModelProperty( + value = "Database ID", + dataType = "Integer", + example = "3", + notes = "The identifier of the database") private Integer databaseId; + + @ApiModelProperty(value = "JAR ID", dataType = "Integer", example = "4", notes = "The identifier of the JAR") private Integer jarId; + + @ApiModelProperty(value = "Job Name", dataType = "String", example = "MyJob", notes = "The name of the job") private String jobName; + + @ApiModelProperty(value = "Task ID", dataType = "Integer", example = "5", notes = "The identifier of the task") private Integer taskId; + + @ApiModelProperty(value = "ID", dataType = "Integer", example = "6", notes = "The identifier of the execution") private Integer id; + + @ApiModelProperty( + value = "Max Row Number", + dataType = "Integer", + example = "100", + notes = "The maximum number of rows to return") private Integer maxRowNum; + + @ApiModelProperty(value = "Check Point", dataType = "Integer", example = "0", notes = "The check point value") private Integer checkPoint; + + @ApiModelProperty(value = "Parallelism", dataType = "Integer", example = "4", notes = "The parallelism level") private Integer parallelism; + + @ApiModelProperty( + value = "Save Point Strategy", + dataType = "Integer", + example = "1", + notes = "The save point strategy") private Integer savePointStrategy; + + @ApiModelProperty( + value = "Save Point Path", + dataType = "String", + example = "/savepoints", + notes = "The path for save points") private String savePointPath; + + @ApiModelProperty( + value = "Configuration JSON", + dataType = "Object", + example = "{}", + notes = "The JSON configuration for the query") private TaskExtConfig configJson; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java index 4595504c51..0196e49c64 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/StudioMetaStoreDTO.java @@ -22,6 +22,8 @@ import org.dinky.gateway.enums.GatewayType; import org.dinky.job.JobConfig; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -32,12 +34,34 @@ */ @Getter @Setter +@ApiModel(value = "StudioMetaStoreDTO", description = "DTO for storing metadata in Studio") public class StudioMetaStoreDTO extends AbstractStatementDTO { + @ApiModelProperty(value = "Catalog", dataType = "String", example = "my_catalog", notes = "The name of the catalog") private String catalog; + + @ApiModelProperty( + value = "Database", + dataType = "String", + example = "my_database", + notes = "The name of the database") private String database; + + @ApiModelProperty(value = "Table", dataType = "String", example = "my_table", notes = "The name of the table") private String table; + + @ApiModelProperty( + value = "Dialect", + dataType = "String", + example = "MySQL", + notes = "The SQL dialect for the table") private String dialect; + + @ApiModelProperty( + value = "Database ID", + dataType = "Integer", + example = "1", + notes = "The identifier of the database") private Integer databaseId; public JobConfig getJobConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/TaskRollbackVersionDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/TaskRollbackVersionDTO.java index e561355ea1..0888ab698c 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/TaskRollbackVersionDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/TaskRollbackVersionDTO.java @@ -21,12 +21,22 @@ import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @description: 任务回滚DTO */ @Data +@ApiModel(value = "TaskRollbackVersionDTO", description = "DTO for rolling back a task to a specific version") public class TaskRollbackVersionDTO implements Serializable { + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "The identifier of the task") private Integer id; + + @ApiModelProperty( + value = "Version ID", + dataType = "Integer", + example = "2", + notes = "The identifier of the version to rollback to") private Integer versionId; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionConfigureDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionConfigureDTO.java index 3370ec98a3..7d142dbd99 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionConfigureDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionConfigureDTO.java @@ -21,63 +21,126 @@ import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @description: 版本信息配置 */ @Data +@ApiModel(value = "TaskVersionConfigureDTO", description = "DTO for task version configuration") public class TaskVersionConfigureDTO implements Serializable { - /** CheckPoint */ + @ApiModelProperty(value = "CheckPoint", dataType = "Integer", example = "1", notes = "The CheckPoint configuration") private Integer checkPoint; - /** SavePoint策略 */ + @ApiModelProperty( + value = "SavePoint strategy", + dataType = "Integer", + example = "2", + notes = "The SavePoint strategy configuration") private Integer savePointStrategy; - /** SavePointPath */ + @ApiModelProperty( + value = "SavePoint path", + dataType = "String", + example = "/path/to/savepoint", + notes = "The SavePoint path configuration") private String savePointPath; - /** parallelism */ + @ApiModelProperty( + value = "Parallelism", + dataType = "Integer", + example = "4", + notes = "The parallelism configuration") private Integer parallelism; - /** fragment */ + @ApiModelProperty( + value = "Fragment", + dataType = "Boolean", + example = "false", + notes = "Whether to enable fragment mode") private Boolean fragment; - /** 启用语句集 */ + @ApiModelProperty( + value = "Statement Set", + dataType = "Boolean", + example = "true", + notes = "Whether to enable statement set") private Boolean statementSet; - /** 使用批模式 */ + @ApiModelProperty( + value = "Batch Model", + dataType = "Boolean", + example = "false", + notes = "Whether to use batch mode") private Boolean batchModel; - /** Flink集群ID */ + @ApiModelProperty( + value = "Flink Cluster ID", + dataType = "Integer", + example = "3", + notes = "The ID of the Flink cluster") private Integer clusterId; - /** 集群配置ID */ + @ApiModelProperty( + value = "Cluster Configuration ID", + dataType = "Integer", + example = "4", + notes = "The ID of the cluster configuration") private Integer clusterConfigurationId; - /** 数据源ID */ + @ApiModelProperty( + value = "Database ID", + dataType = "Integer", + example = "5", + notes = "The ID of the database source") private Integer databaseId; - /** jarID */ + @ApiModelProperty(value = "Jar ID", dataType = "Integer", example = "6", notes = "The ID of the JAR file") private Integer jarId; - /** 环境ID */ + @ApiModelProperty( + value = "Environment ID", + dataType = "Integer", + example = "7", + notes = "The ID of the environment") private Integer envId; - /** 报警组ID */ + @ApiModelProperty( + value = "Alert Group ID", + dataType = "Integer", + example = "8", + notes = "The ID of the alert group") private Integer alertGroupId; - /** 配置JSON */ + @ApiModelProperty( + value = "Configuration JSON", + dataType = "String", + example = "{\"key\":\"value\"}", + notes = "The configuration JSON") private String configJson; - /** 注释 */ + @ApiModelProperty( + value = "Note", + dataType = "String", + example = "Task configuration notes", + notes = "Additional notes") private String note; - /** 作业生命周期 */ + @ApiModelProperty(value = "Step", dataType = "Integer", example = "1", notes = "The task lifecycle step") private Integer step; - /** 作业实例ID */ + @ApiModelProperty( + value = "Job Instance ID", + dataType = "Integer", + example = "9", + notes = "The ID of the job instance") private Integer jobInstanceId; - /** 是否启用 */ + @ApiModelProperty( + value = "Enabled", + dataType = "Boolean", + example = "true", + notes = "Whether the configuration is enabled") private Boolean enabled; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionHistoryDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionHistoryDTO.java index e489e489f5..15a522d667 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionHistoryDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/TaskVersionHistoryDTO.java @@ -22,18 +22,60 @@ import java.io.Serializable; import java.util.Date; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @description: 任务版本记录 */ @Data +@ApiModel(value = "TaskVersionHistoryDTO", description = "DTO for task version history") public class TaskVersionHistoryDTO implements Serializable { + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "The ID of the task version history") private Integer id; + + @ApiModelProperty( + value = "Task ID", + dataType = "Integer", + example = "2", + notes = "The ID of the task associated with this version history") private Integer taskId; + + @ApiModelProperty( + value = "Name", + dataType = "String", + example = "Version 1", + notes = "The name of the task version") private String name; + + @ApiModelProperty( + value = "Dialect", + dataType = "String", + example = "SQL", + notes = "The SQL dialect used in the task version") private String dialect; + + @ApiModelProperty( + value = "Type", + dataType = "String", + example = "BATCH", + notes = "The type of the task version (e.g., BATCH)") private String type; + + @ApiModelProperty( + value = "Statement", + dataType = "String", + example = "SELECT * FROM table", + notes = "The SQL statement of the task version") private String statement; + + @ApiModelProperty(value = "Version ID", dataType = "Integer", example = "3", notes = "The ID of the task version") private Integer versionId; + + @ApiModelProperty( + value = "Create Time", + dataType = "Date", + example = "2023-09-15T10:00:00Z", + notes = "The timestamp when the task version was created") private Date createTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/TreeNodeDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/TreeNodeDTO.java index c80639f5c9..70245c63a7 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/TreeNodeDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/TreeNodeDTO.java @@ -21,6 +21,8 @@ import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -35,15 +37,50 @@ @NoArgsConstructor @AllArgsConstructor @ToString +@ApiModel(value = "TreeNodeDTO", description = "DTO for tree nodes") public class TreeNodeDTO { + + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "The ID of the tree node") private Integer id; + + @ApiModelProperty(value = "Name", dataType = "String", example = "Node 1", notes = "The name of the tree node") private String name; + + @ApiModelProperty(value = "Path", dataType = "String", example = "/node/1", notes = "The path of the tree node") private String path; + + @ApiModelProperty( + value = "Content", + dataType = "String", + example = "Node content", + notes = "The content of the tree node") private String content; + + @ApiModelProperty( + value = "Parent ID", + dataType = "Integer", + example = "0", + notes = "The ID of the parent tree node (0 for root)") private Integer parentId; + + @ApiModelProperty(value = "Size", dataType = "Long", example = "1024", notes = "The size of the tree node") private Long size; + + @ApiModelProperty( + value = "Is Leaf", + dataType = "boolean", + example = "false", + notes = "Indicates whether the tree node is a leaf node (true/false)") private boolean isLeaf; + + @ApiModelProperty( + value = "Description", + dataType = "String", + example = "Node description", + notes = "Additional description for the tree node") private String desc; + + @ApiModelProperty(value = "Children", dataType = "List", notes = "List of child tree nodes") private List children; public TreeNodeDTO(String name, String path, boolean isLeaf, List children, Long size) { diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/UserDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/UserDTO.java index e2c329b67b..6eda135559 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/UserDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/UserDTO.java @@ -27,6 +27,8 @@ import java.util.List; import cn.dev33.satoken.stp.SaTokenInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -34,12 +36,24 @@ @Data @NoArgsConstructor @AllArgsConstructor +@ApiModel(value = "UserDTO", description = "User DTO") public class UserDTO { + @ApiModelProperty(value = "user", required = true, dataType = "User", allowEmptyValue = false) private User user; + + @ApiModelProperty(value = "roleList", required = true, dataType = "List", allowEmptyValue = false) private List roleList; + + @ApiModelProperty(value = "tenantList", required = true, dataType = "List", allowEmptyValue = false) private List tenantList; + + @ApiModelProperty(value = "menuList", required = true, dataType = "List", allowEmptyValue = false) private List menuList; + + @ApiModelProperty(value = "currentTenant", required = true, dataType = "Tenant", allowEmptyValue = true) private Tenant currentTenant; + + @ApiModelProperty(value = "tokenInfo", required = true, dataType = "SaTokenInfo", allowEmptyValue = true) private SaTokenInfo tokenInfo; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/AlertGroup.java b/dinky-admin/src/main/java/org/dinky/data/model/AlertGroup.java index 22982633a1..2eefea5f06 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/AlertGroup.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/AlertGroup.java @@ -26,6 +26,8 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -37,16 +39,21 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_alert_group") +@ApiModel(value = "AlertGroup", description = "Alert Group") public class AlertGroup extends SuperEntity { private static final long serialVersionUID = 7027411164191682344L; + @ApiModelProperty(value = "Tenant ID", required = true, dataType = "Integer", example = "1") private Integer tenantId; + @ApiModelProperty(value = "Alert Instance Ids", required = true, dataType = "String", example = "1,2,3") private String alertInstanceIds; + @ApiModelProperty(value = "Alert Group Note", required = true, dataType = "String", example = "Alert Group Note") private String note; @TableField(exist = false) + @ApiModelProperty(value = "Alert Instances", required = true, dataType = "List") private List instances; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/AlertHistory.java b/dinky-admin/src/main/java/org/dinky/data/model/AlertHistory.java index 30b53bbb69..4d94e19270 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/AlertHistory.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/AlertHistory.java @@ -28,6 +28,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -39,30 +41,49 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_alert_history") +@ApiModel(value = "AlertHistory", description = "Alert History Record") public class AlertHistory implements Serializable { private static final long serialVersionUID = -7904869940473678282L; @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "ID", example = "1", required = true, dataType = "Integer") private Integer id; + @ApiModelProperty(value = "Tenant ID", example = "1", required = true, dataType = "Integer") private Integer tenantId; + @ApiModelProperty(value = "Alert Group ID", example = "1", required = true, dataType = "Integer") private Integer alertGroupId; + @ApiModelProperty(value = "Alert Instance ID", example = "1", required = true, dataType = "Integer") private Integer jobInstanceId; + @ApiModelProperty(value = "Alert title", example = "Alert title", required = true, dataType = "String") private String title; + @ApiModelProperty(value = "Alert content", example = "Alert content", required = true, dataType = "String") private String content; + @ApiModelProperty(value = "Alert status", example = "1", required = true, dataType = "Integer") private Integer status; + @ApiModelProperty(value = "Alert log", example = "Alert log", required = true, dataType = "String") private String log; @TableField(fill = FieldFill.INSERT) + @ApiModelProperty( + value = "Create Time", + example = "2022-02-24 20:12:00", + required = false, + dataType = "LocalDateTime") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) + @ApiModelProperty( + value = "Update Time", + example = "2022-02-24 20:12:00", + required = false, + dataType = "LocalDateTime") private LocalDateTime updateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/AlertInstance.java b/dinky-admin/src/main/java/org/dinky/data/model/AlertInstance.java index 5bc81dcc27..958c9c880a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/AlertInstance.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/AlertInstance.java @@ -23,6 +23,9 @@ import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.Extension; +import io.swagger.annotations.ExtensionProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -38,9 +41,25 @@ public class AlertInstance extends SuperEntity { private static final long serialVersionUID = -3435401513220527001L; + @ApiModelProperty(value = "Tenant ID", required = true, dataType = "Integer", example = "1") private Integer tenantId; + @ApiModelProperty( + value = "Alert Instance Type", + required = true, + dataType = "String", + example = "DingTalk", + extensions = { + @Extension( + name = "alertType-enum", + properties = {@ExtensionProperty(name = "values", value = "DingTalk,WeChat,Email,FeiShu,Sms")}) + }) private String type; + @ApiModelProperty( + value = "Alert Instance Params", + required = true, + dataType = "String", + example = "{\"webhook\":\"https://oapi.dingtalk.com/robot/send?access_token=xxxxxx\"}") private String params; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/AlertRule.java b/dinky-admin/src/main/java/org/dinky/data/model/AlertRule.java index e42819453e..8013a28ce6 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/AlertRule.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/AlertRule.java @@ -25,6 +25,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.Extension; +import io.swagger.annotations.ExtensionProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; @@ -47,7 +49,12 @@ public class AlertRule extends SuperEntity { required = true, dataType = "String", example = "ruleType", - allowableValues = "CUSTOM,SYSTEM") + allowableValues = "CUSTOM,SYSTEM", + extensions = { + @Extension( + name = "ruleType-enum", + properties = {@ExtensionProperty(name = "values", value = "CUSTOM,SYSTEM")}) + }) String ruleType; @ApiModelProperty( @@ -55,7 +62,12 @@ public class AlertRule extends SuperEntity { required = true, dataType = "String", example = "or", - allowableValues = "or,and") + allowableValues = "or,and", + extensions = { + @Extension( + name = "triggerConditions-enum", + properties = {@ExtensionProperty(name = "values", value = "or,and")}) + }) String triggerConditions; @ApiModelProperty(value = "description", required = true, dataType = "String", example = "description") diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Catalogue.java b/dinky-admin/src/main/java/org/dinky/data/model/Catalogue.java index c3196c7f70..dcd4738690 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Catalogue.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Catalogue.java @@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -42,17 +43,23 @@ public class Catalogue extends SuperEntity { private static final long serialVersionUID = 4659379420249868394L; + @ApiModelProperty(value = "Tenant ID", required = true, dataType = "Integer", example = "1") private Integer tenantId; + @ApiModelProperty(value = "Task ID", required = true, dataType = "Integer", example = "1") private Integer taskId; + @ApiModelProperty(value = "Type", required = true, dataType = "String", example = "Flinksql") private String type; + @ApiModelProperty(value = "Parent ID", required = true, dataType = "Integer", example = "1") private Integer parentId; + @ApiModelProperty(value = "Is Leaf", required = true, dataType = "Boolean", example = "true") private Boolean isLeaf; @TableField(exist = false) + @ApiModelProperty(value = "Children", required = true, dataType = "List", example = "[]") private List children = new ArrayList<>(); @TableField(exist = false) diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Cluster.java b/dinky-admin/src/main/java/org/dinky/data/model/Cluster.java index f0ff37d196..74c0d0592a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Cluster.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Cluster.java @@ -25,6 +25,8 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -36,31 +38,78 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_cluster") +@ApiModel(value = "Cluster", description = "Cluster") public class Cluster extends SuperEntity { private static final long serialVersionUID = 3104721227014487321L; + @ApiModelProperty(value = "name", required = true, dataType = "String", example = "test") private Integer tenantId; @TableField(fill = FieldFill.INSERT) + @ApiModelProperty( + value = "alias", + required = true, + dataType = "String", + example = "test", + notes = "cluster alias, if this is auto register, it will be has value, and can not modify it") private String alias; + @ApiModelProperty( + value = "type", + required = true, + dataType = "String", + example = "test", + notes = "cluster type, such as: standalone ,yarn-session") private String type; + @ApiModelProperty(value = "hosts", required = true, dataType = "String", example = "test", notes = "cluster hosts") private String hosts; + @ApiModelProperty( + value = "jobManagerHost", + required = true, + dataType = "String", + example = "test", + notes = "job manager host") private String jobManagerHost; + @ApiModelProperty( + value = "version", + required = true, + dataType = "String", + example = "test", + notes = "Flink cluster version") private String version; + @ApiModelProperty( + value = "status", + required = true, + dataType = "Integer", + example = "test", + notes = "0:unavailable, 1:available") private Integer status; + @ApiModelProperty(value = "note", dataType = "String", example = "test") private String note; + @ApiModelProperty( + value = "autoRegisters", + required = true, + dataType = "Boolean", + example = "test", + notes = "is auto registers, if this record from projob/application mode , it will be true") private Boolean autoRegisters; + @ApiModelProperty( + value = "clusterConfigurationId", + required = true, + dataType = "Integer", + example = "test", + notes = "cluster configuration id") private Integer clusterConfigurationId; + @ApiModelProperty(value = "taskId", required = true, dataType = "Integer", example = "test", notes = "task id") private Integer taskId; public static Cluster autoRegistersCluster( diff --git a/dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java b/dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java index 98d9404754..bcbb058a0e 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java @@ -26,6 +26,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import cn.hutool.json.JSONObject; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -37,17 +39,39 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_cluster_configuration") +@ApiModel(value = "ClusterConfiguration", description = "if your cluster type is yarn ,the record is there") public class ClusterConfiguration extends SuperEntity { private static final long serialVersionUID = 5830130188542066241L; + @ApiModelProperty(value = "tenantId", required = true, dataType = "String", example = "1", notes = "the Tenant Id") private Integer tenantId; + @ApiModelProperty( + value = "type", + required = true, + dataType = "String", + example = "test", + notes = "cluster type, such as: yarn ,k8s-native ,k8s-session") private String type; + + @ApiModelProperty( + value = "configJson", + required = true, + dataType = "String", + example = "test", + notes = "cluster config json") private String configJson; + @ApiModelProperty( + value = "isAvailable", + required = true, + dataType = "Boolean", + example = "true", + notes = "cluster is available, 0: not available, 1: available") private Boolean isAvailable; + @ApiModelProperty(value = "note", required = true, dataType = "String", example = "test", notes = "cluster note") private String note; public FlinkClusterConfig getFlinkClusterCfg() { diff --git a/dinky-admin/src/main/java/org/dinky/data/model/ConfigItem.java b/dinky-admin/src/main/java/org/dinky/data/model/ConfigItem.java index 6f720c3fbe..8016011d33 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/ConfigItem.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/ConfigItem.java @@ -21,6 +21,8 @@ import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -28,9 +30,13 @@ @Data @AllArgsConstructor @NoArgsConstructor +@ApiModel(value = "ConfigItem", description = "User custom config item") public class ConfigItem implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "key", required = true, dataType = "String", example = "test") private String key; + + @ApiModelProperty(value = "value", required = true, dataType = "String", example = "test") private String value; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/DataBase.java b/dinky-admin/src/main/java/org/dinky/data/model/DataBase.java index 88e0a34b78..8074dd8d3c 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/DataBase.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/DataBase.java @@ -28,6 +28,8 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -39,32 +41,49 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName(value = "dinky_database", autoResultMap = true) +@ApiModel(value = "DataBase", description = "DataBase Register") public class DataBase extends SuperEntity { private static final long serialVersionUID = -5002272138861566408L; + @ApiModelProperty(value = "tenantId", required = true, dataType = "Integer", example = "1") private Integer tenantId; + @ApiModelProperty(value = "groupName", required = true, dataType = "String", example = "source") private String groupName; + + @ApiModelProperty(value = "type", required = true, dataType = "String", example = "MySQL") private String type; + + @ApiModelProperty(value = "url", required = true, dataType = "String", example = "jdbc:mysql://localhost:3306/test") private String url; + + @ApiModelProperty(value = "username", required = true, dataType = "String", example = "root") private String username; @TableField(typeHandler = CryptoTypeHandler.class) + @ApiModelProperty(value = "password", required = true, dataType = "String", example = "123456") private String password; + @ApiModelProperty(value = "note", dataType = "String", example = "note") private String note; + @ApiModelProperty(value = "flinkConfig", dataType = "String", example = "flinkConfig") private String flinkConfig; + @ApiModelProperty(value = "flinkTemplate", dataType = "String", example = "flinkTemplate") private String flinkTemplate; + @ApiModelProperty(value = "dbVersion", dataType = "String", example = "dbVersion") private String dbVersion; + @ApiModelProperty(value = "status", dataType = "Boolean", example = "true") private Boolean status; + @ApiModelProperty(value = "healthTime", dataType = "LocalDateTime", example = "2021-07-20 20:53:00") private LocalDateTime healthTime; + @ApiModelProperty(value = "heartbeatTime", dataType = "LocalDateTime", example = "2021-07-20 20:53:00") private LocalDateTime heartbeatTime; public DriverConfig getDriverConfig() { diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Document.java b/dinky-admin/src/main/java/org/dinky/data/model/Document.java index 0c32bc81c0..423a822c35 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Document.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Document.java @@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,14 +36,59 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_flink_document") +@ApiModel(value = "Document", description = "Document manage") public class Document extends SuperEntity { private static final long serialVersionUID = -6340080980759236641L; + + @ApiModelProperty(value = "Category Type", required = true, example = "1", notes = "Category Type description") private String category; + + @ApiModelProperty( + value = "Type", + example = "ExampleType", + notes = "Type description", + dataType = "String", + required = true) private String type; + + @ApiModelProperty( + value = "Subtype", + example = "ExampleSubtype", + notes = "Subtype description", + dataType = "String", + required = true) private String subtype; + + @ApiModelProperty( + value = "Description", + example = "ExampleDescription", + notes = "Description description", + dataType = "String", + required = true) private String description; + + @ApiModelProperty( + value = "Version", + example = "ExampleVersion", + notes = "Version description", + dataType = "String", + required = true) private String version; + + @ApiModelProperty( + value = "Fill Value", + example = "ExampleFillValue", + notes = "Fill Value description", + dataType = "String", + required = true) private String fillValue; + + @ApiModelProperty( + value = "Like Num", + example = "ExampleLikeNum", + notes = "Like Num description", + dataType = "String", + required = true) private String likeNum; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/FileNode.java b/dinky-admin/src/main/java/org/dinky/data/model/FileNode.java index 9ee5b0e7d5..b25c5e3e88 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/FileNode.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/FileNode.java @@ -19,54 +19,40 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + /** * FileNode * * @since 2022/10/15 18:41 */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "FileNode", description = "File Node Information") public class FileNode { + @ApiModelProperty( + value = "Name of the file or directory", + required = true, + example = "example.txt", + dataType = "String") private String name; - private boolean isDir; - private long size; - private String path; - - public FileNode(String name, boolean isDir, long size, String path) { - this.name = name; - this.isDir = isDir; - this.size = size; - this.path = path; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public boolean isDir() { - return isDir; - } - - public void setDir(boolean dir) { - isDir = dir; - } - - public long getSize() { - return size; - } - - public void setSize(long size) { - this.size = size; - } + @ApiModelProperty(value = "Indicates if it is a directory", required = true, example = "true", dataType = "boolean") + private boolean isDir; - public String getPath() { - return path; - } + @ApiModelProperty(value = "Size of the file in bytes", required = true, example = "1024", dataType = "long") + private long size; - public void setPath(String path) { - this.path = path; - } + @ApiModelProperty( + value = "Path to the file or directory", + required = true, + example = "/path/to/file", + dataType = "String") + private String path; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/FragmentVariable.java b/dinky-admin/src/main/java/org/dinky/data/model/FragmentVariable.java index 657880d502..45c8ab97d3 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/FragmentVariable.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/FragmentVariable.java @@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -38,9 +40,15 @@ @NoArgsConstructor @EqualsAndHashCode(callSuper = false) @TableName("dinky_fragment") +@ApiModel(value = "FragmentVariable", description = "Fragment Variable Information") public class FragmentVariable extends SuperEntity { + @ApiModelProperty(value = "Tenant ID", required = true, example = "1", dataType = "Integer") private Integer tenantId; + + @ApiModelProperty(value = "Fragment Value", required = true, example = "exampleValue", dataType = "String") private String fragmentValue; + + @ApiModelProperty(value = "Note", example = "This is a note about the variable", dataType = "String") private String note; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/GitProject.java b/dinky-admin/src/main/java/org/dinky/data/model/GitProject.java index 63fe8bf20f..dde18c8624 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/GitProject.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/GitProject.java @@ -29,6 +29,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -37,65 +39,75 @@ */ @TableName(value = "dinky_git_project") @Data +@ApiModel(value = "GitProject", description = "Git Project Information") public class GitProject extends SuperEntity { /** */ + @ApiModelProperty(value = "Tenant ID", example = "1", dataType = "Long") @TableField(value = "tenant_id") private Long tenantId; - /** */ + @ApiModelProperty( + value = "URL", + example = "https://github.com/example/project.git", + dataType = "String", + required = true) @TableField(value = "url") private String url; - /** */ + @ApiModelProperty(value = "Branch", example = "main", dataType = "String") @TableField(value = "branch") private String branch; - /** */ + @ApiModelProperty(value = "Username", example = "john_doe", dataType = "String") @TableField(value = "username") private String username; - /** */ + @ApiModelProperty(value = "Password", example = "********", dataType = "String") @TableField(value = "password") private String password; + @ApiModelProperty(value = "Private Key", dataType = "String") private String privateKey; - /** */ + @ApiModelProperty(value = "POM", example = "pom.xml", dataType = "String") @TableField(value = "pom") private String pom; - /** */ + @ApiModelProperty(value = "Build Arguments", dataType = "String") @TableField(value = "build_args") private String buildArgs; - /** */ + @ApiModelProperty(value = "Code Type", example = "1", dataType = "Integer") @TableField(value = "code_type") private Integer codeType; - /** */ + + @ApiModelProperty(value = "Type", example = "1", dataType = "Integer") @TableField(value = "type") private Integer type; - /** */ + @ApiModelProperty(value = "Last Build Date", dataType = "Date") @TableField(value = "last_build") private Date lastBuild; - /** */ + @ApiModelProperty(value = "Description", dataType = "String") @TableField(value = "description") private String description; - /** */ + @ApiModelProperty(value = "Build State", example = "1", dataType = "Integer") @TableField(value = "build_state") private Integer buildState; + @ApiModelProperty(value = "Build Step", dataType = "Integer") @TableField(value = "build_step") private Integer buildStep; - /** scan udf class */ + @ApiModelProperty(value = "UDF Class Map List", dataType = "String") @TableField(value = "udf_class_map_list") @JsonDeserialize(using = JsonObjectDeserializer.class) private String udfClassMapList; + @ApiModelProperty(value = "Order Line", dataType = "Integer") @TableField(value = "order_line") private Integer orderLine; diff --git a/dinky-admin/src/main/java/org/dinky/data/model/History.java b/dinky-admin/src/main/java/org/dinky/data/model/History.java index b653a66c32..88c8d0527b 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/History.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/History.java @@ -26,6 +26,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.node.ObjectNode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -37,52 +39,75 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_history") +@ApiModel(value = "History", description = "History Information") public class History implements Serializable { private static final long serialVersionUID = 4058280957630503072L; + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1") private Integer id; + @ApiModelProperty(value = "Tenant ID", dataType = "Integer", example = "1", required = true) private Integer tenantId; + @ApiModelProperty(value = "Cluster ID", dataType = "Integer") private Integer clusterId; + @ApiModelProperty(value = "Cluster Configuration ID", dataType = "Integer") private Integer clusterConfigurationId; + @ApiModelProperty(value = "Session", dataType = "String") private String session; + @ApiModelProperty(value = "Job ID", dataType = "String") private String jobId; + + @ApiModelProperty(value = "Job Name", dataType = "String") private String jobName; + @ApiModelProperty(value = "Job Manager Address", dataType = "String") private String jobManagerAddress; + @ApiModelProperty(value = "Status", dataType = "Integer") private Integer status; + @ApiModelProperty(value = "Statement", dataType = "String") private String statement; + @ApiModelProperty(value = "Type", dataType = "String") private String type; + @ApiModelProperty(value = "Error", dataType = "String") private String error; + @ApiModelProperty(value = "Result", dataType = "String") private String result; @TableField(exist = false) + @ApiModelProperty(hidden = true) private ObjectNode config; + @ApiModelProperty(value = "JSON Configuration", dataType = "String") private String configJson; + @ApiModelProperty(value = "Start Time", dataType = "LocalDateTime") private LocalDateTime startTime; + @ApiModelProperty(value = "End Time", dataType = "LocalDateTime") private LocalDateTime endTime; + @ApiModelProperty(value = "Task ID", dataType = "Integer") private Integer taskId; @TableField(exist = false) + @ApiModelProperty(hidden = true) private String statusText; @TableField(exist = false) + @ApiModelProperty(hidden = true) private String clusterName; + @ApiModelProperty(hidden = true) public JobInstance buildJobInstance() { JobInstance jobInstance = new JobInstance(); jobInstance.setHistoryId(id); diff --git a/dinky-admin/src/main/java/org/dinky/data/model/HomeResource.java b/dinky-admin/src/main/java/org/dinky/data/model/HomeResource.java index 0c416c918d..ea3d6fb3df 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/HomeResource.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/HomeResource.java @@ -19,23 +19,32 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "HomeResource", description = "Home Resource Information") public class HomeResource { - /** flink instance count */ + @ApiModelProperty(value = "Flink Cluster Count", dataType = "Integer") private Integer flinkClusterCount; - /** flink config count */ + + @ApiModelProperty(value = "Flink Config Count", dataType = "Integer") private Integer flinkConfigCount; - /** data source count */ + + @ApiModelProperty(value = "Database Source Count", dataType = "Integer") private Integer dbSourceCount; - /** global var count */ + + @ApiModelProperty(value = "Global Variable Count", dataType = "Integer") private Integer globalVarCount; - /** alert instance count */ + + @ApiModelProperty(value = "Alert Instance Count", dataType = "Integer") private Integer alertInstanceCount; - /** alert group count */ + + @ApiModelProperty(value = "Alert Group Count", dataType = "Integer") private Integer alertGroupCount; - /** git project count */ + + @ApiModelProperty(value = "Git Project Count", dataType = "Integer") private Integer gitProjectCount; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Jar.java b/dinky-admin/src/main/java/org/dinky/data/model/Jar.java index d6cf8c77c4..d6c1672e56 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Jar.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Jar.java @@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,19 +36,38 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_jar") +@ApiModel(value = "Jar", description = "Jar Information") public class Jar extends SuperEntity { private static final long serialVersionUID = 3769276772487490408L; + @ApiModelProperty(value = "Tenant ID", dataType = "Integer", example = "1", notes = "Tenant ID of the Jar") private Integer tenantId; + @ApiModelProperty(value = "Type", dataType = "String", example = "type", notes = "Type of the Jar") private String type; + @ApiModelProperty(value = "Path", dataType = "String", example = "/path/to/jar.jar", notes = "Path to the Jar file") private String path; + @ApiModelProperty( + value = "Main Class", + dataType = "String", + example = "com.example.Main", + notes = "Main class of the Jar") private String mainClass; + @ApiModelProperty( + value = "Parameters", + dataType = "String", + example = "--param1 value1 --param2 value2", + notes = "Parameters for running the Jar") private String paras; + @ApiModelProperty( + value = "Note", + dataType = "String", + example = "This is a note about the Jar", + notes = "Additional notes or description") private String note; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobHistory.java b/dinky-admin/src/main/java/org/dinky/data/model/JobHistory.java index 4409a40367..2845bc4171 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobHistory.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobHistory.java @@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.node.ObjectNode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -38,57 +40,125 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_job_history") +@ApiModel(value = "JobHistory", description = "Job History Information") public class JobHistory implements Serializable { private static final long serialVersionUID = 4984787372340047250L; + @ApiModelProperty( + value = "ID", + dataType = "Integer", + example = "1", + notes = "Unique identifier for the job history") private Integer id; + @ApiModelProperty( + value = "Tenant ID", + dataType = "Integer", + example = "1", + notes = "Tenant ID associated with the job history") private Integer tenantId; @TableField(exist = false) + @ApiModelProperty(value = "Job Object", notes = "Object representing job details") private ObjectNode job; + @ApiModelProperty( + value = "Job JSON", + dataType = "String", + example = "{\"jobName\": \"Example Job\"}", + notes = "JSON representation of the job") private String jobJson; @TableField(exist = false) + @ApiModelProperty(value = "Exceptions Object", notes = "Object representing job exceptions") private ObjectNode exceptions; + @ApiModelProperty( + value = "Exceptions JSON", + dataType = "String", + example = "{\"exceptionType\": \"RuntimeException\"}", + notes = "JSON representation of exceptions") private String exceptionsJson; @TableField(exist = false) + @ApiModelProperty(value = "Checkpoints Object", notes = "Object representing job checkpoints") private ObjectNode checkpoints; + @ApiModelProperty( + value = "Checkpoints JSON", + dataType = "String", + example = "{\"checkpointId\": 123}", + notes = "JSON representation of checkpoints") private String checkpointsJson; @TableField(exist = false) + @ApiModelProperty(value = "Checkpoints Config Object", notes = "Object representing checkpoints configuration") private ObjectNode checkpointsConfig; + @ApiModelProperty( + value = "Checkpoints Config JSON", + dataType = "String", + example = "{\"configParam\": \"value\"}", + notes = "JSON representation of checkpoints config") private String checkpointsConfigJson; @TableField(exist = false) + @ApiModelProperty(value = "Config Object", notes = "Object representing job configuration") private ObjectNode config; + @ApiModelProperty( + value = "Config JSON", + dataType = "String", + example = "{\"configParam\": \"value\"}", + notes = "JSON representation of config") private String configJson; @TableField(exist = false) + @ApiModelProperty(value = "Jar Object", notes = "Object representing the JAR used in the job") private ObjectNode jar; + @ApiModelProperty( + value = "Jar JSON", + dataType = "String", + example = "{\"jarName\": \"example.jar\"}", + notes = "JSON representation of the JAR") private String jarJson; @TableField(exist = false) + @ApiModelProperty(value = "Cluster Object", notes = "Object representing the cluster") private ObjectNode cluster; + @ApiModelProperty( + value = "Cluster JSON", + dataType = "String", + example = "{\"clusterName\": \"exampleCluster\"}", + notes = "JSON representation of the cluster") private String clusterJson; @TableField(exist = false) + @ApiModelProperty(value = "Cluster Configuration Object", notes = "Object representing cluster configuration") private ObjectNode clusterConfiguration; + @ApiModelProperty( + value = "Cluster Configuration JSON", + dataType = "String", + example = "{\"configParam\": \"value\"}", + notes = "JSON representation of cluster configuration") private String clusterConfigurationJson; @TableField(fill = FieldFill.INSERT_UPDATE) + @ApiModelProperty( + value = "Update Time", + dataType = "LocalDateTime", + notes = "Timestamp indicating the last update time") private LocalDateTime updateTime; @TableField(exist = false) + @ApiModelProperty( + value = "Error Flag", + dataType = "boolean", + example = "true", + notes = "Flag indicating if there was an error") private boolean error; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobInfoDetail.java b/dinky-admin/src/main/java/org/dinky/data/model/JobInfoDetail.java index e57caa62d7..3e54a0b7bf 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobInfoDetail.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobInfoDetail.java @@ -21,21 +21,46 @@ import java.util.Set; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + /** * JobInfoDetail * * @since 2022/3/1 19:31 */ +@ApiModel(value = "JobInfoDetail", description = "Job Information Detail") public class JobInfoDetail { + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the job") private Integer id; + + @ApiModelProperty(value = "Job Instance", notes = "Details about the job instance") private JobInstance instance; + + @ApiModelProperty(value = "Cluster", notes = "Details about the cluster") private Cluster cluster; + + @ApiModelProperty(value = "Cluster Configuration", notes = "Details about the cluster configuration") private ClusterConfiguration clusterConfiguration; + + @ApiModelProperty(value = "History", notes = "Details about the history") private History history; + + @ApiModelProperty(value = "Job History", notes = "Details about the job history") private JobHistory jobHistory; + + @ApiModelProperty(value = "Job Manager Configuration", notes = "Details about the job manager configuration") private JobManagerConfiguration jobManagerConfiguration; + + @ApiModelProperty(value = "Task Manager Configurations", notes = "Set of task manager configurations") private Set taskManagerConfiguration; + + @ApiModelProperty( + value = "Refresh Count", + dataType = "Integer", + example = "5", + notes = "Count of refresh operations") private Integer refreshCount; public JobInfoDetail(Integer id) { diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobInstance.java b/dinky-admin/src/main/java/org/dinky/data/model/JobInstance.java index 081c3ea951..adf4206e02 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobInstance.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobInstance.java @@ -29,6 +29,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -40,52 +42,114 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_job_instance") +@ApiModel(value = "JobInstance", description = "Job Instance Information") public class JobInstance implements Serializable { private static final long serialVersionUID = -3410230507904303730L; @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty( + value = "ID", + dataType = "Integer", + example = "1", + notes = "Unique identifier for the job instance") private Integer id; + @ApiModelProperty( + value = "Tenant ID", + dataType = "Integer", + example = "1", + notes = "Tenant ID associated with the job instance") private Integer tenantId; + @ApiModelProperty(value = "Name", dataType = "String", notes = "Name of the job instance") private String name; + @ApiModelProperty( + value = "Task ID", + dataType = "Integer", + example = "1", + notes = "Task ID associated with the job instance") private Integer taskId; + @ApiModelProperty(value = "Step", dataType = "Integer", example = "1", notes = "Step number of the job instance") private Integer step; + @ApiModelProperty( + value = "Cluster ID", + dataType = "Integer", + example = "1", + notes = "Cluster ID associated with the job instance") private Integer clusterId; + @ApiModelProperty(value = "JID", dataType = "String", notes = "JID of the job instance") private String jid; + @ApiModelProperty(value = "Status", dataType = "String", notes = "Status of the job instance") private String status; + @ApiModelProperty( + value = "History ID", + dataType = "Integer", + example = "1", + notes = "History ID associated with the job instance") private Integer historyId; + @ApiModelProperty(value = "Error", dataType = "String", notes = "Error message associated with the job instance") private String error; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(fill = FieldFill.INSERT) + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the job instance") private LocalDateTime createTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(fill = FieldFill.INSERT_UPDATE) + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the job instance") private LocalDateTime updateTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Finish Time", + dataType = "String", + notes = "Timestamp indicating the finish time of the job instance") private LocalDateTime finishTime; + @ApiModelProperty( + value = "Duration", + dataType = "Long", + example = "3600", + notes = "Duration of the job instance in seconds") private Long duration; + @ApiModelProperty( + value = "Failed Restart Count", + dataType = "Integer", + example = "2", + notes = "Count of failed restarts") private Integer failedRestartCount; @TableField(exist = false) + @ApiModelProperty(value = "Type", dataType = "String", notes = "Type of the job instance") private String type; @TableField(exist = false) + @ApiModelProperty( + value = "Cluster Name", + dataType = "String", + notes = "Name of the cluster associated with the job instance") private String clusterName; @TableField(exist = false) + @ApiModelProperty( + value = "Job Manager Address", + dataType = "String", + notes = "Job manager address associated with the job instance") private String jobManagerAddress; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceCount.java b/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceCount.java index 59b077c16e..f906717bec 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceCount.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceCount.java @@ -19,36 +19,30 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + /** * JobInstanceCount * * @since 2022/2/28 22:20 */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "JobInstanceCount", description = "Job Instance Count Information") public class JobInstanceCount { + @ApiModelProperty(value = "Status", dataType = "String", example = "RUNNING", notes = "Status of the job instances") private String status; - private Integer counts; - - public JobInstanceCount() {} - - public JobInstanceCount(String status, Integer counts) { - this.status = status; - this.counts = counts; - } - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getCounts() { - return counts; - } - - public void setCounts(Integer counts) { - this.counts = counts; - } + @ApiModelProperty( + value = "Counts", + dataType = "Integer", + example = "5", + notes = "Number of job instances with the specified status") + private Integer counts; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceStatus.java b/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceStatus.java index 26d60995f8..16a0bbc3ac 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceStatus.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobInstanceStatus.java @@ -19,25 +19,102 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + /** * JobInstanceStatus * * @since 2022/2/28 22:25 */ +@ApiModel(value = "JobInstanceStatus", description = "Job Instance Status Information") public class JobInstanceStatus { + @ApiModelProperty(value = "All", dataType = "Integer", example = "10", notes = "Total count of job instances") private Integer all = 0; + + @ApiModelProperty( + value = "Initializing", + dataType = "Integer", + example = "2", + notes = "Count of job instances in the Initializing state") private Integer initializing = 0; + + @ApiModelProperty( + value = "Running", + dataType = "Integer", + example = "3", + notes = "Count of job instances in the Running state") private Integer running = 0; + + @ApiModelProperty( + value = "Finished", + dataType = "Integer", + example = "1", + notes = "Count of job instances in the Finished state") private Integer finished = 0; + + @ApiModelProperty( + value = "Failed", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Failed state") private Integer failed = 0; + + @ApiModelProperty( + value = "Canceled", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Canceled state") private Integer canceled = 0; + + @ApiModelProperty( + value = "Restarting", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Restarting state") private Integer restarting = 0; + + @ApiModelProperty( + value = "Created", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Created state") private Integer created = 0; + + @ApiModelProperty( + value = "Failing", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Failing state") private Integer failing = 0; + + @ApiModelProperty( + value = "Cancelling", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Cancelling state") private Integer cancelling = 0; + + @ApiModelProperty( + value = "Suspended", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Suspended state") private Integer suspended = 0; + + @ApiModelProperty( + value = "Reconciling", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Reconciling state") private Integer reconciling = 0; + + @ApiModelProperty( + value = "Unknown", + dataType = "Integer", + example = "0", + notes = "Count of job instances in the Unknown state") private Integer unknown = 0; public JobInstanceStatus() {} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobManagerConfiguration.java b/dinky-admin/src/main/java/org/dinky/data/model/JobManagerConfiguration.java index 38a6b45425..a3c1d2f65a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobManagerConfiguration.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobManagerConfiguration.java @@ -21,6 +21,8 @@ import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -29,13 +31,21 @@ * @create: 2022-06-26 10:53 */ @Data +@ApiModel(value = "JobManagerConfiguration", description = "Job Manager Configuration Information") public class JobManagerConfiguration { + @ApiModelProperty(value = "Metrics", dataType = "Map", notes = "Metrics related to the job manager") private Map metrics; + @ApiModelProperty( + value = "Job Manager Config", + dataType = "Map", + notes = "Configuration settings for the job manager") private Map jobManagerConfig; + @ApiModelProperty(value = "Job Manager Log", dataType = "String", notes = "Log information for the job manager") private String jobManagerLog; + @ApiModelProperty(value = "Job Manager Stdout", dataType = "String", notes = "Standard output for the job manager") private String jobManagerStdout; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobModelOverview.java b/dinky-admin/src/main/java/org/dinky/data/model/JobModelOverview.java index 41f025a402..324bb29327 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobModelOverview.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobModelOverview.java @@ -19,12 +19,21 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "JobModelOverview", description = "Job Model Overview Information") public class JobModelOverview { - /** BATCH_JOB_COUNT */ + + @ApiModelProperty(value = "Batch Job Count", dataType = "Integer", example = "5", notes = "Count of batch jobs") private Integer batchJobCount; - /** STREAMING_JOB_COUNT */ + + @ApiModelProperty( + value = "Streaming Job Count", + dataType = "Integer", + example = "3", + notes = "Count of streaming jobs") private Integer streamingJobCount; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobStatusOverView.java b/dinky-admin/src/main/java/org/dinky/data/model/JobStatusOverView.java index c7a62247bf..0484d20313 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobStatusOverView.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobStatusOverView.java @@ -19,14 +19,41 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "JobStatusOverView", description = "Job Status Overview Information") public class JobStatusOverView { + + @ApiModelProperty(value = "Job Running Count", dataType = "Integer", example = "5", notes = "Count of running jobs") private Integer jobRunningCount; + + @ApiModelProperty( + value = "Job Finished Count", + dataType = "Integer", + example = "3", + notes = "Count of finished jobs") private Integer jobFinishedCount; + + @ApiModelProperty( + value = "Job Recovered Count", + dataType = "Integer", + example = "2", + notes = "Count of recovered jobs") private Integer jobRecoveredCount; + + @ApiModelProperty(value = "Job Online Count", dataType = "Integer", example = "8", notes = "Count of online jobs") private Integer jobOnlineCount; + + @ApiModelProperty(value = "Job Offline Count", dataType = "Integer", example = "1", notes = "Count of offline jobs") private Integer jobOfflineCount; + + @ApiModelProperty( + value = "Job Error Count", + dataType = "Integer", + example = "0", + notes = "Count of jobs with errors") private Integer jobErrorCount; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/JobTypeOverView.java b/dinky-admin/src/main/java/org/dinky/data/model/JobTypeOverView.java index 00b52eccd0..b571ea0fe2 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/JobTypeOverView.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/JobTypeOverView.java @@ -19,14 +19,28 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "JobTypeOverView", description = "Job Type Overview Information") public class JobTypeOverView { - /** JOB TYPE eg: FlinkJar Mysql etc. */ + + @ApiModelProperty(value = "Job Type", dataType = "String", example = "FlinkJar", notes = "Type of the job") private String jobType; - /** JOB TYPE COUNT */ + + @ApiModelProperty( + value = "Job Type Count", + dataType = "Integer", + example = "5", + notes = "Count of jobs with the specified type") private Integer jobTypeCount; - /** JOB TYPE RATE */ + + @ApiModelProperty( + value = "Job Type Rate", + dataType = "Double", + example = "0.75", + notes = "Rate or percentage of jobs with the specified type") private Double rate; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/LdapUserIdentification.java b/dinky-admin/src/main/java/org/dinky/data/model/LdapUserIdentification.java index e61e4af452..cef4da86ee 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/LdapUserIdentification.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/LdapUserIdentification.java @@ -21,6 +21,8 @@ import javax.naming.directory.Attributes; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -28,9 +30,23 @@ @Data @NoArgsConstructor @AllArgsConstructor +@ApiModel(value = "LdapUserIdentification", description = "LDAP User Identification Information") public class LdapUserIdentification { + @ApiModelProperty( + value = "Absolute DN", + dataType = "String", + example = "cn=user,ou=people,dc=example,dc=com", + notes = "Absolute Distinguished Name (DN) of the LDAP user") private String absoluteDn; + + @ApiModelProperty( + value = "Relative DN", + dataType = "String", + example = "cn=user", + notes = "Relative Distinguished Name (DN) of the LDAP user") private String relativeDn; + + @ApiModelProperty(value = "Attributes", notes = "Attributes associated with the LDAP user") private Attributes attributes; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/LoginLog.java b/dinky-admin/src/main/java/org/dinky/data/model/LoginLog.java index 879d07f52e..854a96698a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/LoginLog.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/LoginLog.java @@ -36,49 +36,81 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "LoginLog", description = "Login Log Information") @TableName("dinky_sys_login_log") public class LoginLog implements Serializable { private static final long serialVersionUID = 1L; - /** 主键ID */ + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the login log") private Integer id; @NotNull( - message = "userId cannot be null", + message = "User ID cannot be null", groups = {Save.class}) + @ApiModelProperty(value = "User ID", dataType = "Integer", example = "1001", notes = "ID of the user who logged in") private Integer userId; @NotNull( - message = "username cannot be null", + message = "Username cannot be null", groups = {Save.class}) + @ApiModelProperty( + value = "Username", + dataType = "String", + example = "john_doe", + notes = "Username of the user who logged in") private String username; @NotNull( - message = "ip cannot be null", + message = "IP cannot be null", groups = {Save.class}) + @ApiModelProperty( + value = "IP", + dataType = "String", + example = "192.168.0.1", + notes = "IP address from which the login occurred") private String ip; + @ApiModelProperty( + value = "Login Type", + dataType = "Integer", + example = "1", + notes = "Type of login (if applicable)") private Integer loginType; + @ApiModelProperty(value = "Status", dataType = "Integer", example = "0", notes = "Status of the login") private Integer status; + @ApiModelProperty(value = "Message", dataType = "String", notes = "Additional message or details about the login") private String msg; + @ApiModelProperty(value = "Is Deleted", dataType = "Boolean", notes = "Flag indicating if the login log is deleted") private Boolean isDeleted; + @ApiModelProperty(value = "Access Time", dataType = "String", notes = "Timestamp indicating the time of login") private LocalDateTime accessTime; @TableField(fill = FieldFill.INSERT) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the login log") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the login log") private LocalDateTime updateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Menu.java b/dinky-admin/src/main/java/org/dinky/data/model/Menu.java index 7958463d66..a97ee3fefc 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Menu.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Menu.java @@ -38,12 +38,15 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; @Data +@ApiModel(value = "Menu", description = "Menu Information") @EqualsAndHashCode(callSuper = false) @NoArgsConstructor @AllArgsConstructor @@ -53,54 +56,87 @@ public class Menu implements Serializable { private static final long serialVersionUID = 1L; @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the menu") private Integer id; + @ApiModelProperty(value = "Parent ID", dataType = "Integer", example = "0", notes = "ID of the parent menu") private Integer parentId; @NotNull( message = "Name cannot be null", groups = {Save.class}) + @ApiModelProperty(value = "Name", dataType = "String", example = "Home", notes = "Name of the menu") private String name; @NotNull( - message = "path cannot be null", + message = "Path cannot be null", groups = {Save.class}) + @ApiModelProperty(value = "Path", dataType = "String", example = "/home", notes = "Path associated with the menu") private String path; @NotNull( - message = "component cannot be null", + message = "Component cannot be null", groups = {Save.class}) + @ApiModelProperty( + value = "Component", + dataType = "String", + example = "HomeComponent", + notes = "Component associated with the menu") private String component; @NotNull( - message = "perms cannot be null", + message = "Permissions cannot be null", groups = {Save.class}) + @ApiModelProperty( + value = "Permissions", + dataType = "String", + example = "menu:home:view", + notes = "Permissions required to access the menu") private String perms; + @ApiModelProperty(value = "Icon", dataType = "String", notes = "Icon associated with the menu") private String icon; + @ApiModelProperty(value = "Type", dataType = "String", notes = "Type of the menu") private String type; + @ApiModelProperty( + value = "Order Number", + dataType = "Double", + example = "1.0", + notes = "Order number for menu positioning") private Double orderNum; + @ApiModelProperty(value = "Display", dataType = "Boolean", notes = "Flag indicating if the menu is displayed") private boolean display; + @ApiModelProperty(value = "Note", dataType = "String", notes = "Additional notes or details about the menu") private String note; @TableField(fill = FieldFill.INSERT) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the menu") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the menu") private LocalDateTime updateTime; @TableField(exist = false) + @ApiModelProperty(value = "Children", dataType = "List", notes = "List of child menus") private List children = new ArrayList<>(); @TableField(exist = false) + @ApiModelProperty(value = "Root Menu", dataType = "Boolean", notes = "Flag indicating if the menu is a root menu") private boolean rootMenu; public boolean isRootMenu() { diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Metrics.java b/dinky-admin/src/main/java/org/dinky/data/model/Metrics.java index d3ba3bdb32..deafa3a64e 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Metrics.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Metrics.java @@ -27,47 +27,65 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @TableName dinky_metrics */ @TableName(value = "dinky_metrics") @Data +@ApiModel(value = "Metrics", description = "Metrics Information") public class Metrics extends Model { - /** */ + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the metrics") private Integer id; - /** */ + @ApiModelProperty(value = "Task ID", dataType = "Integer", example = "1001", notes = "ID of the associated task") private Integer taskId; - /** */ + @ApiModelProperty(value = "Vertices", dataType = "String", notes = "Vertices information") private String vertices; - /** */ + @ApiModelProperty(value = "Metrics Data", dataType = "String", notes = "Metrics data") private String metrics; - /** */ + @ApiModelProperty(value = "Position", dataType = "Integer", example = "1", notes = "Position of the metrics") private Integer position; - /** */ + @ApiModelProperty(value = "Show Type", dataType = "String", notes = "Type of display for the metrics") private String showType; - /** */ + @ApiModelProperty(value = "Show Size", dataType = "String", notes = "Size of display for the metrics") private String showSize; - /** */ + @ApiModelProperty(value = "Title", dataType = "String", notes = "Title for the metrics") private String title; - /** */ + @ApiModelProperty(value = "Layout Name", dataType = "String", notes = "Name of the layout") private String layoutName; - /** */ @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the metrics") private LocalDateTime createTime; - /** */ @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the metrics") private LocalDateTime updateTime; @TableField(exist = false) diff --git a/dinky-admin/src/main/java/org/dinky/data/model/OperateLog.java b/dinky-admin/src/main/java/org/dinky/data/model/OperateLog.java index 91d75e15f0..82bdd7517e 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/OperateLog.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/OperateLog.java @@ -27,53 +27,103 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @TableName("dinky_sys_operate_log") +@ApiModel(value = "OperateLog", description = "Operate Log Information") public class OperateLog implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Long", example = "1", notes = "Unique identifier for the operate log") private Long id; - /** 操作模块 */ + @ApiModelProperty( + value = "Module Name", + dataType = "String", + example = "User Management", + notes = "Name of the operation module") private String moduleName; + @ApiModelProperty( + value = "Business Type", + dataType = "Integer", + example = "1", + notes = "Type of business operation") private Integer businessType; - /** 请求方法 */ + @ApiModelProperty(value = "Method", dataType = "String", example = "GET", notes = "HTTP request method") private String method; - /** 请求方式 */ + @ApiModelProperty( + value = "Request Method", + dataType = "String", + example = "GET", + notes = "Type of HTTP request (e.g., GET, POST)") private String requestMethod; + @ApiModelProperty( + value = "Operate Name", + dataType = "String", + example = "Create User", + notes = "Name of the operation") private String operateName; + + @ApiModelProperty( + value = "Operate User ID", + dataType = "Integer", + example = "1001", + notes = "ID of the user who performed the operation") private Integer operateUserId; - /** 请求url */ + @ApiModelProperty( + value = "Operate URL", + dataType = "String", + example = "/api/user/create", + notes = "URL where the operation was performed") private String operateUrl; - /** 操作地址 */ + @ApiModelProperty( + value = "Operate IP", + dataType = "String", + example = "192.168.0.1", + notes = "IP address from which the operation was performed") private String operateIp; - /** 操作地点 */ + @ApiModelProperty( + value = "Operate Location", + dataType = "String", + example = "New York, USA", + notes = "Location where the operation was performed") private String operateLocation; - /** 请求参数 */ + @ApiModelProperty(value = "Operate Parameters", dataType = "String", notes = "Parameters of the operation request") private String operateParam; - /** 返回参数 */ + @ApiModelProperty(value = "JSON Result", dataType = "String", notes = "JSON result or response of the operation") private String jsonResult; - /** 操作状态(0正常 1异常) */ + @ApiModelProperty( + value = "Status", + dataType = "Integer", + example = "0", + notes = "Status of the operation (0 for normal, 1 for exception)") private Integer status; - /** 错误消息 */ + @ApiModelProperty( + value = "Error Message", + dataType = "String", + notes = "Error message if the operation encountered an exception") private String errorMsg; - /** 操作时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Operate Time", + dataType = "String", + notes = "Timestamp indicating the time of the operation") private LocalDateTime operateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Resources.java b/dinky-admin/src/main/java/org/dinky/data/model/Resources.java index 1b1f4da55f..e02c597cb1 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Resources.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Resources.java @@ -27,7 +27,14 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; - +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -35,41 +42,78 @@ @TableName(value = "dinky_resources") @Getter @Setter +@ApiModel(value = "Resources", description = "Resource Information") public class Resources extends Model { - /** key */ + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the resource") private Integer id; - /** file name */ + @ApiModelProperty(value = "File Name", dataType = "String", example = "example.txt", notes = "Name of the file") private String fileName; - /** */ + @ApiModelProperty(value = "Description", dataType = "String", notes = "Description or details about the resource") private String description; - /** user id */ + @ApiModelProperty( + value = "User ID", + dataType = "Integer", + example = "1001", + notes = "ID of the user who owns the resource") private Integer userId; - /** resource type,0:FILE,1:UDF */ + @ApiModelProperty( + value = "Resource Type", + dataType = "Integer", + example = "0", + notes = "Type of the resource (0 for FILE, 1 for UDF)") private Integer type; - /** resource size */ + @ApiModelProperty( + value = "Resource Size", + dataType = "Long", + example = "1024", + notes = "Size of the resource in bytes") private Long size; - /** */ + @ApiModelProperty( + value = "Parent ID", + dataType = "Integer", + example = "0", + notes = "ID of the parent resource (if applicable)") private Integer pid; - /** */ + @ApiModelProperty( + value = "Full Name", + dataType = "String", + example = "path/to/example.txt", + notes = "Full name or path of the resource") private String fullName; - /** */ + @ApiModelProperty( + value = "Is Directory", + dataType = "Boolean", + notes = "Flag indicating if the resource is a directory") private Boolean isDirectory; - /** create time */ @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the resource") private LocalDateTime createTime; - /** update time */ @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the resource") private LocalDateTime updateTime; @TableField(exist = false) diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Role.java b/dinky-admin/src/main/java/org/dinky/data/model/Role.java index ab8a5fbb60..54dea325d2 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Role.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Role.java @@ -27,7 +27,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -35,38 +42,62 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_role") +@ApiModel(value = "Role", description = "Role Information") public class Role implements Serializable { private static final long serialVersionUID = 6877230738922824958L; - /** id */ @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the role") private Integer id; - /** tenant id */ + @ApiModelProperty( + value = "Tenant ID", + dataType = "Integer", + example = "1001", + notes = "ID of the tenant associated with the role") private Integer tenantId; - /** role code */ + @ApiModelProperty( + value = "Role Code", + dataType = "String", + example = "ROLE_ADMIN", + notes = "Code representing the role") private String roleCode; - /** role name */ + @ApiModelProperty(value = "Role Name", dataType = "String", example = "Administrator", notes = "Name of the role") private String roleName; - /** is delete */ + @ApiModelProperty( + value = "Is Delete", + dataType = "Boolean", + notes = "Flag indicating if the role is marked as deleted") private Boolean isDelete; - /** note */ + @ApiModelProperty(value = "Note", dataType = "String", notes = "Additional notes or details about the role") private String note; - /** create time */ @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the role") private LocalDateTime createTime; - /** update time */ @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the role") private LocalDateTime updateTime; - /** tenant */ @TableField(exist = false) + @ApiModelProperty(value = "Tenant", dataType = "Tenant", notes = "Associated tenant information") private Tenant tenant; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/RoleMenu.java b/dinky-admin/src/main/java/org/dinky/data/model/RoleMenu.java index 802a4c456f..ee5ff38218 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/RoleMenu.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/RoleMenu.java @@ -27,33 +27,62 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @TableName("dinky_sys_role_menu") @Data +@ApiModel(value = "RoleMenu", description = "Role-Menu Relationship Information") public class RoleMenu implements Serializable { private static final long serialVersionUID = 1L; @TableId(type = IdType.AUTO) + @ApiModelProperty( + value = "ID", + dataType = "Integer", + example = "1", + notes = "Unique identifier for the role-menu relationship") private Integer id; + @ApiModelProperty( + value = "Role ID", + dataType = "Integer", + example = "1001", + notes = "ID of the role associated with the menu") private Integer roleId; + @ApiModelProperty( + value = "Menu ID", + dataType = "Integer", + example = "2001", + notes = "ID of the menu associated with the role") private Integer menuId; @TableField(fill = FieldFill.INSERT) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the role-menu relationship") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the role-menu relationship") private LocalDateTime updateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/RowPermissions.java b/dinky-admin/src/main/java/org/dinky/data/model/RowPermissions.java index 95101d1546..f620cabd93 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/RowPermissions.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/RowPermissions.java @@ -27,43 +27,87 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_row_permissions") +@ApiModel(value = "RowPermissions", description = "Row-Level Permissions Information") public class RowPermissions implements Serializable { private static final long serialVersionUID = 8676666963206334660L; - /** id */ @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty( + value = "ID", + dataType = "Integer", + example = "1", + notes = "Unique identifier for the row-level permissions") private Integer id; - /** role id */ + @ApiModelProperty( + value = "Role ID", + dataType = "Integer", + example = "1001", + notes = "ID of the role associated with the row permissions") private Integer roleId; - /** table_name */ + @ApiModelProperty( + value = "Table Name", + dataType = "String", + example = "users", + notes = "Name of the table to which the row permissions apply") private String tableName; - /** expression */ + @ApiModelProperty( + value = "Expression", + dataType = "String", + example = "user_id = 1001", + notes = "Expression defining the row-level permissions") private String expression; - /** create time */ @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the row-level permissions") private LocalDateTime createTime; - /** update time */ @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the row-level permissions") private LocalDateTime updateTime; - /** role code */ @TableField(exist = false) + @ApiModelProperty( + value = "Role Code", + dataType = "String", + example = "ROLE_ADMIN", + notes = "Code representing the associated role") private String roleCode; - /** role name */ @TableField(exist = false) + @ApiModelProperty( + value = "Role Name", + dataType = "String", + example = "Administrator", + notes = "Name of the associated role") private String roleName; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Savepoints.java b/dinky-admin/src/main/java/org/dinky/data/model/Savepoints.java index 6e1587de4c..e2b7c3289b 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Savepoints.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Savepoints.java @@ -31,7 +31,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; - +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -43,27 +50,49 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_savepoints") +@ApiModel(value = "Savepoints", description = "Savepoints Information") public class Savepoints implements Serializable { private static final long serialVersionUID = 115345627846554078L; @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the savepoint") private Integer id; + @ApiModelProperty( + value = "Tenant ID", + dataType = "Integer", + example = "1001", + notes = "ID of the tenant associated with the savepoint") private Integer tenantId; @NotNull( - message = "作业ID不能为空", + message = "Task ID cannot be null", groups = {Save.class}) + @ApiModelProperty( + value = "Task ID", + dataType = "Integer", + example = "2001", + notes = "ID of the job/task associated with the savepoint") private Integer taskId; + @ApiModelProperty(value = "Name", dataType = "String", notes = "Name of the savepoint") private String name; + @ApiModelProperty(value = "Type", dataType = "String", notes = "Type of the savepoint") private String type; + @ApiModelProperty(value = "Path", dataType = "String", notes = "Path to the savepoint") private String path; @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the savepoint") private LocalDateTime createTime; protected Serializable pkVal() { diff --git a/dinky-admin/src/main/java/org/dinky/data/model/SqlGeneration.java b/dinky-admin/src/main/java/org/dinky/data/model/SqlGeneration.java index 735c35f7e1..ce638a0f84 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/SqlGeneration.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/SqlGeneration.java @@ -19,46 +19,32 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + /** * SqlGeneration * * @since 2022/1/29 16:13 */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "SqlGeneration", description = "SQL Generation Information") public class SqlGeneration { + @ApiModelProperty( + value = "Flink SQL Create Statement", + dataType = "String", + notes = "Flink SQL statement for creating a table or view") private String flinkSqlCreate; - private String sqlSelect; - private String sqlCreate; - - public SqlGeneration() {} - - public SqlGeneration(String flinkSqlCreate, String sqlSelect, String sqlCreate) { - this.flinkSqlCreate = flinkSqlCreate; - this.sqlSelect = sqlSelect; - this.sqlCreate = sqlCreate; - } - - public String getFlinkSqlCreate() { - return flinkSqlCreate; - } - public void setFlinkSqlCreate(String flinkSqlCreate) { - this.flinkSqlCreate = flinkSqlCreate; - } - - public String getSqlSelect() { - return sqlSelect; - } - - public void setSqlSelect(String sqlSelect) { - this.sqlSelect = sqlSelect; - } - - public String getSqlCreate() { - return sqlCreate; - } + @ApiModelProperty(value = "SQL Select Statement", dataType = "String", notes = "SQL SELECT statement") + private String sqlSelect; - public void setSqlCreate(String sqlCreate) { - this.sqlCreate = sqlCreate; - } + @ApiModelProperty(value = "SQL Create Statement", dataType = "String", notes = "SQL statement for creating a table") + private String sqlCreate; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Statement.java b/dinky-admin/src/main/java/org/dinky/data/model/Statement.java index b4c8d14460..b6fb5681dc 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Statement.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Statement.java @@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,13 +36,21 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_task_statement") +@ApiModel(value = "Statement", description = "Statement Information") public class Statement implements Serializable { private static final long serialVersionUID = 1646348574144815792L; + @ApiModelProperty(value = "ID", dataType = "Integer", example = "1", notes = "Unique identifier for the statement") private Integer id; + @ApiModelProperty( + value = "Tenant ID", + dataType = "Integer", + example = "1001", + notes = "ID of the tenant associated with the statement") private Integer tenantId; + @ApiModelProperty(value = "SQL Statement", dataType = "String", notes = "SQL statement") private String statement; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/SysConfig.java b/dinky-admin/src/main/java/org/dinky/data/model/SysConfig.java index dd85df8ef8..1d80b2bcfb 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/SysConfig.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/SysConfig.java @@ -31,7 +31,14 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -43,24 +50,46 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_sys_config") +@ApiModel(value = "SysConfig", description = "System Configuration Information") public class SysConfig extends Model { private static final long serialVersionUID = 3769276772487490408L; @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty( + value = "ID", + dataType = "Integer", + example = "1", + notes = "Unique identifier for the system configuration") private Integer id; @NotNull( - message = "配置名不能为空", + message = "Configuration Name cannot be null", groups = {Save.class}) + @ApiModelProperty(value = "Configuration Name", dataType = "String", notes = "Name of the system configuration") private String name; @TableField(value = "`value`") + @ApiModelProperty(value = "Configuration Value", dataType = "String", notes = "Value of the system configuration") private String value; @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the system configuration") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the system configuration") private LocalDateTime updateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/SysToken.java b/dinky-admin/src/main/java/org/dinky/data/model/SysToken.java index b6bcc7399c..bebb71527d 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/SysToken.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/SysToken.java @@ -21,7 +21,6 @@ import java.io.Serializable; import java.time.LocalDateTime; -import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -30,11 +29,14 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -43,44 +45,113 @@ @AllArgsConstructor @NoArgsConstructor @TableName("dinky_sys_token") +@ApiModel(value = "SysToken", description = "System Token Information") public class SysToken implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty( + value = "ID", + dataType = "Integer", + example = "1", + notes = "Unique identifier for the system token") private Integer id; + @ApiModelProperty(value = "Token Value", dataType = "String", notes = "Value of the system token") private String tokenValue; + + @ApiModelProperty( + value = "User ID", + dataType = "Integer", + example = "1001", + notes = "ID of the user associated with the token") private Integer userId; + + @ApiModelProperty( + value = "Role ID", + dataType = "Integer", + example = "2001", + notes = "ID of the role associated with the token") private Integer roleId; + + @ApiModelProperty( + value = "Tenant ID", + dataType = "Integer", + example = "3001", + notes = "ID of the tenant associated with the token") private Integer tenantId; + @ApiModelProperty(value = "Expire Type", dataType = "Integer", example = "1", notes = "Type of token expiration") private Integer expireType; + @ApiModelProperty(value = "Expire Start Time", dataType = "Date", notes = "Start time for token expiration") private Date expireStartTime; + + @ApiModelProperty(value = "Expire End Time", dataType = "Date", notes = "End time for token expiration") private Date expireEndTime; @TableField(fill = FieldFill.INSERT) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Create Time", + dataType = "String", + notes = "Timestamp indicating the creation time of the token") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Update Time", + dataType = "String", + notes = "Timestamp indicating the last update time of the token") private LocalDateTime updateTime; + @ApiModelProperty( + value = "Creator", + dataType = "Integer", + example = "1001", + notes = "ID of the user who created the token") private Integer creator; + + @ApiModelProperty( + value = "Updator", + dataType = "Integer", + example = "1002", + notes = "ID of the user who last updated the token") private Integer updator; @TableField(exist = false) + @ApiModelProperty( + value = "User Name", + dataType = "String", + example = "John Doe", + notes = "Name of the associated user") private String userName; @TableField(exist = false) + @ApiModelProperty( + value = "Role Name", + dataType = "String", + example = "ROLE_ADMIN", + notes = "Name of the associated role") private String roleName; @TableField(exist = false) + @ApiModelProperty( + value = "Tenant Code", + dataType = "String", + example = "TENANT001", + notes = "Code representing the associated tenant") private String tenantCode; @TableField(exist = false) - private List expireTimeRange = new ArrayList<>(); + @ApiModelProperty( + value = "Expire Time Range", + dataType = "List", + notes = "List of timestamps indicating the time range for token expiration") + private List expireTimeRange; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Task.java b/dinky-admin/src/main/java/org/dinky/data/model/Task.java index 89d785e358..4e76e8a211 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Task.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Task.java @@ -37,6 +37,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; @@ -50,75 +52,169 @@ @EqualsAndHashCode(callSuper = false) @TableName("dinky_task") @Slf4j +@ApiModel(value = "Task", description = "Task Information") public class Task extends SuperEntity { private static final long serialVersionUID = 5988972129893667154L; + + @ApiModelProperty(value = "Dialect", dataType = "String", notes = "Dialect for the task") private String dialect; + @ApiModelProperty( + value = "Tenant ID", + dataType = "Integer", + example = "1001", + notes = "ID of the tenant associated with the task") private Integer tenantId; + @ApiModelProperty(value = "Type", dataType = "String", notes = "Type of the task") private String type; + @ApiModelProperty(value = "Check Point", dataType = "Integer", example = "1", notes = "Check point for the task") private Integer checkPoint; + @ApiModelProperty( + value = "Save Point Strategy", + dataType = "Integer", + example = "2", + notes = "Save point strategy for the task") private Integer savePointStrategy; + @ApiModelProperty(value = "Save Point Path", dataType = "String", notes = "Save point path for the task") private String savePointPath; + @ApiModelProperty(value = "Parallelism", dataType = "Integer", example = "4", notes = "Parallelism for the task") private Integer parallelism; + @ApiModelProperty( + value = "Fragment", + dataType = "Boolean", + example = "true", + notes = "Fragment option for the task") private Boolean fragment; + @ApiModelProperty( + value = "Statement Set", + dataType = "Boolean", + example = "false", + notes = "Statement set option for the task") private Boolean statementSet; + @ApiModelProperty( + value = "Batch Model", + dataType = "Boolean", + example = "true", + notes = "Batch model option for the task") private Boolean batchModel; + @ApiModelProperty( + value = "Cluster ID", + dataType = "Integer", + example = "2001", + notes = "ID of the cluster associated with the task") private Integer clusterId; + @ApiModelProperty( + value = "Cluster Configuration ID", + dataType = "Integer", + example = "3001", + notes = "ID of the cluster configuration associated with the task") private Integer clusterConfigurationId; + @ApiModelProperty( + value = "Database ID", + dataType = "Integer", + example = "4001", + notes = "ID of the database associated with the task") private Integer databaseId; + @ApiModelProperty( + value = "JAR ID", + dataType = "Integer", + example = "5001", + notes = "ID of the JAR associated with the task") private Integer jarId; + @ApiModelProperty( + value = "Environment ID", + dataType = "Integer", + example = "6001", + notes = "ID of the environment associated with the task") private Integer envId; + @ApiModelProperty( + value = "Alert Group ID", + dataType = "Integer", + example = "7001", + notes = "ID of the alert group associated with the task") private Integer alertGroupId; + + @ApiModelProperty(value = "Note", dataType = "String", notes = "Additional notes for the task") private String note; + @ApiModelProperty(value = "Step", dataType = "Integer", example = "1", notes = "Step for the task") private Integer step; + @ApiModelProperty( + value = "Job Instance ID", + dataType = "Integer", + example = "8001", + notes = "ID of the job instance associated with the task") private Integer jobInstanceId; + @ApiModelProperty( + value = "Version ID", + dataType = "Integer", + example = "9001", + notes = "ID of the version associated with the task") private Integer versionId; + @ApiModelProperty(value = "Statement", dataType = "String", notes = "SQL statement for the task") @TableField(exist = false) private String statement; + @ApiModelProperty(value = "Cluster Name", dataType = "String", notes = "Name of the associated cluster") @TableField(exist = false) private String clusterName; + @ApiModelProperty( + value = "Save Points", + dataType = "List", + notes = "List of save points associated with the task") @TableField(exist = false) private List savePoints; + @ApiModelProperty( + value = "Configuration JSON", + dataType = "TaskExtConfig", + notes = "Extended configuration in JSON format for the task") @TableField(typeHandler = TaskExtConfigTypeHandler.class, jdbcType = JdbcType.VARCHAR) private TaskExtConfig configJson; + @ApiModelProperty(value = "Path", dataType = "String", notes = "Path associated with the task") @TableField(exist = false) private String path; + @ApiModelProperty(value = "JAR Name", dataType = "String", notes = "Name of the associated JAR") @TableField(exist = false) private String jarName; + @ApiModelProperty( + value = "Cluster Configuration Name", + dataType = "String", + notes = "Name of the associated cluster configuration") @TableField(exist = false) private String clusterConfigurationName; + @ApiModelProperty(value = "Database Name", dataType = "String", notes = "Name of the associated database") @TableField(exist = false) private String databaseName; + @ApiModelProperty(value = "Environment Name", dataType = "String", notes = "Name of the associated environment") @TableField(exist = false) private String envName; + @ApiModelProperty(value = "Alert Group Name", dataType = "String", notes = "Name of the associated alert group") @TableField(exist = false) private String alertGroupName; diff --git a/dinky-admin/src/main/java/org/dinky/data/model/TaskContainerConfigInfo.java b/dinky-admin/src/main/java/org/dinky/data/model/TaskContainerConfigInfo.java index b521a2afda..c91598561a 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/TaskContainerConfigInfo.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/TaskContainerConfigInfo.java @@ -21,6 +21,8 @@ import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -29,13 +31,27 @@ * @create: 2022-06-27 11:41 */ @Data +@ApiModel(value = "TaskContainerConfigInfo", description = "Task Container Configuration Information") public class TaskContainerConfigInfo { + @ApiModelProperty( + value = "Metrics", + dataType = "Map", + notes = "Metrics related to the task container") private Map metrics; + @ApiModelProperty(value = "Task Manager Log", dataType = "String", notes = "Log file path for the task manager") private String taskManagerLog; + @ApiModelProperty( + value = "Task Manager Stdout", + dataType = "String", + notes = "Standard output file path for the task manager") private String taskManagerStdout; + @ApiModelProperty( + value = "Task Manager Thread Dump", + dataType = "String", + notes = "Thread dump information for the task manager") private String taskManagerThreadDump; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/TaskExtConfig.java b/dinky-admin/src/main/java/org/dinky/data/model/TaskExtConfig.java index f1832ff8fe..28c9796d92 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/TaskExtConfig.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/TaskExtConfig.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -37,10 +39,19 @@ @Data @AllArgsConstructor @NoArgsConstructor +@ApiModel(value = "TaskExtConfig", description = "Extended Configuration for Task") public class TaskExtConfig implements Serializable { - private static final long serialVersionUID = 1L; + @ApiModelProperty( + value = "UDF Config", + dataType = "TaskUdfConfig", + notes = "UDF (User-Defined Function) configuration for the task") private TaskUdfConfig udfConfig; + + @ApiModelProperty( + value = "Custom Config", + dataType = "List", + notes = "Custom configuration items for the task") private List customConfig = new ArrayList<>(); // 获取自定义配置的某个key的值 diff --git a/dinky-admin/src/main/java/org/dinky/data/model/TaskManagerConfiguration.java b/dinky-admin/src/main/java/org/dinky/data/model/TaskManagerConfiguration.java index c09f6c9fd0..bf5bbc9a7f 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/TaskManagerConfiguration.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/TaskManagerConfiguration.java @@ -19,6 +19,8 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -27,20 +29,57 @@ * @create: 2022-06-27 11:18 */ @Data +@ApiModel(value = "TaskManagerConfiguration", description = "Task Manager Configuration") public class TaskManagerConfiguration { + @ApiModelProperty(value = "Container ID", dataType = "String", notes = "ID of the task manager container") private String containerId; + + @ApiModelProperty(value = "Container Path", dataType = "String", notes = "Path of the task manager container") private String containerPath; + + @ApiModelProperty( + value = "Data Port", + dataType = "Integer", + example = "12345", + notes = "Data port for communication") private Integer dataPort; + + @ApiModelProperty( + value = "JMX Port", + dataType = "Integer", + example = "6789", + notes = "JMX (Java Management Extensions) port") private Integer jmxPort; + + @ApiModelProperty( + value = "Time Since Last Heartbeat", + dataType = "Long", + example = "60000", + notes = "Time elapsed since the last heartbeat") private Long timeSinceLastHeartbeat; + + @ApiModelProperty(value = "Slots Number", dataType = "Integer", example = "4", notes = "Number of slots available") private Integer slotsNumber; + + @ApiModelProperty(value = "Free Slots", dataType = "Integer", example = "2", notes = "Number of free slots") private Integer freeSlots; + @ApiModelProperty(value = "Total Resource", dataType = "String", notes = "Total resource information") private String totalResource; + + @ApiModelProperty(value = "Free Resource", dataType = "String", notes = "Free resource information") private String freeResource; + + @ApiModelProperty(value = "Hardware", dataType = "String", notes = "Hardware information") private String hardware; + + @ApiModelProperty(value = "Memory Configuration", dataType = "String", notes = "Memory configuration details") private String memoryConfiguration; + @ApiModelProperty( + value = "Task Container Config Info", + dataType = "TaskContainerConfigInfo", + notes = "Task container configuration information") private TaskContainerConfigInfo taskContainerConfigInfo; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/TaskUdfConfig.java b/dinky-admin/src/main/java/org/dinky/data/model/TaskUdfConfig.java index 819a46bf06..2fb3979c33 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/TaskUdfConfig.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/TaskUdfConfig.java @@ -22,17 +22,25 @@ import java.io.Serializable; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data +@ApiModel(value = "TaskUdfConfig", description = "UDF (User-Defined Function) Configuration for Task") @AllArgsConstructor @NoArgsConstructor public class TaskUdfConfig implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "Template ID", dataType = "Integer", example = "1", notes = "ID of the UDF template") private Integer templateId; + + @ApiModelProperty(value = "Select Keys", dataType = "List", notes = "List of select keys") private List selectKeys; + + @ApiModelProperty(value = "Class Name", dataType = "String", notes = "Name of the UDF class") private String className; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/TaskVersion.java b/dinky-admin/src/main/java/org/dinky/data/model/TaskVersion.java index 7eb9d94d03..1c5902ff2d 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/TaskVersion.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/TaskVersion.java @@ -24,12 +24,12 @@ import java.io.Serializable; import java.util.Date; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -41,44 +41,47 @@ @AllArgsConstructor @NoArgsConstructor @TableName(value = "dinky_task_version", autoResultMap = true) +@ApiModel(value = "TaskVersion", description = "Task Version Information") public class TaskVersion implements Serializable { - private static final long serialVersionUID = 1L; - /** ID */ - @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "ID", dataType = "Integer", notes = "Unique identifier for the task version") private Integer id; - /** tenant id */ + @ApiModelProperty(value = "Tenant ID", dataType = "Integer", notes = "ID of the tenant") private Integer tenantId; - /** 作业ID */ + @ApiModelProperty(value = "Task ID", dataType = "Integer", notes = "ID of the task associated with this version") @TableField(value = "task_id") private Integer taskId; - /** 版本ID */ + @ApiModelProperty(value = "Version ID", dataType = "Integer", notes = "ID of the version") @TableField(value = "version_id") private Integer versionId; - /** flink sql 内容 */ + @ApiModelProperty(value = "Flink SQL Content", dataType = "String", notes = "Flink SQL content") @TableField(value = "`statement`") private String statement; - /** 名称 */ + @ApiModelProperty(value = "Name", dataType = "String", notes = "Name of the version") @TableField(value = "`name`") private String name; - /** 方言 */ + @ApiModelProperty(value = "Dialect", dataType = "String", notes = "SQL dialect") @TableField(value = "dialect") private String dialect; - /** 类型 */ + @ApiModelProperty(value = "Type", dataType = "String", notes = "Type of the version") @TableField(value = "`type`") private String type; + @ApiModelProperty( + value = "Task Configure", + dataType = "TaskVersionConfigureDTO", + notes = "Task version configuration") @TableField(value = "task_configure", typeHandler = JacksonTypeHandler.class) private TaskVersionConfigureDTO taskConfigure; - /** 创建时间 */ + @ApiModelProperty(value = "Create Time", dataType = "Date", notes = "Timestamp when the version was created") @TableField(value = "create_time") private Date createTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/Tenant.java b/dinky-admin/src/main/java/org/dinky/data/model/Tenant.java index 40a090c749..26f53b0cc7 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/Tenant.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/Tenant.java @@ -28,6 +28,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -35,27 +37,42 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_tenant") +@ApiModel(value = "Tenant", description = "Tenant model") public class Tenant implements Serializable { private static final long serialVersionUID = -7782313413034278131L; /** id */ @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "Tenant ID", required = true, dataType = "Integer", example = "1") private Integer id; /** code */ + @ApiModelProperty(value = "Tenant Code", required = true, dataType = "String", example = "Default") private String tenantCode; /** note */ + @ApiModelProperty(value = "Tenant Note", required = true, dataType = "String", example = "Default") private String note; /** is delete */ + @ApiModelProperty(value = "Is Delete", required = true, dataType = "Boolean", example = "false") private Boolean isDelete; /** create time */ @TableField(fill = FieldFill.INSERT) + @ApiModelProperty( + value = "Create Time", + required = true, + dataType = "LocalDateTime", + example = "2022-02-24 19:58:00") private LocalDateTime createTime; /** update time */ @TableField(fill = FieldFill.INSERT_UPDATE) + @ApiModelProperty( + value = "Update Time", + required = true, + dataType = "LocalDateTime", + example = "2022-02-24 19:58:00") private LocalDateTime updateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/UDFTemplate.java b/dinky-admin/src/main/java/org/dinky/data/model/UDFTemplate.java index 62656d5034..21574eee65 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/UDFTemplate.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/UDFTemplate.java @@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,12 +36,15 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_udf_template") +@ApiModel(value = "UDFTemplate", description = "User-Defined Function Template") public class UDFTemplate extends SuperEntity { - private static final long serialVersionUID = 7027411154789682344L; - + @ApiModelProperty(value = "Code Type", dataType = "String", notes = "Type of the code") private String codeType; + @ApiModelProperty(value = "Function Type", dataType = "String", notes = "Type of the function") private String functionType; + + @ApiModelProperty(value = "Template Code", dataType = "String", notes = "Code template") private String templateCode; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/UploadFileRecord.java b/dinky-admin/src/main/java/org/dinky/data/model/UploadFileRecord.java index c1af2a6d85..1e38060a8b 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/UploadFileRecord.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/UploadFileRecord.java @@ -30,6 +30,7 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_upload_file_record") +@Deprecated public class UploadFileRecord extends SuperEntity { private static final long serialVersionUID = 3769285632787490408L; diff --git a/dinky-admin/src/main/java/org/dinky/data/model/User.java b/dinky-admin/src/main/java/org/dinky/data/model/User.java index d63c9be9be..8d61879d63 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/User.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/User.java @@ -32,7 +32,14 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; - +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -44,43 +51,66 @@ @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_user") +@ApiModel(value = "User", description = "User Information") public class User implements Serializable { - private static final long serialVersionUID = -1077801296270024204L; + @ApiModelProperty(value = "ID", dataType = "Integer", notes = "Unique identifier for the user") @TableId(value = "id", type = IdType.AUTO) private Integer id; + @ApiModelProperty(value = "Username", dataType = "String", required = true, notes = "User's username") @NotNull( - message = "用户名不能为空", + message = "Username cannot be null", groups = {Save.class}) private String username; + @ApiModelProperty(value = "Password", dataType = "String", notes = "User's password") private String password; + @ApiModelProperty(value = "Nickname", dataType = "String", notes = "User's nickname") private String nickname; + @ApiModelProperty(value = "User Type", dataType = "int", notes = "Type of the user") private int userType; + @ApiModelProperty(value = "Work Number", dataType = "String", notes = "User's work number") private String worknum; + @ApiModelProperty(value = "Avatar", dataType = "byte[]", notes = "User's avatar image") private byte[] avatar; + @ApiModelProperty(value = "Mobile", dataType = "String", notes = "User's mobile number") private String mobile; + @ApiModelProperty(value = "Enabled", dataType = "Boolean", notes = "Whether the user is enabled") private Boolean enabled; + @ApiModelProperty(value = "Is Delete", dataType = "Boolean", notes = "Whether the user is deleted") @TableLogic private Boolean isDelete; + @ApiModelProperty(value = "Create Time", dataType = "LocalDateTime", notes = "Timestamp when the user was created") @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; + @ApiModelProperty( + value = "Update Time", + dataType = "LocalDateTime", + notes = "Timestamp when the user was last updated") @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; + @ApiModelProperty(value = "Super Admin Flag", dataType = "Boolean", notes = "Whether the user is a super admin") private Boolean superAdminFlag; + @ApiModelProperty(value = "Tenant Admin Flag", dataType = "Boolean", notes = "Whether the user is a tenant admin") @TableField(exist = false) private Boolean tenantAdminFlag; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/UserRole.java b/dinky-admin/src/main/java/org/dinky/data/model/UserRole.java index 3c755a40f4..4aa49e3b68 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/UserRole.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/UserRole.java @@ -27,31 +27,51 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_user_role") +@ApiModel(value = "UserRole", description = "User Role Relationship") public class UserRole implements Serializable { - private static final long serialVersionUID = -6123386787317880485L; - /** id */ + + @ApiModelProperty(value = "ID", dataType = "Integer", notes = "Unique identifier for the user role relationship") @TableId(value = "id", type = IdType.AUTO) private Integer id; - /** user id */ + @ApiModelProperty(value = "User ID", dataType = "Integer", notes = "ID of the user associated with this role") private Integer userId; - /** role id */ + @ApiModelProperty(value = "Role ID", dataType = "Integer", notes = "ID of the role associated with this user") private Integer roleId; - /** create time */ + @ApiModelProperty( + value = "Create Time", + dataType = "LocalDateTime", + notes = "Timestamp when the user role relationship was created") @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; - /** update time */ + @ApiModelProperty( + value = "Update Time", + dataType = "LocalDateTime", + notes = "Timestamp when the user role relationship was last updated") @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/model/UserTenant.java b/dinky-admin/src/main/java/org/dinky/data/model/UserTenant.java index 29b7cb7028..9ecdcd663f 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/UserTenant.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/UserTenant.java @@ -46,34 +46,57 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = false) @TableName("dinky_user_tenant") +@ApiModel(value = "UserTenant", description = "User Tenant Relationship") public class UserTenant implements Serializable { - private static final long serialVersionUID = -6123386787317880405L; - /** id */ + @ApiModelProperty(value = "ID", dataType = "Integer", notes = "Unique identifier for the user tenant relationship") @TableId(value = "id", type = IdType.AUTO) private Integer id; - /** user id */ + @ApiModelProperty(value = "User ID", dataType = "Integer", notes = "ID of the user associated with this tenant") private Integer userId; - /** tenant id */ + @ApiModelProperty(value = "Tenant ID", dataType = "Integer", notes = "ID of the tenant associated with this user") private Integer tenantId; + @ApiModelProperty( + value = "Tenant Admin Flag", + dataType = "Boolean", + notes = "Whether the user is a tenant admin for this tenant") private Boolean tenantAdminFlag; - /** create time */ + @ApiModelProperty( + value = "Create Time", + dataType = "LocalDateTime", + notes = "Timestamp when the user tenant relationship was created") @TableField(fill = FieldFill.INSERT) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; - /** update time */ + @ApiModelProperty( + value = "Update Time", + dataType = "LocalDateTime", + notes = "Timestamp when the user tenant relationship was last updated") @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; } diff --git a/dinky-admin/src/main/java/org/dinky/data/params/AssignRoleParams.java b/dinky-admin/src/main/java/org/dinky/data/params/AssignRoleParams.java index 6bb83ce6ee..463d5cd261 100644 --- a/dinky-admin/src/main/java/org/dinky/data/params/AssignRoleParams.java +++ b/dinky-admin/src/main/java/org/dinky/data/params/AssignRoleParams.java @@ -21,11 +21,18 @@ import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** assign role params */ @Data +@ApiModel(value = "AssignRoleParams", description = "Parameters for Assigning Roles to a User") public class AssignRoleParams { - Integer userId; - List roleIds; + + @ApiModelProperty(value = "User ID", dataType = "Integer", notes = "ID of the user to assign roles to") + private Integer userId; + + @ApiModelProperty(value = "Role IDs", dataType = "List", notes = "List of role IDs to assign to the user") + private List roleIds; } diff --git a/dinky-admin/src/main/java/org/dinky/data/params/AssignUserToTenantParams.java b/dinky-admin/src/main/java/org/dinky/data/params/AssignUserToTenantParams.java index 83b8f9f00c..21925fa1c0 100644 --- a/dinky-admin/src/main/java/org/dinky/data/params/AssignUserToTenantParams.java +++ b/dinky-admin/src/main/java/org/dinky/data/params/AssignUserToTenantParams.java @@ -21,6 +21,8 @@ import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -29,7 +31,15 @@ @Data @AllArgsConstructor @NoArgsConstructor +@ApiModel(value = "AssignUserToTenantParams", description = "Parameters for Assigning Users to a Tenant") public class AssignUserToTenantParams { - Integer tenantId; - List userIds; + + @ApiModelProperty(value = "Tenant ID", dataType = "Integer", notes = "ID of the tenant to assign users to") + private Integer tenantId; + + @ApiModelProperty( + value = "User IDs", + dataType = "List", + notes = "List of user IDs to assign to the tenant") + private List userIds; } diff --git a/dinky-admin/src/main/java/org/dinky/data/params/GitProjectSortJarParams.java b/dinky-admin/src/main/java/org/dinky/data/params/GitProjectSortJarParams.java index 4967d54822..c0189835b9 100644 --- a/dinky-admin/src/main/java/org/dinky/data/params/GitProjectSortJarParams.java +++ b/dinky-admin/src/main/java/org/dinky/data/params/GitProjectSortJarParams.java @@ -24,10 +24,18 @@ import java.io.Serializable; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "GitProjectSortJarParams", description = "Parameters for Sorting JARs in a Git Project") public class GitProjectSortJarParams implements Serializable { - Integer projectId; - List jars; + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "Project ID", dataType = "Integer", notes = "ID of the Git project") + private Integer projectId; + + @ApiModelProperty(value = "JARs", dataType = "List", notes = "List of JARs to be sorted") + private List jars; } diff --git a/dinky-admin/src/main/java/org/dinky/data/properties/OssProperties.java b/dinky-admin/src/main/java/org/dinky/data/properties/OssProperties.java index 9387087c9f..9940f037c6 100644 --- a/dinky-admin/src/main/java/org/dinky/data/properties/OssProperties.java +++ b/dinky-admin/src/main/java/org/dinky/data/properties/OssProperties.java @@ -19,40 +19,65 @@ package org.dinky.data.properties; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @Getter @Setter +@ApiModel(value = "OssProperties", description = "Configuration Properties for Object Storage Service (OSS)") public class OssProperties { - /** 配置前缀 */ - public static final String PREFIX = "oss"; - - /** 是否启用 oss,默认为:true */ + @ApiModelProperty( + value = "Enable OSS", + dataType = "boolean", + notes = "Whether to enable OSS (Object Storage Service)", + example = "true") private boolean enable = true; - /** 对象存储服务的URL */ + @ApiModelProperty( + value = "OSS Endpoint", + dataType = "String", + notes = "URL of the Object Storage Service", + example = "https://example.oss-cn-hangzhou.aliyuncs.com") private String endpoint; - /** 自定义域名 */ + @ApiModelProperty( + value = "Custom Domain", + dataType = "String", + notes = "Custom domain for OSS", + example = "https://custom-domain.com") private String customDomain; - /** - * true path-style nginx 反向代理和S3默认支持 pathStyle {http://endpoint/bucketname} false supports - * virtual-hosted-style 阿里云等需要配置为 virtual-hosted-style 模式{http://bucketname.endpoint} - */ + @ApiModelProperty( + value = "Path Style Access", + dataType = "Boolean", + notes = "Path style access configuration (true for path-style, false for virtual-hosted-style)", + example = "true") private Boolean pathStyleAccess = true; - /** 区域 */ + @ApiModelProperty(value = "Region", dataType = "String", notes = "Region for OSS", example = "oss-cn-hangzhou") private String region; - /** Access key就像用户ID,可以唯一标识你的账户 */ + @ApiModelProperty( + value = "Access Key", + dataType = "String", + notes = "Access key for authentication", + example = "your-access-key") private String accessKey; - /** Secret key是你账户的密码 */ + @ApiModelProperty( + value = "Secret Key", + dataType = "String", + notes = "Secret key for authentication", + example = "your-secret-key") private String secretKey; - /** 默认的存储桶名称 */ + @ApiModelProperty( + value = "Default Bucket Name", + dataType = "String", + notes = "Default bucket name", + example = "my-bucket") private String bucketName; } diff --git a/dinky-admin/src/main/java/org/dinky/data/result/APIJobResult.java b/dinky-admin/src/main/java/org/dinky/data/result/APIJobResult.java index 761bb60ac2..93289964e9 100644 --- a/dinky-admin/src/main/java/org/dinky/data/result/APIJobResult.java +++ b/dinky-admin/src/main/java/org/dinky/data/result/APIJobResult.java @@ -24,6 +24,14 @@ import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -34,14 +42,58 @@ */ @Getter @Setter +@ApiModel(value = "APIJobResult", description = "Result of a Job from the API") public class APIJobResult { + @ApiModelProperty( + value = "Job Manager Address", + dataType = "String", + notes = "Address of the Job Manager", + example = "localhost:8081") private String jobManagerAddress; + + @ApiModelProperty( + value = "Job Status", + dataType = "Job.JobStatus", + notes = "Status of the Job", + example = "RUNNING") private Job.JobStatus status; + + @ApiModelProperty( + value = "Success Flag", + dataType = "boolean", + notes = "Whether the Job execution was successful", + example = "true") private boolean success; + + @ApiModelProperty(value = "Job ID", dataType = "String", notes = "ID of the Job", example = "job-12345") private String jobId; + + @ApiModelProperty( + value = "Error Message", + dataType = "String", + notes = "Error message if the Job execution failed", + example = "An error occurred while processing the Job") private String error; + + @ApiModelProperty( + value = "Start Time", + dataType = "LocalDateTime", + notes = "Start time of the Job execution", + example = "2023-09-15 10:00:00") + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startTime; + + @ApiModelProperty( + value = "End Time", + dataType = "LocalDateTime", + notes = "End time of the Job execution", + example = "2023-09-15 10:30:00") + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endTime; public APIJobResult( diff --git a/dinky-admin/src/main/java/org/dinky/data/result/PageResult.java b/dinky-admin/src/main/java/org/dinky/data/result/PageResult.java index 028d212f5d..dd57390369 100644 --- a/dinky-admin/src/main/java/org/dinky/data/result/PageResult.java +++ b/dinky-admin/src/main/java/org/dinky/data/result/PageResult.java @@ -22,6 +22,8 @@ import java.io.Serializable; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -36,13 +38,15 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ApiModel(value = "PageResult", description = "Page Result with Pagination Information") public class PageResult implements Serializable { - private static final long serialVersionUID = -5143774412936881374L; - /** 总数 */ + @ApiModelProperty(value = "Total Count", dataType = "Long", notes = "Total number of items") private Long count; - /** 是否成功:0 成功、1 失败 */ + + @ApiModelProperty(value = "Status Code", dataType = "int", notes = "0 for success, 1 for failure") private int code; - /** 当前页结果集 */ + + @ApiModelProperty(value = "Data", dataType = "List", notes = "Current page result set") private List data; } diff --git a/dinky-admin/src/main/java/org/dinky/data/result/ProTableResult.java b/dinky-admin/src/main/java/org/dinky/data/result/ProTableResult.java index 3eecae22f5..4d433494e0 100644 --- a/dinky-admin/src/main/java/org/dinky/data/result/ProTableResult.java +++ b/dinky-admin/src/main/java/org/dinky/data/result/ProTableResult.java @@ -22,6 +22,8 @@ import java.io.Serializable; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -36,17 +38,33 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ApiModel(value = "ProTableResult", description = "ProTableResult") public class ProTableResult implements Serializable { private static final long serialVersionUID = -6377431009117000655L; - /** 总数 */ + /** + * 总数 + */ + @ApiModelProperty(value = "Total Size", required = true, dataType = "Long", example = "200") private Long total; - /** 是否成功:true 成功、false 失败 */ + /** + * 是否成功:true 成功、false 失败 + */ + @ApiModelProperty(value = "Is Success", required = true, dataType = "Boolean", example = "true") private boolean success; - /** 当前页码 */ + /** + * 当前页码 + */ + @ApiModelProperty(value = "Current PageNum", required = true, dataType = "Integer", example = "1") private Integer current; - /** 当前每页记录数 */ + /** + * 当前每页记录数 + */ + @ApiModelProperty(value = "Current Page Size", required = true, dataType = "Integer", example = "10") private Integer pageSize; - /** 当前页结果集 */ + /** + * 当前页结果集 + */ + @ApiModelProperty(value = "Current Page Data", required = true, dataType = "List", example = "[]") private List data; } diff --git a/dinky-admin/src/main/java/org/dinky/data/result/Result.java b/dinky-admin/src/main/java/org/dinky/data/result/Result.java index 78d5d649d0..6f2775e888 100644 --- a/dinky-admin/src/main/java/org/dinky/data/result/Result.java +++ b/dinky-admin/src/main/java/org/dinky/data/result/Result.java @@ -26,6 +26,8 @@ import java.text.MessageFormat; import cn.hutool.core.date.DateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -38,17 +40,53 @@ @Data @NoArgsConstructor @AllArgsConstructor +@ApiModel(value = "Result", description = "Return Result") public class Result implements Serializable { /** result data */ + @ApiModelProperty( + value = "Result Data", + name = "datas", + dataType = "T", + required = true, + allowEmptyValue = true, + example = "[]") private T datas; - /** result code */ + + @ApiModelProperty( + value = "Result Code", + name = "code", + dataType = "Integer", + required = true, + example = "0", + notes = "0: success, 1: fail") private Integer code; - /** result msg */ + + @ApiModelProperty( + value = "Result Message", + name = "msg", + dataType = "String", + required = true, + example = "success", + notes = "success: success, fail: fail") private String msg; /** result time */ + @ApiModelProperty( + value = "Result Time", + name = "time", + dataType = "DateTime", + required = true, + example = "2021-05-03 19:56:00", + notes = "yyyy-MM-dd HH:mm:ss") private String time; /** result success */ + @ApiModelProperty( + value = "Result is Success", + name = "success", + dataType = "Boolean", + required = true, + example = "true", + notes = "true: success, false: fail") private boolean success; public Result(Integer code, String msg) { diff --git a/dinky-admin/src/main/java/org/dinky/data/result/StepResult.java b/dinky-admin/src/main/java/org/dinky/data/result/StepResult.java index 161181f809..22e0160efa 100644 --- a/dinky-admin/src/main/java/org/dinky/data/result/StepResult.java +++ b/dinky-admin/src/main/java/org/dinky/data/result/StepResult.java @@ -24,6 +24,8 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.json.JSONUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -39,15 +41,38 @@ @NoArgsConstructor @AllArgsConstructor @Builder +@ApiModel(value = "StepResult", description = "Result of a Step in a Process") public class StepResult implements Serializable { + @ApiModelProperty(value = "Current Step", dataType = "Integer", example = "1", notes = "The current step number") private Integer currentStep; - // 0.stepInfo 1.log 2.data 3.finish_info + + @ApiModelProperty( + value = "Type", + dataType = "Integer", + example = "0", + notes = "0 for stepInfo, 1 for log, 2 for data, 3 for finish_info") private Integer type; + + @ApiModelProperty( + value = "Data", + dataType = "Object", + example = "Step data goes here", + notes = "The data associated with the step") private Object data; - /** 2-success 1-process 0-failed */ + + @ApiModelProperty( + value = "Status", + dataType = "Integer", + example = "2", + notes = "2 for success, 1 for process, 0 for failed") private Integer status; + @ApiModelProperty( + value = "History Flag", + dataType = "Boolean", + example = "false", + notes = "Indicates whether this is a historical step result") private Boolean history; public static StepResult genHistoryLog(Integer currentStep, Integer status, String log) { diff --git a/dinky-admin/src/main/java/org/dinky/data/result/TaskOperatingResult.java b/dinky-admin/src/main/java/org/dinky/data/result/TaskOperatingResult.java index 432d173f63..aab5d71937 100644 --- a/dinky-admin/src/main/java/org/dinky/data/result/TaskOperatingResult.java +++ b/dinky-admin/src/main/java/org/dinky/data/result/TaskOperatingResult.java @@ -24,20 +24,51 @@ import org.dinky.data.enums.TaskOperatingStatus; import org.dinky.data.model.Task; +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @version 1.0 */ @Data -public class TaskOperatingResult { +@ApiModel(value = "TaskOperatingResult", description = "Result of a Task Operation") +public class TaskOperatingResult implements Serializable { + private static final long serialVersionUID = 1L; + @ApiModelProperty( + value = "Task", + dataType = "Task", + example = "{taskObject}", + notes = "The task associated with the operation") private Task task; + @ApiModelProperty( + value = "Status", + dataType = "TaskOperatingStatus", + example = "SUCCESS", + notes = "The status of the task operation") private TaskOperatingStatus status; + @ApiModelProperty( + value = "Code", + dataType = "Integer", + example = "0", + notes = "A code indicating the result of the operation") private Integer code; + @ApiModelProperty( + value = "Message", + dataType = "String", + example = "Operation successful", + notes = "A message providing additional information about the operation") private String message; + @ApiModelProperty( + value = "Savepoint Selection", + dataType = "TaskOperatingSavepointSelect", + example = "{savepointSelectObject}", + notes = "The savepoint selection information for the task operation") private TaskOperatingSavepointSelect taskOperatingSavepointSelect; public TaskOperatingResult(Task task) { diff --git a/dinky-admin/src/main/java/org/dinky/data/vo/CascaderVO.java b/dinky-admin/src/main/java/org/dinky/data/vo/CascaderVO.java index 1872b4a5a5..ff48920af7 100644 --- a/dinky-admin/src/main/java/org/dinky/data/vo/CascaderVO.java +++ b/dinky-admin/src/main/java/org/dinky/data/vo/CascaderVO.java @@ -22,8 +22,8 @@ import java.io.Serializable; import java.util.List; -import com.fasterxml.jackson.annotation.JsonInclude; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; import lombok.ToString; @@ -31,10 +31,20 @@ @Getter @Setter @ToString +@ApiModel(value = "CascaderVO", description = "Cascader Value Object") public class CascaderVO implements Serializable { + + private static final long serialVersionUID = 1L; // 添加serialVersionUID字段 + + @ApiModelProperty(value = "Value of the option", required = true, example = "1", dataType = "String") private String value; + + @ApiModelProperty(value = "Label of the option", required = true, example = "Option 1", dataType = "String") private String label; - @JsonInclude(JsonInclude.Include.NON_NULL) + @ApiModelProperty( + value = "Children options", + notes = "List of child CascaderVO objects", + dataType = "List") private List children; } diff --git a/dinky-admin/src/main/java/org/dinky/data/vo/MetaVo.java b/dinky-admin/src/main/java/org/dinky/data/vo/MetaVo.java index 5afd4145a2..536aaf17c5 100644 --- a/dinky-admin/src/main/java/org/dinky/data/vo/MetaVo.java +++ b/dinky-admin/src/main/java/org/dinky/data/vo/MetaVo.java @@ -19,11 +19,24 @@ package org.dinky.data.vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "MetaVo", description = "Metadata Value Object") public class MetaVo { - /** 设置该路由在侧边栏和面包屑中展示的名字 */ + + @ApiModelProperty( + value = "Name to display in sidebar and breadcrumb", + dataType = "String", + notes = "Name of the route to display in the user interface.", + example = "Home") private String title; - /** 设置该路由的图标,对应路径src/icons/svg */ + @ApiModelProperty( + value = "Icon for the route (e.g., 'home')", + dataType = "String", + notes = "Icon representing the route.", + example = "home") private String icon; public MetaVo() {} diff --git a/dinky-admin/src/main/java/org/dinky/data/vo/MetricsVO.java b/dinky-admin/src/main/java/org/dinky/data/vo/MetricsVO.java index 20f8519913..496e054d84 100644 --- a/dinky-admin/src/main/java/org/dinky/data/vo/MetricsVO.java +++ b/dinky-admin/src/main/java/org/dinky/data/vo/MetricsVO.java @@ -24,15 +24,38 @@ import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @Getter @Setter +@ApiModel(value = "MetricsVO", description = "Metrics Value Object") public class MetricsVO { + @ApiModelProperty(value = "Content of metrics", dataType = "Object", notes = "Content of the metrics data.") private Object content; + + @ApiModelProperty(value = "Total metrics", dataType = "MetricsTotal", notes = "Total metrics data.") private MetricsTotal metricsTotal; + + @ApiModelProperty(value = "Model name", dataType = "String", notes = "Name of the model.") private String model; + + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + @JsonSerialize(using = LocalDateTimeSerializer.class) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty( + value = "Timestamp of heartbeart", + dataType = "LocalDateTime", + notes = "Timestamp of the heartbeat data.", + example = "2023-09-15 14:30:00") private LocalDateTime heartTime; public FlinkMetricsIndicator.FlinkMetrics flinkContent() { diff --git a/dinky-admin/src/main/java/org/dinky/data/vo/RouterVo.java b/dinky-admin/src/main/java/org/dinky/data/vo/RouterVo.java index c3b3d3dcf7..8f779a5b37 100644 --- a/dinky-admin/src/main/java/org/dinky/data/vo/RouterVo.java +++ b/dinky-admin/src/main/java/org/dinky/data/vo/RouterVo.java @@ -23,35 +23,53 @@ import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + /** * 路由配置信息 * * @author ruoyi */ @JsonInclude(JsonInclude.Include.NON_EMPTY) +@ApiModel(value = "RouterVo", description = "Router Value Object") public class RouterVo { - /** 路由名字 */ + + @ApiModelProperty(value = "Route name", dataType = "String", notes = "Name of the route.") private String name; - /** 路由地址 */ + @ApiModelProperty(value = "Route path", dataType = "String", notes = "Path of the route.") private String path; - /** 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现 */ + @ApiModelProperty( + value = "Hide route", + dataType = "boolean", + notes = "Set to true to hide the route in the sidebar.", + example = "false") private boolean hidden; - /** 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 */ + @ApiModelProperty( + value = "Redirect path", + dataType = "String", + notes = + "Redirect path for the route. If 'noRedirect' is set, the route cannot be clicked in breadcrumb navigation.") private String redirect; - /** 组件地址 */ + @ApiModelProperty(value = "Component path", dataType = "String", notes = "Path to the route's component.") private String component; - /** 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 */ + @ApiModelProperty( + value = "Always show sub-routes", + dataType = "Boolean", + notes = + "Automatically becomes nested mode when more than one route is declared under a route, such as a component page.", + example = "true") private Boolean alwaysShow; - /** 其他元素 */ + @ApiModelProperty(value = "Metadata for the route", dataType = "MetaVo", notes = "Metadata for the route.") private MetaVo meta; - /** 子路由 */ + @ApiModelProperty(value = "Child routes", dataType = "List", notes = "Child routes of the route.") private List children; public String getName() { diff --git a/dinky-admin/src/main/java/org/dinky/data/vo/UserVo.java b/dinky-admin/src/main/java/org/dinky/data/vo/UserVo.java index d17d19c88d..47cb51a615 100644 --- a/dinky-admin/src/main/java/org/dinky/data/vo/UserVo.java +++ b/dinky-admin/src/main/java/org/dinky/data/vo/UserVo.java @@ -21,12 +21,23 @@ import org.dinky.data.model.User; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; @Data @AllArgsConstructor +@ApiModel(value = "UserVo", description = "User Value Object") public class UserVo { + + @ApiModelProperty(value = "User object", dataType = "User", notes = "User information.") private User user; + + @ApiModelProperty( + value = "Original password", + dataType = "String", + notes = "Original password of the user.", + example = "originalPassword123") private String originalPassword; } diff --git a/dinky-admin/src/main/java/org/dinky/mybatis/model/SuperEntity.java b/dinky-admin/src/main/java/org/dinky/mybatis/model/SuperEntity.java index 2045c5def4..eae56e9817 100644 --- a/dinky-admin/src/main/java/org/dinky/mybatis/model/SuperEntity.java +++ b/dinky-admin/src/main/java/org/dinky/mybatis/model/SuperEntity.java @@ -36,6 +36,8 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -46,30 +48,44 @@ */ @Setter @Getter +@ApiModel(value = "SuperEntity", description = "Super Base Entity", parent = Model.class) public class SuperEntity> extends Model { /** 主键ID */ @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "ID", required = true, dataType = "Integer", example = "1", notes = "Primary Key") private Integer id; @NotNull( message = "Name cannot be null", groups = {Save.class}) + @ApiModelProperty(value = "Name", required = true, dataType = "String", example = "Name") private String name; @NotNull( message = "Enabled cannot be null", groups = {Save.class}) + @ApiModelProperty(value = "Enabled", required = true, dataType = "Boolean", example = "true") private Boolean enabled; @TableField(fill = FieldFill.INSERT) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Create Time", + required = true, + dataType = "LocalDateTime", + example = "2021-05-28 00:00:00") private LocalDateTime createTime; @TableField(fill = FieldFill.INSERT_UPDATE) @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) + @ApiModelProperty( + value = "Update Time", + required = true, + dataType = "LocalDateTime", + example = "2021-05-28 00:00:00") private LocalDateTime updateTime; @Override diff --git a/dinky-admin/src/main/resources/application.properties b/dinky-admin/src/main/resources/application.properties index a2de9dc0d8..67812616f9 100644 --- a/dinky-admin/src/main/resources/application.properties +++ b/dinky-admin/src/main/resources/application.properties @@ -80,4 +80,4 @@ spring.messages.fallback-to-system-locale=true knife4j.enable=true knife4j.setting.enable-footer=false knife4j.setting.enable-footer-custom=true -knife4j.setting.footer-custom-content=Apache License 2.0 | Copyright \u00A9 #{date} Dinky, Inc. DataLinkDC. [\u9C81ICP\u590720001630\u53F7-2](https://beian.miit.gov.cn) +knife4j.setting.footer-custom-content=Apache License 2.0 | Copyright \u00A9 2023 Dinky, Inc. DataLinkDC. [\u9C81ICP\u590720001630\u53F7-2](https://beian.miit.gov.cn) diff --git a/dinky-admin/src/main/resources/application.yml b/dinky-admin/src/main/resources/application.yml index 1ea9abeab9..78c8d06f4f 100644 --- a/dinky-admin/src/main/resources/application.yml +++ b/dinky-admin/src/main/resources/application.yml @@ -145,6 +145,7 @@ sa-token: is-write-header: true # is read header is-read-header: true + token-name: token ################################################################################################################# diff --git a/dinky-common/pom.xml b/dinky-common/pom.xml index b6a5f45251..828ba1bf25 100644 --- a/dinky-common/pom.xml +++ b/dinky-common/pom.xml @@ -30,6 +30,10 @@ Dinky : Common + + com.github.xiaoymin + knife4j-openapi2-spring-boot-starter + com.fasterxml.jackson.core jackson-databind diff --git a/dinky-common/src/main/java/org/dinky/data/model/QueryData.java b/dinky-common/src/main/java/org/dinky/data/model/QueryData.java index 73ffc71550..f763ccf8c0 100644 --- a/dinky-common/src/main/java/org/dinky/data/model/QueryData.java +++ b/dinky-common/src/main/java/org/dinky/data/model/QueryData.java @@ -19,27 +19,75 @@ package org.dinky.data.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "QueryData", description = "Data for a SQL query") public class QueryData { + @ApiModelProperty( + value = "Unique identifier for the query", + dataType = "Integer", + example = "1", + notes = "Unique identifier for the query") private Integer id; + @ApiModelProperty( + value = "Name of the schema", + dataType = "String", + example = "public", + notes = "Name of the schema for the SQL query") private String schemaName; + @ApiModelProperty( + value = "Name of the table", + dataType = "String", + example = "users", + notes = "Name of the table for the SQL query") private String tableName; + @ApiModelProperty( + value = "SQL query string", + dataType = "String", + example = "SELECT * FROM users WHERE age > 30", + notes = "SQL query string") private String sql; + @ApiModelProperty(value = "Query options", dataType = "Option", notes = "Options for customizing the query") private Option option; @Data + @ApiModel(value = "Option", description = "Options for customizing a SQL query") public class Option { + @ApiModelProperty( + value = "WHERE clause for the query", + dataType = "String", + example = "age > 30", + notes = "WHERE clause for the SQL query") private String where; + + @ApiModelProperty( + value = "ORDER BY clause for the query", + dataType = "String", + example = "name ASC", + notes = "ORDER BY clause for the SQL query") private String order; + + @ApiModelProperty( + value = "Starting row for LIMIT", + dataType = "String", + example = "0", + notes = "Starting row number for the LIMIT clause") private String limitStart; + + @ApiModelProperty( + value = "Ending row for LIMIT", + dataType = "String", + example = "10", + notes = "Ending row number for the LIMIT clause") private String limitEnd; } } diff --git a/dinky-core/src/main/java/org/dinky/job/JobConfig.java b/dinky-core/src/main/java/org/dinky/job/JobConfig.java index a9d4080b14..117797ca97 100644 --- a/dinky-core/src/main/java/org/dinky/job/JobConfig.java +++ b/dinky-core/src/main/java/org/dinky/job/JobConfig.java @@ -33,6 +33,8 @@ import java.util.HashMap; import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -43,37 +45,167 @@ */ @Getter @Setter +@ApiModel(value = "JobConfig", description = "Configuration details of a job") public class JobConfig { - // flink run mode + @ApiModelProperty(value = "Flink run mode", dataType = "String", example = "batch", notes = "Flink run mode") private String type; - // task JobLifeCycle + + @ApiModelProperty(value = "Task JobLifeCycle", dataType = "Integer", example = "2", notes = "Task JobLifeCycle") private Integer step; + + @ApiModelProperty( + value = "Flag indicating whether to use the result", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use the result") private boolean useResult; + + @ApiModelProperty( + value = "Flag indicating whether to use change log", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use change log") private boolean useChangeLog; + + @ApiModelProperty( + value = "Flag indicating whether to use auto-cancel", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use auto-cancel") private boolean useAutoCancel; + + @ApiModelProperty( + value = "Flag indicating whether to use session", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use session") private boolean useSession; + + @ApiModelProperty( + value = "Session information", + dataType = "String", + example = "session-123", + notes = "Session information") private String session; + + @ApiModelProperty( + value = "Flag indicating whether to use remote execution", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use remote execution") private boolean useRemote; + + @ApiModelProperty(value = "Cluster ID", dataType = "Integer", example = "456", notes = "Cluster ID") private Integer clusterId; + + @ApiModelProperty( + value = "Cluster configuration ID", + dataType = "Integer", + example = "789", + notes = "Cluster configuration ID") private Integer clusterConfigurationId; + + @ApiModelProperty(value = "JAR file ID", dataType = "Integer", example = "101", notes = "JAR file ID") private Integer jarId; - private boolean isJarTask = false; + + @ApiModelProperty( + value = "Flag indicating whether it's a JAR task", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether it's a JAR task") + private boolean isJarTask; + + @ApiModelProperty( + value = "Job manager address", + dataType = "String", + example = "localhost:8081", + notes = "Job manager address") private String address; + + @ApiModelProperty(value = "Task ID", dataType = "Integer", example = "123", notes = "Task ID") private Integer taskId; + + @ApiModelProperty( + value = "List of JAR files", + dataType = "String[]", + example = "[\"file1.jar\", \"file2.jar\"]", + notes = "List of JAR files") private String[] jarFiles; + + @ApiModelProperty( + value = "List of Python files", + dataType = "String[]", + example = "[\"script1.py\", \"script2.py\"]", + notes = "List of Python files") private String[] pyFiles; + + @ApiModelProperty(value = "Name of the job", dataType = "String", example = "MyJob", notes = "Name of the job") private String jobName; + + @ApiModelProperty( + value = "Flag indicating whether to use SQL fragment", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use SQL fragment") private boolean useSqlFragment; + + @ApiModelProperty( + value = "Flag indicating whether to use statement set", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use statement set") private boolean useStatementSet; + + @ApiModelProperty( + value = "Flag indicating whether to use batch model", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use batch model") private boolean useBatchModel; + + @ApiModelProperty( + value = "Maximum number of rows", + dataType = "Integer", + example = "1000", + notes = "Maximum number of rows") private Integer maxRowNum; + + @ApiModelProperty( + value = "Checkpoint interval", + dataType = "Integer", + example = "5000", + notes = "Checkpoint interval") private Integer checkpoint; + + @ApiModelProperty(value = "Parallelism level", dataType = "Integer", example = "4", notes = "Parallelism level") private Integer parallelism; + + @ApiModelProperty(value = "Save point strategy", dataType = "SavePointStrategy", notes = "Save point strategy") private SavePointStrategy savePointStrategy; + + @ApiModelProperty( + value = "Path for save points", + dataType = "String", + example = "/savepoints", + notes = "Path for save points") private String savePointPath; + + @ApiModelProperty(value = "Gateway configuration", dataType = "GatewayConfig", notes = "Gateway configuration") private GatewayConfig gatewayConfig; + + @ApiModelProperty( + value = "Map of variables", + dataType = "Map", + example = "{\"var1\": \"value1\", \"var2\": \"value2\"}", + notes = "Map of variables") private Map variables; + + @ApiModelProperty( + value = "JSON configuration", + dataType = "Map", + example = "{\"config1\": \"value1\", \"config2\": \"value2\"}", + notes = "JSON configuration") private Map configJson; public JobConfig() { diff --git a/dinky-core/src/main/java/org/dinky/job/JobResult.java b/dinky-core/src/main/java/org/dinky/job/JobResult.java index 180ef56100..4ed1913de0 100644 --- a/dinky-core/src/main/java/org/dinky/job/JobResult.java +++ b/dinky-core/src/main/java/org/dinky/job/JobResult.java @@ -23,6 +23,8 @@ import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -33,19 +35,78 @@ */ @Getter @Setter +@ApiModel(value = "JobResult", description = "Result of a job execution") public class JobResult { + @ApiModelProperty(value = "Unique identifier for the job result", dataType = "Integer", example = "123") private Integer id; + + @ApiModelProperty( + value = "Configuration details of the job", + dataType = "JobConfig", + notes = "Configuration details of the job") private JobConfig jobConfig; + + @ApiModelProperty( + value = "Address of the job manager", + dataType = "String", + example = "localhost:8081", + notes = "Address of the job manager") private String jobManagerAddress; + + @ApiModelProperty(value = "Status of the job", dataType = "Job.JobStatus", notes = "Status of the job") private Job.JobStatus status; + + @ApiModelProperty( + value = "Flag indicating whether the job was successful", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether the job was successful") private boolean success; + + @ApiModelProperty( + value = "SQL statement executed by the job", + dataType = "String", + example = "SELECT * FROM table_name", + notes = "SQL statement executed by the job") private String statement; + + @ApiModelProperty( + value = "Unique identifier for the job", + dataType = "String", + example = "job_123", + notes = "Unique identifier for the job") private String jobId; + + @ApiModelProperty( + value = "Unique identifier for the job instance", + dataType = "Integer", + example = "456", + notes = "Unique identifier for the job instance") private Integer jobInstanceId; + + @ApiModelProperty( + value = "Error message in case of job failure", + dataType = "String", + example = "Job failed due to a timeout", + notes = "Error message in case of job failure") private String error; + + @ApiModelProperty(value = "Result data of the job", dataType = "IResult", notes = "Result data of the job") private IResult result; + + @ApiModelProperty( + value = "Start time of job execution", + dataType = "LocalDateTime", + example = "2023-09-15T10:30:00", + notes = "Start time of job execution") private LocalDateTime startTime; + + @ApiModelProperty( + value = "End time of job execution", + dataType = "LocalDateTime", + example = "2023-09-15T11:15:00", + notes = "End time of job execution") private LocalDateTime endTime; public JobResult() {} diff --git a/dinky-executor/src/main/java/org/dinky/executor/ExecutorSetting.java b/dinky-executor/src/main/java/org/dinky/executor/ExecutorSetting.java index 424a2db7dc..bb04231d4a 100644 --- a/dinky-executor/src/main/java/org/dinky/executor/ExecutorSetting.java +++ b/dinky-executor/src/main/java/org/dinky/executor/ExecutorSetting.java @@ -34,6 +34,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -44,6 +46,7 @@ */ @Setter @Getter +@ApiModel(value = "ExecutorSetting", description = "Executor settings for a job") public class ExecutorSetting { private static final Logger log = LoggerFactory.getLogger(ExecutorSetting.class); @@ -59,13 +62,53 @@ public class ExecutorSetting { public static final String CONFIG_CONST = "config"; private static final ObjectMapper mapper = new ObjectMapper(); + + @ApiModelProperty( + value = "Flag indicating whether to use batch model", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use batch model") private boolean useBatchModel; + + @ApiModelProperty( + value = "Checkpoint interval", + dataType = "Integer", + example = "5000", + notes = "Checkpoint interval") private Integer checkpoint; + + @ApiModelProperty(value = "Parallelism level", dataType = "Integer", example = "4", notes = "Parallelism level") private Integer parallelism; + + @ApiModelProperty( + value = "Flag indicating whether to use SQL fragment", + dataType = "boolean", + example = "true", + notes = "Flag indicating whether to use SQL fragment") private boolean useSqlFragment; + + @ApiModelProperty( + value = "Flag indicating whether to use statement set", + dataType = "boolean", + example = "false", + notes = "Flag indicating whether to use statement set") private boolean useStatementSet; + + @ApiModelProperty( + value = "Save point path", + dataType = "String", + example = "/savepoints", + notes = "Save point path") private String savePointPath; + + @ApiModelProperty(value = "Name of the job", dataType = "String", example = "MyJob", notes = "Name of the job") private String jobName; + + @ApiModelProperty( + value = "Map of configuration properties", + dataType = "Map", + example = "{\"config1\": \"value1\", \"config2\": \"value2\"}", + notes = "Map of configuration properties") private Map config; public ExecutorSetting(boolean useSqlFragment) { diff --git a/dinky-gateway/pom.xml b/dinky-gateway/pom.xml index bc1384f82b..297f125656 100644 --- a/dinky-gateway/pom.xml +++ b/dinky-gateway/pom.xml @@ -30,6 +30,10 @@ Dinky : Gateway + + com.github.xiaoymin + knife4j-openapi2-spring-boot-starter + io.fabric8 kubernetes-client diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/config/AppConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/config/AppConfig.java index a6f0cfb8d7..9b9d3a5c6f 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/config/AppConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/config/AppConfig.java @@ -19,8 +19,8 @@ package org.dinky.gateway.config; -import org.dinky.data.constant.CommonConstant; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -29,9 +29,27 @@ * @since 2021/11/3 21:55 */ @Data +@ApiModel(value = "AppConfig", description = "Configuration for the Flink application") public class AppConfig { + @ApiModelProperty( + value = "Path to user JAR file", + dataType = "String", + example = "/path/to/user/app.jar", + notes = "Path to the user's application JAR file") private String userJarPath; + + @ApiModelProperty( + value = "User JAR file parameters", + dataType = "String[]", + example = "[]", + notes = "Parameters to be passed to the user's application JAR file") private String[] userJarParas; - private String userJarMainAppClass = CommonConstant.DINKY_APP_MAIN_CLASS; + + @ApiModelProperty( + value = "Main application class in the JAR file", + dataType = "String", + example = "com.example.MyAppMainClass", + notes = "Fully qualified class name of the main application class in the JAR file") + private String userJarMainAppClass; } diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/config/ClusterConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/config/ClusterConfig.java index dc063bbcca..46ec26bbce 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/config/ClusterConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/config/ClusterConfig.java @@ -19,6 +19,8 @@ package org.dinky.gateway.config; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -29,11 +31,35 @@ */ @Getter @Setter +@ApiModel(value = "ClusterConfig", description = "Configuration for a Flink cluster") public class ClusterConfig { + @ApiModelProperty( + value = "Path to Flink configuration file", + dataType = "String", + example = "/opt/flink/conf/flink-conf.yaml", + notes = "Path to the Flink configuration file") private String flinkConfigPath; + + @ApiModelProperty( + value = "Path to Flink library directory", + dataType = "String", + example = "/opt/flink/lib", + notes = "Path to the Flink library directory") private String flinkLibPath; + + @ApiModelProperty( + value = "Path to YARN configuration file", + dataType = "String", + example = "/etc/hadoop/conf/yarn-site.xml", + notes = "Path to the YARN configuration file") private String yarnConfigPath; + + @ApiModelProperty( + value = "YARN application ID", + dataType = "String", + example = "application_12345_67890", + notes = "ID of the YARN application associated with the Flink cluster") private String appId; public ClusterConfig() {} diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/config/FlinkConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/config/FlinkConfig.java index c58be0356e..8d696d664d 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/config/FlinkConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/config/FlinkConfig.java @@ -33,6 +33,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -43,15 +45,63 @@ */ @Getter @Setter +@ApiModel(value = "FlinkConfig", description = "Configuration for a Flink job") public class FlinkConfig { + @ApiModelProperty( + value = "Name of the Flink job", + dataType = "String", + example = "MyFlinkJob", + notes = "Name of the Flink job") private String jobName; + + @ApiModelProperty( + value = "ID of the Flink job", + dataType = "String", + example = "job-12345", + notes = "ID of the Flink job") private String jobId; + + @ApiModelProperty( + value = "Flink version", + dataType = "String", + example = "1.13.2", + notes = "Version of Flink used for the job") private String flinkVersion; + + @ApiModelProperty( + value = "Action to perform (e.g., START, STOP)", + dataType = "String", + example = "START", + notes = "Action to perform for the Flink job") private ActionType action; + + @ApiModelProperty( + value = "Type of savepoint (e.g., TRIGGER, CANCEL)", + dataType = "String", + example = "TRIGGER", + notes = "Type of savepoint to create") private SavePointType savePointType; + + @ApiModelProperty( + value = "Path to savepoint", + dataType = "String", + example = "/path/to/savepoint", + notes = "Path to the savepoint") private String savePoint; + + @ApiModelProperty( + value = "Additional configuration properties", + dataType = "Map", + example = "{\"key1\":\"value1\",\"key2\":\"value2\"}", + notes = "Additional configuration properties for the job") private Map configuration = new HashMap<>(); + + @ApiModelProperty( + value = "List of Flink configuration properties", + dataType = "List>", + example = "[{\"key\":\"value\"},{\"key2\":\"value2\"}]", + notes = "List of Flink configuration properties") private List> flinkConfigList = new ArrayList<>(); private static final ObjectMapper mapper = new ObjectMapper(); diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java index cb5c7bf1e9..49f644a726 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/config/GatewayConfig.java @@ -27,6 +27,8 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.lang.Assert; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -37,14 +39,43 @@ */ @Getter @Setter +@ApiModel(value = "GatewayConfig", description = "Configuration for executing Flink jobs via a gateway") public class GatewayConfig { + @ApiModelProperty( + value = "ID of the task associated with the job", + dataType = "Integer", + example = "123", + notes = "ID of the task") private Integer taskId; + + @ApiModelProperty( + value = "Paths to the JAR files", + dataType = "String[]", + example = "[\"/path/to/jar1.jar\",\"/path/to/jar2.jar\"]", + notes = "Array of JAR file paths") private String[] jarPaths; + + @ApiModelProperty( + value = "Type of gateway (e.g., YARN, Kubernetes)", + dataType = "GatewayType", + example = "YARN", + notes = "Type of the gateway") private GatewayType type; + + @ApiModelProperty( + value = "Cluster configuration for executing the job", + dataType = "ClusterConfig", + notes = "Cluster configuration") private ClusterConfig clusterConfig; + + @ApiModelProperty(value = "Flink job configuration", dataType = "FlinkConfig", notes = "Flink job configuration") private FlinkConfig flinkConfig; + + @ApiModelProperty(value = "Application configuration", dataType = "AppConfig", notes = "Application configuration") private AppConfig appConfig; + + @ApiModelProperty(value = "Kubernetes configuration", dataType = "K8sConfig", notes = "Kubernetes configuration") private K8sConfig kubernetesConfig; public GatewayConfig() { diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/config/K8sConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/config/K8sConfig.java index 874e4db80e..2a8d31055d 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/config/K8sConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/config/K8sConfig.java @@ -22,13 +22,46 @@ import java.util.HashMap; import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data +@ApiModel(value = "K8sConfig", description = "Configuration for running Flink jobs on Kubernetes") public class K8sConfig { + + @ApiModelProperty( + value = "Kubernetes configuration", + dataType = "Map", + example = "{\"key1\": \"value1\", \"key2\": \"value2\"}", + notes = "Kubernetes configuration properties") private Map configuration = new HashMap<>(); + + @ApiModelProperty( + value = "Docker configuration for Kubernetes pods", + dataType = "Map", + example = "{\"key1\": \"value1\", \"key2\": 123}", + notes = "Docker configuration properties for pods") private Map dockerConfig = new HashMap<>(); + + @ApiModelProperty( + value = "Pod template for Flink jobs", + dataType = "String", + example = "flink-pod-template.yaml", + notes = "YAML file containing the pod template for Flink jobs") private String podTemplate; + + @ApiModelProperty( + value = "JobManager pod template for Flink jobs", + dataType = "String", + example = "jm-pod-template.yaml", + notes = "YAML file containing the pod template for the JobManager in Flink jobs") private String jmPodTemplate; + + @ApiModelProperty( + value = "TaskManager pod template for Flink jobs", + dataType = "String", + example = "tm-pod-template.yaml", + notes = "YAML file containing the pod template for TaskManagers in Flink jobs") private String tmPodTemplate; } diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java b/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java index b43f61a46b..2749377c70 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java @@ -25,16 +25,45 @@ import org.dinky.gateway.config.K8sConfig; import org.dinky.gateway.enums.GatewayType; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; /** @since */ @Getter @Setter +@ApiModel(value = "FlinkClusterConfig", description = "Configuration for a Flink cluster") public class FlinkClusterConfig { + + @ApiModelProperty( + value = "Gateway Type", + dataType = "GatewayType", + example = "REST", + notes = "The type of gateway for the Flink cluster") private GatewayType type; + + @ApiModelProperty( + value = "Cluster Configuration", + dataType = "ClusterConfig", + notes = "Configuration settings for the Flink cluster") private ClusterConfig clusterConfig; + + @ApiModelProperty( + value = "Flink Configuration", + dataType = "FlinkConfig", + notes = "Configuration settings specific to Flink") private FlinkConfig flinkConfig; + + @ApiModelProperty( + value = "Application Configuration", + dataType = "AppConfig", + notes = "Configuration settings for the application") private AppConfig appConfig; + + @ApiModelProperty( + value = "Kubernetes Configuration", + dataType = "K8sConfig", + notes = "Configuration settings for Kubernetes (if applicable)") private K8sConfig kubernetesConfig; } diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/model/JobInfo.java b/dinky-gateway/src/main/java/org/dinky/gateway/model/JobInfo.java index 01c94ac823..585681ed85 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/model/JobInfo.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/model/JobInfo.java @@ -19,6 +19,8 @@ package org.dinky.gateway.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -29,10 +31,28 @@ */ @Getter @Setter +@ApiModel(value = "JobInfo", description = "Information about a job") public class JobInfo { + @ApiModelProperty( + value = "Job ID", + dataType = "String", + example = "job123", + notes = "Unique identifier for the job") private String jobId; + + @ApiModelProperty( + value = "Save Point", + dataType = "String", + example = "s3://checkpoint/savepoint-123", + notes = "Save point path for the job") private String savePoint; + + @ApiModelProperty( + value = "Job Status", + dataType = "JobStatus", + example = "RUNNING", + notes = "Current status of the job") private JobStatus status; public JobInfo(String jobId) { diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java index a933b849ef..b4989989e3 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/KubernetesResult.java @@ -24,15 +24,36 @@ import java.time.LocalDateTime; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + /** * KubernetesResult * * @since 2021/12/26 15:06 */ +@ApiModel(value = "KubernetesResult", description = "Result of Kubernetes operation") public class KubernetesResult extends AbstractGatewayResult { + @ApiModelProperty( + value = "Cluster ID", + dataType = "String", + example = "cluster123", + notes = "Unique identifier for the Kubernetes cluster") private String clusterId; + + @ApiModelProperty( + value = "Web URL", + dataType = "String", + example = "https://k8s-dashboard.example.com", + notes = "URL for accessing the Kubernetes web dashboard") private String webURL; + + @ApiModelProperty( + value = "Job IDs", + dataType = "List", + example = "[\"job1\", \"job2\"]", + notes = "List of job identifiers associated with the Kubernetes cluster") private List jids; public KubernetesResult(GatewayType type, LocalDateTime startTime) { diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java index 3e422835bd..0d8508ee3c 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/SavePointResult.java @@ -25,6 +25,8 @@ import java.time.LocalDateTime; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -35,9 +37,22 @@ */ @Getter @Setter +@ApiModel(value = "SavePointResult", description = "Result of SavePoint operation") public class SavePointResult extends AbstractGatewayResult { + @ApiModelProperty( + value = "Application ID", + dataType = "String", + example = "app123", + notes = "Unique identifier for the application") private String appId; + + @ApiModelProperty( + value = "List of Job Information", + dataType = "List", + example = + "[{\"jobId\":\"job1\",\"savePoint\":\"savepoint1\",\"status\":\"RUNNING\"},{\"jobId\":\"job2\",\"savePoint\":\"savepoint2\",\"status\":\"COMPLETED\"}]", + notes = "List of job information associated with the SavePoint operation") private List jobInfos; public SavePointResult(GatewayType type, LocalDateTime startTime) { diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/TestResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/TestResult.java index b79c703da3..22cb46f64c 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/TestResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/TestResult.java @@ -19,14 +19,29 @@ package org.dinky.gateway.result; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + /** * TestResult * * @since 2021/11/27 16:12 */ +@ApiModel(value = "TestResult", description = "Result of a test operation") public class TestResult { + @ApiModelProperty( + value = "Availability status", + dataType = "boolean", + example = "true", + notes = "Indicates whether the test is available") private boolean isAvailable; + + @ApiModelProperty( + value = "Error message", + dataType = "String", + example = "An error occurred", + notes = "Error message if the test encountered an issue") private String error; public boolean isAvailable() { diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java b/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java index c0737fedab..52fe6ecf71 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/result/YarnResult.java @@ -24,15 +24,36 @@ import java.time.LocalDateTime; import java.util.List; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + /** * YarnResult * * @since 2021/10/29 */ +@ApiModel(value = "YarnResult", description = "Result of a YARN operation") public class YarnResult extends AbstractGatewayResult { + @ApiModelProperty( + value = "YARN application ID", + dataType = "String", + example = "application_12345_67890", + notes = "ID of the YARN application") private String appId; + + @ApiModelProperty( + value = "YARN application web URL", + dataType = "String", + example = "http://yarn-cluster:8088", + notes = "URL to access the YARN application in the web UI") private String webURL; + + @ApiModelProperty( + value = "List of job IDs", + dataType = "List", + example = "[\"job1\", \"job2\"]", + notes = "List of job IDs associated with the YARN application") private List jids; public YarnResult(GatewayType type, LocalDateTime startTime) { diff --git a/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/DriverConfig.java b/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/DriverConfig.java index ffff49d4df..d115f25de0 100644 --- a/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/DriverConfig.java +++ b/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/DriverConfig.java @@ -23,6 +23,8 @@ import java.util.Map; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; @@ -33,14 +35,56 @@ */ @Getter @Setter +@ApiModel(value = "DriverConfig", description = "Configuration for the driver component") public class DriverConfig { + @ApiModelProperty( + value = "Name of the driver", + dataType = "String", + example = "MyDriver", + notes = "Name of the driver component") private String name; + + @ApiModelProperty( + value = "Type of the driver", + dataType = "String", + example = "Flink", + notes = "Type of the driver component") private String type; + + @ApiModelProperty( + value = "IP address of the driver", + dataType = "String", + example = "192.168.1.100", + notes = "IP address of the driver component") private String ip; + + @ApiModelProperty( + value = "Port number for communication", + dataType = "Integer", + example = "8081", + notes = "Port number for communication with the driver") private Integer port; + + @ApiModelProperty( + value = "URL for the driver", + dataType = "String", + example = "http://192.168.1.100:8081", + notes = "URL for accessing the driver component") private String url; + + @ApiModelProperty( + value = "Username for authentication", + dataType = "String", + example = "user123", + notes = "Username for authentication (if applicable)") private String username; + + @ApiModelProperty( + value = "Password for authentication", + dataType = "String", + example = "password123", + notes = "Password for authentication (if applicable)") private String password; public DriverConfig() {} diff --git a/dinky-metadata/pom.xml b/dinky-metadata/pom.xml index d3c25b304a..8af8c9a119 100644 --- a/dinky-metadata/pom.xml +++ b/dinky-metadata/pom.xml @@ -43,4 +43,11 @@ dinky-metadata-presto + + + com.github.xiaoymin + knife4j-openapi2-spring-boot-starter + + +