Unverified Commit e9762b03 authored by zhangyongtian's avatar zhangyongtian Committed by GitHub

optimization some code (#2379)

parent 96ce0252
......@@ -27,7 +27,6 @@ import org.dinky.data.model.AlertGroup;
import org.dinky.data.result.ProTableResult;
import org.dinky.data.result.Result;
import org.dinky.service.AlertGroupService;
import org.dinky.service.AlertHistoryService;
import java.util.List;
......@@ -59,7 +58,6 @@ import lombok.extern.slf4j.Slf4j;
public class AlertGroupController {
private final AlertGroupService alertGroupService;
private final AlertHistoryService alertHistoryService;
/**
* save or update alert Group
......
......@@ -27,7 +27,6 @@ import org.dinky.data.model.Cluster;
import org.dinky.data.result.ProTableResult;
import org.dinky.data.result.Result;
import org.dinky.service.ClusterInstanceService;
import org.dinky.service.JobInstanceService;
import java.util.List;
......@@ -60,7 +59,6 @@ import lombok.extern.slf4j.Slf4j;
public class ClusterInstanceController {
private final ClusterInstanceService clusterInstanceService;
private final JobInstanceService jobInstanceService;
/**
* added or updated cluster instance
......
......@@ -33,7 +33,6 @@ import org.dinky.data.result.Result;
import org.dinky.explainer.lineage.LineageResult;
import org.dinky.job.BuildConfiguration;
import org.dinky.service.JobInstanceService;
import org.dinky.service.TaskService;
import java.util.HashSet;
import java.util.Set;
......@@ -66,9 +65,7 @@ import lombok.extern.slf4j.Slf4j;
@RequestMapping("/api/jobInstance")
@RequiredArgsConstructor
public class JobInstanceController {
private final JobInstanceService jobInstanceService;
private final TaskService taskService;
/**
* 动态查询列表
......
......@@ -50,10 +50,8 @@ public class RoleMenuController {
/**
* assign menus to role
*
* @param roleId
* @param menus
* @param assignMenuToRoleDto
* @return {@link Result} with {@link Void}
* @throws Exception {@link Exception}
*/
@PostMapping("assignMenuToRole")
@Log(title = "Assign Menus to Role ", businessType = BusinessType.GRANT)
......
......@@ -100,7 +100,7 @@ public class SysConfigController {
example = "sys")
public Result<List<Configuration<?>>> getOneTypeByKey(@RequestParam("type") String type) {
Map<String, List<Configuration<?>>> all = sysConfigService.getAll();
// 过滤出 以 type 开头的配置 返回 list
// Filter out configurations starting with type and return a list
List<Configuration<?>> configList = all.entrySet().stream()
.filter(entry -> entry.getKey().startsWith(type))
.map(Map.Entry::getValue)
......
......@@ -46,7 +46,7 @@ public interface AlertGroupService extends ISuperService<AlertGroup> {
* alert group enable or disable by id
*
* @param id
* @return
* @return {@link Boolean}
*/
Boolean modifyAlertGroupStatus(Integer id);
......
......@@ -33,7 +33,14 @@ public interface AlertHistoryService extends ISuperService<AlertHistory> {
* @param alertGroupId {@link Integer}
* @return {@link Boolean}
*/
@Deprecated
Boolean deleteByAlertGroupId(Integer alertGroupId);
/**
* Query alert history records by job instance ID.
*
* @param jobInstanceId The ID of the job instance for which to query alert history records.
* @return A list of {@link AlertHistory} objects representing the alert history records for the specified job instance.
*/
List<AlertHistory> queryAlertHistoryRecordByJobInstanceId(Integer jobInstanceId);
}
......@@ -33,27 +33,102 @@ import java.util.List;
*/
public interface CatalogueService extends ISuperService<Catalogue> {
/**
* Get the catalogue tree
*
* @return A list of {@link Catalogue} objects representing the catalogue tree.
*/
List<Catalogue> getCatalogueTree();
/**
* Find a catalogue by its parent ID and name.
*
* @param parentId The ID of the parent catalogue to find the child catalogue for.
* @param name The name of the catalogue to find.
* @return A {@link Catalogue} object representing the found catalogue.
*/
Catalogue findByParentIdAndName(Integer parentId, String name);
/**
* Save or update a catalogue and its tasks.
*
* @param catalogueTaskDTO A {@link CatalogueTaskDTO} object representing the updated catalogue and tasks.
* @return A {@link Catalogue} object representing the saved or updated catalogue.
*/
Catalogue saveOrUpdateCatalogueAndTask(CatalogueTaskDTO catalogueTaskDTO);
/**
* Create a catalogue and file task based on the given catalogue task DTO.
*
* @param catalogueTaskDTO A {@link CatalogueTaskDTO} object representing the catalogue task to create.
* @param ment The name of the catalogue to create.
* @return A boolean value indicating whether the catalogue was created successfully.
*/
Catalogue createCatalogAndFileTask(CatalogueTaskDTO catalogueTaskDTO, String ment);
/**
* Check if the given catalogue needs to be renamed.
*
* @param catalogue A {@link Catalogue} object representing the catalogue to check.
* @return A boolean value indicating whether the catalogue needs to be renamed.
*/
boolean toRename(Catalogue catalogue);
/**
* Move the given catalogue from one parent ID to another.
*
* @param originCatalogueId The ID of the catalogue to move.
* @param targetParentId The ID of the new parent for the catalogue.
* @return A boolean value indicating whether the catalogue was moved successfully.
*/
boolean moveCatalogue(Integer originCatalogueId, Integer targetParentId);
/**
* Copy a task from the given catalogue.
*
* @param catalogue A {@link Catalogue} object representing the catalogue to copy the task from.
* @return A boolean value indicating whether the task was copied successfully.
*/
boolean copyTask(Catalogue catalogue);
/**
* Add dependent catalogues for the given catalogue names.
*
* @param catalogueNames An array of strings representing the names of the catalogues to add as dependents.
* @return An integer representing the ID of the added catalogue.
*/
Integer addDependCatalogue(String[] catalogueNames);
/**
* Traverse the file system based on the given source path and catalogue.
*
* @param sourcePath The path of the source directory to traverse.
* @param catalog A {@link Catalogue} object representing the catalogue to use for filtering files.
*/
void traverseFile(String sourcePath, Catalogue catalog);
/**
* Get the catalogue with the given parent ID and name.
*
* @param parentId The ID of the parent catalogue to find the child catalogue for.
* @param name The name of the catalogue to find.
* @return A {@link Catalogue} object representing the found catalogue.
*/
Catalogue getCatalogue(Integer parentId, String name);
/**
* Delete a catalogue by its ID.
*
* @param catalogueId The ID of the catalogue to delete.
* @return A {@link Result<Void>} object representing the result of the deletion operation.
*/
Result<Void> deleteCatalogueById(Integer catalogueId);
/**
* Save, update, or rename a catalogue based on the given parameters.
*
* @param catalogue A {@link Catalogue} object representing the catalogue to save, update, or rename.
* @return A boolean value indicating whether the operation was successful.
*/
Boolean saveOrUpdateOrRename(Catalogue catalogue);
}
......@@ -34,13 +34,42 @@ import java.util.List;
*/
public interface ClusterConfigurationService extends ISuperService<ClusterConfiguration> {
/**
* Get the cluster configuration with the given ID.
*
* @param id The ID of the cluster configuration to get.
* @return A {@link ClusterConfiguration} object representing the found cluster configuration.
*/
ClusterConfiguration getClusterConfigById(Integer id);
/**
* List all enabled cluster configurations.
*
* @return A list of {@link ClusterConfiguration} objects representing all enabled cluster configurations.
*/
List<ClusterConfiguration> listEnabledAllClusterConfig();
/**
* Get the Flink cluster configuration with the given ID.
*
* @param id The ID of the Flink cluster configuration to get.
* @return A {@link FlinkClusterConfig} object representing the found Flink cluster configuration.
*/
FlinkClusterConfig getFlinkClusterCfg(Integer id);
TestResult testGateway(ClusterConfigurationDTO clusterConfiguration);
/**
* Test the given cluster configuration.
*
* @param clusterConfigurationDTO A {@link ClusterConfigurationDTO} object representing the cluster configuration to test.
* @return A {@link TestResult} object representing the test results.
*/
TestResult testGateway(ClusterConfigurationDTO clusterConfigurationDTO);
/**
* Modify the status of a cluster configuration based on its ID.
*
* @param id The ID of the cluster configuration to modify.
* @return A boolean value indicating whether the modification was successful.
*/
Boolean modifyClusterConfigStatus(Integer id);
}
......@@ -97,10 +97,37 @@ public interface DataBaseService extends ISuperService<DataBase> {
*/
List<Column> listColumns(Integer id, String schemaName, String tableName);
/**
* Get the Flink table SQL for the given ID, schema name, and table name.
*
* @param id The ID of the Flink table to get the SQL for.
* @param schemaName The name of the schema for the Flink table.
* @param tableName The name of the table for the Flink table.
* @return A string representing the Flink table SQL.
*/
@Deprecated
String getFlinkTableSql(Integer id, String schemaName, String tableName);
/**
* Get the SQL select statement for the given ID, schema name, and table name.
*
* @param id The ID of the table to get the SQL select statement for.
* @param schemaName The name of the schema for the table.
* @param tableName The name of the table for the SQL select statement.
* @return A string representing the SQL select statement.
*/
@Deprecated
String getSqlSelect(Integer id, String schemaName, String tableName);
/**
* Get the SQL create statement for the given ID, schema name, and table name.
*
* @param id The ID of the table to get the SQL create statement for.
* @param schemaName The name of the schema for the table.
* @param tableName The name of the table for the SQL create statement.
* @return A string representing the SQL create statement.
*/
@Deprecated
String getSqlCreate(Integer id, String schemaName, String tableName);
/**
......@@ -129,8 +156,18 @@ public interface DataBaseService extends ISuperService<DataBase> {
*/
SqlGeneration getSqlGeneration(Integer id, String schemaName, String tableName);
/**
* List all enabled Flink with statements.
*
* @return A list of strings representing all enabled Flink with statements.
*/
List<String> listEnabledFlinkWith();
/**
* Get the SQL for enabling Flink with statements.
*
* @return A string representing the SQL for enabling Flink with statements.
*/
String getEnabledFlinkWithSql();
/**
......@@ -141,7 +178,19 @@ public interface DataBaseService extends ISuperService<DataBase> {
*/
Boolean copyDatabase(DataBase database);
/**
* Explain common SQL statements for the given task.
*
* @param task A {@link TaskDTO} object representing the task to explain.
* @return A list of {@link SqlExplainResult} objects representing the explanation results of common SQL statements.
*/
List<SqlExplainResult> explainCommonSql(TaskDTO task);
/**
* Execute the given SQL DTO and return the job result.
*
* @param sqlDTO A {@link SqlDTO} object representing the SQL statement to execute.
* @return A {@link JobResult} object representing the execution result of the SQL statement.
*/
JobResult executeCommonSql(SqlDTO sqlDTO);
}
......@@ -34,9 +34,9 @@ import java.util.Map;
*/
public interface GitProjectService extends ISuperService<GitProject> {
/**
* 保存或更新
* Save or update the given Git project.
*
* @param gitProjectDTO gitProjectDTO
* @param gitProjectDTO A {@link GitProjectDTO} object representing the Git project to save or update.
*/
void saveOrUpdate(GitProjectDTO gitProjectDTO);
......@@ -55,12 +55,18 @@ public interface GitProjectService extends ISuperService<GitProject> {
*/
Boolean dragendSortJar(GitProjectSortJarParams gitProjectSortJarParams);
/**
* Get the Git pool as a map of strings.
*
* @return A map of strings representing the Git pool.
*/
Map<String, String> getGitPool();
/**
* 更新状态
* Modify the status of a Git project based on its ID.
*
* @param id id
* @param id The ID of the Git project to modify the status for.
* @return A boolean value indicating whether the modification was successful.
*/
Boolean modifyGitProjectStatus(Integer id);
......
......@@ -29,5 +29,12 @@ import org.dinky.mybatis.service.ISuperService;
*/
public interface HistoryService extends ISuperService<History> {
/**
* Remove the history of a Git project based on its ID.
*
* @param id The ID of the Git project to remove the history for.
* @return A boolean value indicating whether the removal was successful.
*/
@Deprecated
boolean removeHistoryById(Integer id);
}
......@@ -31,5 +31,10 @@ import java.util.List;
*/
public interface JarService extends ISuperService<Jar> {
/**
* List all enabled jar files.
*
* @return A list of {@link Jar} objects representing all enabled jar files.
*/
List<Jar> listEnabledAll();
}
......@@ -37,25 +37,89 @@ import com.fasterxml.jackson.databind.JsonNode;
*/
public interface JobInstanceService extends ISuperService<JobInstance> {
/**
* Get the job instance with the given ID without a tenant.
*
* @param id The ID of the job instance to get.
* @return A {@link JobInstance} object representing the found job instance.
*/
@Deprecated
JobInstance getByIdWithoutTenant(Integer id);
/**
* Get the count of job instance statuses.
*
* @param isHistory A boolean indicating whether to get the history status count or not.
* @return An integer representing the count of job instance statuses.
*/
JobInstanceStatus getStatusCount(boolean isHistory);
/**
* Get a list of active job instances.
*
* @return A list of {@link JobInstance} objects representing the active job instances.
*/
List<JobInstance> listJobInstanceActive();
/**
* Get the job information detail for the given ID.
*
* @param id The ID of the job information detail to get.
* @return A {@link JobInfoDetail} object representing the found job information detail.
*/
JobInfoDetail getJobInfoDetail(Integer id);
/**
* Get the job information detail for the given job instance.
*
* @param jobInstance The job instance to get the job information detail for.
* @return A {@link JobInfoDetail} object representing the found job information detail.
*/
JobInfoDetail getJobInfoDetailInfo(JobInstance jobInstance);
/**
* Refresh the job information detail for the given job instance ID.
*
* @param jobInstanceId The ID of the job instance to refresh the job information detail for.
* @return A {@link JobInfoDetail} object representing the refreshed job information detail.
*/
JobInfoDetail refreshJobInfoDetail(Integer jobInstanceId);
/**
* Refresh the job instances for the given task IDs.
*
* @param taskIds The IDs of the tasks to refresh the job instances for.
*/
void refreshJobByTaskIds(Integer... taskIds);
/**
* Get the lineage of a job instance with the given ID.
*
* @param id The ID of the job instance to get the lineage for.
* @return A {@link LineageResult} object representing the lineage of the job instance.
*/
LineageResult getLineage(Integer id);
/**
* Get the job instance with the given task ID.
*
* @param id The ID of the task to get the job instance for.
* @return A {@link JobInstance} object representing the found job instance.
*/
JobInstance getJobInstanceByTaskId(Integer id);
/**
* List all job instances in the system.
*
* @param para A {@link JsonNode} object representing the filter conditions for listing job instances.
* @return A {@link ProTableResult<JobInstance>} object representing the list of job instances.
*/
ProTableResult<JobInstance> listJobInstances(JsonNode para);
/**
* Initialize the tenant by the given job instance ID.
*
* @param id The ID of the job instance to initialize the tenant for.
*/
void initTenantByJobInstanceId(Integer id);
}
......@@ -29,6 +29,11 @@ import javax.naming.NamingException;
public interface LdapService {
/**
* List all users.
*
* @return A list of {@link User} objects representing all users.
*/
List<User> listUsers();
/**
......
......@@ -28,11 +28,40 @@ import java.util.List;
public interface LoginLogService extends ISuperService<LoginLog> {
/**
* Save the login log for a user.
*
* @param user A {@link User} object representing the user to save the login log for.
* @param status The status of the login operation.
* @param ip The IP address of the login device.
* @param msg The message associated with the login operation.
*/
@Deprecated
void saveLoginLog(User user, Integer status, String ip, String msg);
/**
* Save the login log for a user with only the status and IP address.
*
* @param user A {@link User} object representing the user to save the login log for.
* @param status The status of the login operation.
* @param ip The IP address of the login device.
*/
@Deprecated
void saveLoginLog(User user, Status status, String ip);
/**
* Save the login log for a user with only the status.
*
* @param user A {@link User} object representing the user to save the login log for.
* @param status The status of the login operation.
*/
void saveLoginLog(User user, Status status);
/**
* Get the login records for a user.
*
* @param userId The ID of the user to get the login records for.
* @return A list of {@link LoginLog} objects representing the login records for the specified user.
*/
List<LoginLog> loginRecord(Integer userId);
}
......@@ -44,7 +44,8 @@ public interface MenuService extends ISuperService<Menu> {
* @param user login user
* @return {@link List<Menu>} menu list
*/
public List<Menu> selectMenuList(User user);
@Deprecated
List<Menu> selectMenuList(User user);
/**
* query menu list by menu and user
......@@ -52,8 +53,9 @@ public interface MenuService extends ISuperService<Menu> {
* @param menu menu
* @return {@link List<Menu>} menu list
*/
public List<Menu> selectMenuList(Menu menu, User user);
List<Menu> selectMenuList(Menu menu, User user);
@Deprecated
List<Menu> listMenusBySuperFlag(Integer superFlag);
/**
......@@ -70,6 +72,7 @@ public interface MenuService extends ISuperService<Menu> {
* @param user login user
* @return {@link Menu} menu
*/
@Deprecated
List<Menu> selectMenuTreeByUserId(User user);
/**
......
......@@ -34,18 +34,63 @@ import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import com.baomidou.mybatisplus.extension.service.IService;
public interface MonitorService extends IService<Metrics> {
/**
* Get the metrics data for a specified time range and job IDs.
*
* @param startTime The start time of the time range.
* @param endTime The end time of the time range.
* @param jobIds A list of job IDs to get the metrics data for.
* @return A list of {@link MetricsVO} objects representing the metrics data for the specified time range and job IDs.
*/
List<MetricsVO> getData(Date startTime, Date endTime, List<String> jobIds);
/**
* Send the latest data to the specified SSE emitter.
*
* @param sseEmitter The SSE emitter to send the latest data to.
* @param lastDate The last date to include in the data.
* @param keys A list of keys to filter the data by.
* @return {@link SseEmitter}
*/
SseEmitter sendLatestData(SseEmitter sseEmitter, LocalDateTime lastDate, List<String> keys);
/**
* Send the JVM information to the specified SSE emitter.
*
* @param sseEmitter The SSE emitter to send the JVM information to.
* @return {@link SseEmitter}
*/
SseEmitter sendJvmInfo(SseEmitter sseEmitter);
/**
* Save the Flink metric layout.
*
* @param layout The name of the layout to save.
* @param metricsList A list of {@link MetricsLayoutDTO} objects representing the metrics to save.
*/
@Transactional(rollbackFor = Exception.class)
void saveFlinkMetricLayout(String layout, List<MetricsLayoutDTO> metricsList);
/**
* Get the metrics layout as a map.
*
* @return A map where the keys are layout names and the values are lists of {@link Metrics} objects representing the metrics in each layout.
*/
Map<String, List<Metrics>> getMetricsLayout();
/**
* Get the metrics layout by name.
*
* @param layoutName The name of the layout to get.
* @return A list of {@link Metrics} objects representing the metrics in the specified layout.
*/
List<Metrics> getMetricsLayoutByName(String layoutName);
/**
* Get the job metrics for a specified task ID.
*
* @param taskId The ID of the task to get the job metrics for.
* @return A list of {@link Metrics} objects representing the job metrics for the specified task ID.
*/
List<Metrics> getJobMetrics(Integer taskId);
}
......@@ -22,7 +22,17 @@ package org.dinky.service;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
public interface PrintTableService {
/**
* Register a listen entry for a specified table.
*
* @param table The name of the table to register the listen entry for.
*/
SseEmitter registerListenEntry(String table);
/**
* Unregister a listen entry for a specified table.
*
* @param table The name of the table to unregister the listen entry for.
*/
void unRegisterListenEntry(String table);
}
......@@ -29,9 +29,8 @@ public interface RoleMenuService extends ISuperService<RoleMenu> {
/**
* Assign menu to role
*
* @param roleId role id
* @param menuId menu id
* @return boolean {@code true} if success, {@code false} if failed
* @param assignMenuToRoleDto
* @return
*/
Result<Void> assignMenuToRole(AssignMenuToRoleDto assignMenuToRoleDto);
}
......@@ -75,5 +75,11 @@ public interface RoleService extends ISuperService<Role> {
*/
List<Integer> selectRoleListByUserId(Integer userId);
/**
* Get a list of users with the specified role ID.
*
* @param roleId The ID of the role to filter the users by.
* @return A list of {@link User} objects representing the users with the specified role ID.
*/
List<User> getUserListByRoleId(Integer roleId);
}
......@@ -32,6 +32,7 @@ public interface RowPermissionsService extends ISuperService<RowPermissions> {
* @param roleIds role id
* @return delete status
*/
@Deprecated
boolean deleteByRoleIds(List<Integer> roleIds);
/**
......@@ -40,6 +41,7 @@ public interface RowPermissionsService extends ISuperService<RowPermissions> {
* @param roleId role id
* @return List<RowPermissions>
*/
@Deprecated
List<RowPermissions> listAllByRoleId(Integer roleId);
/**
......
......@@ -32,11 +32,35 @@ import java.util.List;
*/
public interface SavepointsService extends ISuperService<Savepoints> {
/**
* Get a list of savepoints for a specified task ID.
*
* @param taskId The ID of the task to get the savepoints for.
* @return A list of {@link Savepoints} objects representing the savepoints for the specified task ID.
*/
List<Savepoints> listSavepointsByTaskId(Integer taskId);
/**
* Get the latest savepoint for a specified task ID.
*
* @param taskId The ID of the task to get the latest savepoint for.
* @return A {@link Savepoints} object representing the latest savepoint for the specified task ID.
*/
Savepoints getLatestSavepointByTaskId(Integer taskId);
/**
* Get the earliest savepoint for a specified task ID.
*
* @param taskId The ID of the task to get the earliest savepoint for.
* @return A {@link Savepoints} object representing the earliest savepoint for the specified task ID.
*/
Savepoints getEarliestSavepointByTaskId(Integer taskId);
/**
* Get a savepoint for a specified task using the specified strategy.
*
* @param task A {@link TaskDTO} object representing the task to get the savepoint for.
* @return A {@link Savepoints} object representing the savepoint for the specified task.
*/
Savepoints getSavePointWithStrategy(TaskDTO task);
}
......@@ -41,19 +41,67 @@ import com.fasterxml.jackson.databind.JsonNode;
*/
public interface StudioService {
/**
* Execute a DDL statement and return the result.
*
* @param studioDDLDTO A {@link StudioDDLDTO} object representing the DDL statement to execute.
* @return An {@link IResult} object representing the result of the DDL statement execution.
*/
IResult executeDDL(StudioDDLDTO studioDDLDTO);
/**
* Get common SQL data based on the specified task ID.
*
* @param taskId The ID of the task to get the common SQL data for.
* @return A {@link JdbcSelectResult} object representing the common SQL data for the specified task ID.
*/
JdbcSelectResult getCommonSqlData(Integer taskId);
/**
* Get job data based on the specified job ID.
*
* @param jobId The ID of the job to get the job data for.
* @return A {@link SelectResult} object representing the job data for the specified job ID.
*/
SelectResult getJobData(String jobId);
/**
* Get the lineage information for a specified studio CAD.
*
* @param studioCADTO A {@link StudioCADTO} object representing the studio CAD to get the lineage information for.
* @return A {@link LineageResult} object representing the lineage information for the specified studio CAD.
*/
LineageResult getLineage(StudioCADTO studioCADTO);
/**
* Get a list of Flink jobs based on the specified cluster ID.
*
* @param clusterId The ID of the cluster to get the Flink jobs for.
* @return A list of {@link JsonNode} objects representing the Flink jobs for the specified cluster ID.
*/
List<JsonNode> listFlinkJobs(Integer clusterId);
/**
* Get MS catalogs based on the specified studio meta store DTO.
*
* @param studioMetaStoreDTO A {@link StudioMetaStoreDTO} object representing the studio meta store DTO to get the MS catalogs for.
* @return A list of {@link Catalog} objects representing the MS catalogs for the specified studio meta store DTO.
*/
List<Catalog> getMSCatalogs(StudioMetaStoreDTO studioMetaStoreDTO);
/**
* Get the schema information for a specified MS catalog.
*
* @param studioMetaStoreDTO A {@link StudioMetaStoreDTO} object representing the MS catalog to get the schema information for.
* @return A {@link Schema} object representing the schema information for the specified MS catalog.
*/
Schema getMSSchemaInfo(StudioMetaStoreDTO studioMetaStoreDTO);
/**
* Get a list of Flink columns based on the specified MS catalog.
*
* @param studioMetaStoreDTO A {@link StudioMetaStoreDTO} object representing the MS catalog to get the Flink columns for.
* @return A list of {@link FlinkColumn} objects representing the Flink columns for the specified MS catalog.
*/
List<FlinkColumn> getMSFlinkColumns(StudioMetaStoreDTO studioMetaStoreDTO);
}
......@@ -33,9 +33,23 @@ import java.util.Map;
*/
public interface SysConfigService extends ISuperService<SysConfig> {
/**
* Get all configurations.
*
* @return A map of string keys to lists of {@link Configuration} objects.
*/
Map<String, List<Configuration<?>>> getAll();
/**
* Initialize system configurations.
*/
void initSysConfig();
/**
* Update system configurations by key-value pairs.
*
* @param key The key of the configuration to update.
* @param value The new value of the configuration.
*/
void updateSysConfigByKv(String key, String value);
}
......@@ -50,57 +50,221 @@ import cn.hutool.core.lang.tree.Tree;
*/
public interface TaskService extends ISuperService<Task> {
/**
* Build SQL statements for environment based on the given task.
*
* @param task The {@link AbstractStatementDTO} object representing the task to build SQL statements for.
* @return A string containing the built SQL statements.
*/
String buildEnvSql(AbstractStatementDTO task);
/**
* Submit the given task and return the job result.
*
* @param id The ID of the task to submit.
* @param savePointPath The path of the save point for the job execution.
* @return A {@link JobResult} object representing the result of the submitted task.
* @throws ExcuteException If there is an error executing the task.
*/
JobResult submitTask(Integer id, String savePointPath) throws ExcuteException;
/**
* Restart the given task and return the job result.
*
* @param id The ID of the task to restart.
* @param savePointPath The path of the save point for the job execution.
* @return A {@link JobResult} object representing the result of the restarted task.
* @throws ExcuteException If there is an error restarting the task.
*/
JobResult restartTask(Integer id, String savePointPath) throws ExcuteException;
/**
* Savepoint the given task job and return the savepoint result.
*
* @param task The {@link TaskDTO} object representing the task to savepoint.
* @param savePointType The type of savepoint to create.
* @return A {@link SavePointResult} object representing the savepoint result.
*/
SavePointResult savepointTaskJob(TaskDTO task, String savePointType);
/**
* Explain the given task and return a list of SQL explain results.
*
* @param task The {@link TaskDTO} object representing the task to explain.
* @return A list of {@link SqlExplainResult} objects representing the SQL explain results.
* @throws NotSupportExplainExcepition If the task does not support SQL explain.
*/
List<SqlExplainResult> explainTask(TaskDTO task) throws NotSupportExplainExcepition;
/**
* Cancel the execution of the given task job.
*
* @param task The {@link TaskDTO} object representing the task to cancel.
* @return true if the task job is successfully cancelled, false otherwise.
*/
boolean cancelTaskJob(TaskDTO task);
/**
* Get the stream graph of the given task job.
*
* @param taskDTO The {@link TaskDTO} object representing the task to get the stream graph for.
* @return A JSON object representing the stream graph.
*/
ObjectNode getStreamGraph(TaskDTO taskDTO);
/**
* Export the SQL statements for the given task ID.
*
* @param id The ID of the task to export SQL statements for.
* @return A string containing the exported SQL statements.
*/
String exportSql(Integer id);
/**
* Get the job plan for the given task.
*
* @param task The {@link TaskDTO} object representing the task to get the job plan for.
* @return A JSON object representing the job plan.
*/
ObjectNode getJobPlan(TaskDTO task);
/**
* Get the information of the given task by its ID.
*
* @param id The ID of the task to get information for.
* @return A {@link TaskDTO} object representing the task information.
*/
TaskDTO getTaskInfoById(Integer id);
/**
* Initialize the tenant by task ID.
*
* @param id The ID of the task to initialize the tenant for.
*/
void initTenantByTaskId(Integer id);
/**
* Change the life cycle of the given task.
*
* @param taskId The ID of the task to change the life cycle for.
* @param lifeCycle The new life cycle of the task.
* @return true if the life cycle is successfully changed, false otherwise.
*/
boolean changeTaskLifeRecyle(Integer taskId, JobLifeCycle lifeCycle);
/**
* Save or update the given task.
*
* @param task The {@link Task} object representing the task to save or update.
* @return true if the task is successfully saved or updated, false otherwise.
*/
boolean saveOrUpdateTask(Task task);
/**
* Get a list of all Flink SQL environments.
*
* @return A list of {@link Task} objects representing the Flink SQL environments.
*/
List<Task> listFlinkSQLEnv();
/**
* Initialize the default Flink SQL environment for the given tenant ID.
*
* @param tenantId The ID of the tenant to initialize the default Flink SQL environment for.
* @return A {@link Task} object representing the initialized default Flink SQL environment.
*/
Task initDefaultFlinkSQLEnv(Integer tenantId);
/**
* Get a list of all user-defined functions (UDFs) in the system.
*
* @return A list of {@link Task} objects representing the UDFs.
*/
List<Task> getAllUDF();
/**
* Get the API address of the given task.
*
* @return A string containing the API address of the task.
*/
String getTaskAPIAddress();
/**
* Rollback the given task version.
*
* @param dto The {@link TaskRollbackVersionDTO} object representing the task to rollback.
* @return A {@link Result} object indicating the result of the rollback operation.
*/
Result<Void> rollbackTask(TaskRollbackVersionDTO dto);
/**
* Get the size of all tasks with the given name in the system.
*
* @param name The name of the tasks to query.
* @return An integer representing the number of tasks with the given name.
*/
Integer queryAllSizeByName(String name);
/**
* Export the JSON data for the given task ID.
*
* @param taskId The ID of the task to export JSON data for.
* @return A string containing the exported JSON data.
*/
String exportJsonByTaskId(Integer taskId);
/**
* Export the JSON data for multiple tasks by their IDs.
*
* @param para A {@link JsonNode} object representing the task IDs to export JSON data for.
* @return A string containing the exported JSON data.
*/
String exportJsonByTaskIds(JsonNode para);
/**
* Upload a task JSON file to the server.
*
* @param file A {@link MultipartFile} object representing the task JSON file to upload.
* @return A {@link Result} object indicating the result of the upload operation.
* @throws Exception If an error occurs during the upload process.
*/
Result<Void> uploadTaskJson(MultipartFile file) throws Exception;
/**
* Query all task catalogs in the system.
*
* @return A {@link Result} object containing a {@link Tree} object representing the task catalogs.
*/
Result<Tree<Integer>> queryAllCatalogue();
/**
* Get the task with the given name and tenant ID.
*
* @param name The name of the task to get.
* @param tenantId The ID of the tenant to get the task for.
* @return A {@link Task} object representing the found task.
*/
Task getTaskByNameAndTenantId(String name, Integer tenantId);
/**
* Get the online rate of all tasks in the system.
*
* @return A list of {@link JobTypeOverView} objects representing the online rates of all tasks.
*/
List<JobTypeOverView> getTaskOnlineRate();
/**
* Get the streaming or batch model overview of all jobs in the system.
*
* @return A {@link JobModelOverview} object representing the job model overview.
*/
JobModelOverview getJobStreamingOrBatchModelOverview();
/**
* Get the print tables for the given SQL statement.
*
* @param statement The SQL statement to get the print tables for.
* @return A list of strings representing the print tables.
*/
List<String> getPrintTables(String statement);
}
......@@ -34,5 +34,10 @@ public interface TaskVersionService extends ISuperService<TaskVersion> {
*/
List<TaskVersion> getTaskVersionByTaskId(Integer taskId);
/**
* Create a snapshot of a task version.
*
* @param task A {@link TaskDTO} object representing the task to create a snapshot for.
*/
void createTaskVersionSnapshot(TaskDTO task);
}
......@@ -38,5 +38,6 @@ public interface TokenService extends ISuperService<SysToken> {
* @param token token
* @return add or update code
*/
@Deprecated
boolean saveOrUpdateSysToken(SysToken token);
}
......@@ -25,18 +25,18 @@ import org.dinky.mybatis.service.ISuperService;
public interface UDFTemplateService extends ISuperService<UDFTemplate> {
/**
* 保存
* Save or update a UDF template.
*
* @param udfTemplate udf模板
* @return boolean
* @param udfTemplate A {@link UDFTemplate} object to save or update.
* @return A boolean value indicating whether the save or update operation was successful.
*/
boolean saveOrUpdate(UDFTemplate udfTemplate);
/**
* enable or disable udf template
* Modify the status of a UDF template.
*
* @param id udf template id {@link UDFTemplate#id}
* @return {@link Boolean}
* @param id The ID of the UDF template to modify.
* @return A {@link Boolean} value indicating whether the modification was successful.
*/
Boolean modifyUDFTemplateStatus(Integer id);
}
......@@ -49,6 +49,7 @@ public interface UserRoleService extends ISuperService<UserRole> {
* @param userRoleList
* @return
*/
@Deprecated
int deleteBathRelation(List<UserRole> userRoleList);
/**
......@@ -57,6 +58,7 @@ public interface UserRoleService extends ISuperService<UserRole> {
* @param roleIds role id
* @return
*/
@Deprecated
boolean deleteByRoleIds(List<Integer> roleIds);
/**
......
......@@ -41,7 +41,7 @@ import java.util.List;
public interface UserService extends ISuperService<User> {
/**
* registerUser
* register user
*
* @param user user
* @return {@link Result}<{@link Void}>
......@@ -49,7 +49,7 @@ public interface UserService extends ISuperService<User> {
Result<Void> registerUser(User user);
/**
* modifyUser
* modify user
*
* @param user user
* @return {@link Boolean}
......@@ -57,7 +57,7 @@ public interface UserService extends ISuperService<User> {
Boolean modifyUser(User user);
/**
* modifyPassword
* modify password
*
* @param modifyPasswordDTO {@link ModifyPasswordDTO}
* @return {@link Result}<{@link Void}>
......@@ -65,7 +65,7 @@ public interface UserService extends ISuperService<User> {
Result<Void> modifyPassword(ModifyPasswordDTO modifyPasswordDTO);
/**
* removeUser
* remove user
*
* @param id id
* @return {@link Boolean}
......@@ -73,7 +73,7 @@ public interface UserService extends ISuperService<User> {
Boolean removeUser(Integer id);
/**
* loginUser
* login user
*
* @param loginDTO basic information for user login
* @return {@link Result}{@link UserDTO} obtain the user's UserDTO
......@@ -81,7 +81,7 @@ public interface UserService extends ISuperService<User> {
Result<UserDTO> loginUser(LoginDTO loginDTO);
/**
* getUserByUsername
* get user by username
*
* @param username username
* @return {@link User}
......@@ -89,7 +89,7 @@ public interface UserService extends ISuperService<User> {
User getUserByUsername(String username);
/**
* grantRole
* grant role
*
* @param assignRoleParams {@link AssignRoleParams}
* @return {@link Result}<{@link Void}>
......@@ -133,6 +133,7 @@ public interface UserService extends ISuperService<User> {
* @param id
* @return {@link Boolean}
*/
@Deprecated
Boolean checkTenantAdmin(Integer id);
/**
......@@ -149,9 +150,16 @@ public interface UserService extends ISuperService<User> {
*/
List<RowPermissions> getCurrentRoleSelectPermissions();
/**
* Builds row-level permissions.
*
*/
void buildRowPermission();
/** user loginout */
/**
* User logout function.
*
*/
void outLogin();
/**
......@@ -162,15 +170,36 @@ public interface UserService extends ISuperService<User> {
List<Integer> getUserIdsByTenantId(int id);
/**
* get user list by tenant id
* Returns a list of users based on the provided tenant id.
*
* @return role select permissions list
* @param id The id of the tenant.
* @return A list of users that belong to the tenant with the provided id.
*/
List<User> getUserListByTenantId(int id);
/**
* Modifies the user's role permissions based on the provided parameters.
*
* @param userId The id of the user to modify.
* @param tenantId The id of the tenant to modify.
* @param tenantAdminFlag Whether the user should be a tenant admin.
* @return A result object indicating the success or failure of the operation.
*/
Result<Void> modifyUserToTenantAdmin(Integer userId, Integer tenantId, Boolean tenantAdminFlag);
/**
* Restores a user's account to its original status after it has been disabled or locked.
*
* @param userId The id of the user to restore.
* @return A result object indicating the success or failure of the operation.
*/
Result<Void> recoveryUser(Integer userId);
/**
* Resets a user's password to a new value.
*
* @param userId The id of the user to reset password.
* @return A result object containing the user's new password.
*/
Result<UserVo> resetPassword(Integer userId);
}
......@@ -31,16 +31,59 @@ import com.baomidou.mybatisplus.extension.service.IService;
public interface ResourcesService extends IService<Resources> {
/**
* Create a new folder with the specified parameters.
*
* @param pid The ID of the parent folder.
* @param fileName The name of the new folder.
* @param desc A description of the new folder.
* @return A {@link TreeNodeDTO} object representing the newly created folder.
*/
TreeNodeDTO createFolder(Integer pid, String fileName, String desc);
/**
* Rename an existing folder with the specified parameters.
*
* @param id The ID of the folder to rename.
* @param fileName The new name for the folder.
* @param desc A new description for the folder.
*/
void rename(Integer id, String fileName, String desc);
/**
* Get a list of all folders under a specified parent folder, up to a certain number of floors.
*
* @param pid The ID of the parent folder.
* @param showFloorNum The maximum number of floors to show.
* @return A list of {@link TreeNodeDTO} objects representing the folders under the specified parent folder.
*/
List<TreeNodeDTO> showByTree(Integer pid, Integer showFloorNum);
/**
* Create a tree structure based on the specified data.
*
* @param data A list of {@link TreeNodeDTO} objects representing the nodes in the tree.
* @param pid The ID of the parent folder.
* @param showFloorNum The maximum number of floors to show.
* @param currentFloor The current floor being processed.
*/
void createTree(List<TreeNodeDTO> data, Integer pid, Integer showFloorNum, Integer currentFloor);
/**
* Get the content of a file with the specified resource ID.
*
* @param id The ID of the file to get the content for.
* @return A string representing the content of the file.
*/
String getContentByResourceId(Integer id);
/**
* Upload a file to the specified folder.
*
* @param pid The ID of the parent folder.
* @param desc A description of the file being uploaded.
* @param file A {@link MultipartFile} object representing the file to be uploaded.
*/
void uploadFile(Integer pid, String desc, MultipartFile file);
void remove(Integer id);
......@@ -52,6 +95,7 @@ public interface ResourcesService extends IService<Resources> {
* @param pid pid
* @return data
*/
@Deprecated
List<Resources> getResourceByPidToParent(List<Resources> resourcesList, Integer pid);
/**
......@@ -61,6 +105,7 @@ public interface ResourcesService extends IService<Resources> {
* @param pid pid
* @return data
*/
@Deprecated
List<Resources> getResourceByPidToChildren(List<Resources> resourcesList, Integer pid);
/**
......
......@@ -52,11 +52,11 @@ public class ProcessClient {
private static final Logger logger = LoggerFactory.getLogger(TaskClient.class);
/**
* 查询工作流定义
* Get a list of process definitions for a specified project code and process name.
*
* @param projectCode 项目编号
* @param processName 工作流定义名
* @return {@link List<ProcessDefinition>}
* @param projectCode The ID of the project to get the process definitions for.
* @param processName The name of the process to get the process definitions for.
* @return A list of {@link ProcessDefinition} objects representing the process definitions for the specified project code and process name.
*/
public List<ProcessDefinition> getProcessDefinition(Long projectCode, String processName) {
String format = StrUtil.format(
......@@ -87,11 +87,11 @@ public class ProcessClient {
}
/**
* 查询工作流定义
* Get information about a specified process definition.
*
* @param projectCode 项目编号
* @param processName 工作流定义名
* @return {@link ProcessDefinition}
* @param projectCode The ID of the project to get the process definition information for.
* @param processName The name of the process definition to get information for.
* @return A {@link ProcessDefinition} object representing the information for the specified process definition.
*/
public ProcessDefinition getProcessDefinitionInfo(Long projectCode, String processName) {
List<ProcessDefinition> lists = getProcessDefinition(projectCode, processName);
......@@ -102,11 +102,11 @@ public class ProcessClient {
}
/**
* 根据编号获取
* Get information about a specified process definition.
*
* @param projectCode 项目编号
* @param processCode 任务编号
* @return {@link DagData}
* @param projectCode The ID of the project to get the process definition information for.
* @param processCode The ID of the process definition to get information for.
* @return A {@link DagData} object representing the information for the specified process definition.
*/
public DagData getProcessDefinitionInfo(Long projectCode, Long processCode) {
Map<String, Object> map = new HashMap<>();
......@@ -131,11 +131,13 @@ public class ProcessClient {
}
/**
* 创建工作流定义
* Create a new process definition.
*
* @param projectCode 项目编号
* @param processName 工作流定义名称
* @return {@link ProcessDefinition}
* @param projectCode The ID of the project to create the process definition for.
* @param processName The name of the process definition to create.
* @param taskCode The ID of the task to associate with the process definition.
* @param taskDefinitionJson A JSON string representing the task definition to associate with the process definition.
* @return A {@link ProcessDefinition} object representing the newly created process definition.
*/
public ProcessDefinition createProcessDefinition(
Long projectCode, String processName, Long taskCode, String taskDefinitionJson) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment