mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 03:11:44 +08:00
feat(同步管理): 支持源数据源插件
This commit is contained in:
@@ -3783,7 +3783,9 @@ export default {
|
||||
'flag-all': 'All',
|
||||
'flag-ds': 'Datasource plug-in',
|
||||
'flag-view': 'Chart plug-in',
|
||||
'flag-df': 'Data reporting plug-in'
|
||||
'flag-df': 'Data reporting plug-in',
|
||||
'flag-sync-source': 'Data Sync - Source plug-in',
|
||||
'flag-sync-sink': 'Data Sync- Sink plug-in'
|
||||
},
|
||||
online_map: {
|
||||
geometry: 'Geographic information',
|
||||
|
||||
@@ -3671,7 +3671,9 @@ export default {
|
||||
'flag-all': '全部',
|
||||
'flag-ds': '資料來源插件',
|
||||
'flag-view': '圖表插件',
|
||||
'flag-df': '資料填報插件'
|
||||
'flag-df': '資料填報插件',
|
||||
'flag-sync-source': '數據同步-源數據源插件',
|
||||
'flag-sync-sink': '數據同步-目標數據源插件'
|
||||
},
|
||||
online_map: {
|
||||
geometry: '地理資訊',
|
||||
|
||||
@@ -3677,7 +3677,9 @@ export default {
|
||||
'flag-all': '全部',
|
||||
'flag-ds': '数据源插件',
|
||||
'flag-view': '图表插件',
|
||||
'flag-df': '数据填报插件'
|
||||
'flag-df': '数据填报插件',
|
||||
'flag-sync-source': '数据同步-源数据源插件',
|
||||
'flag-sync-sink': '数据同步-目标数据源插件'
|
||||
},
|
||||
online_map: {
|
||||
geometry: '地理信息',
|
||||
|
||||
2
de-xpack
2
de-xpack
Submodule de-xpack updated: 4af1d26d6b...36c7d86e70
@@ -3,6 +3,7 @@ package io.dataease.api.xpack.component;
|
||||
import io.dataease.api.xpack.component.vo.XpackMenuVO;
|
||||
import io.dataease.extensions.datafilling.vo.XpackPluginsDfVO;
|
||||
import io.dataease.extensions.datasource.vo.XpackPluginsDatasourceVO;
|
||||
import io.dataease.extensions.sync.vo.XpackPluginsSyncDatasourceVO;
|
||||
import io.dataease.extensions.view.vo.XpackPluginsViewVO;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -29,6 +30,9 @@ public interface XpackComponentApi {
|
||||
@GetMapping("/dfPlugins")
|
||||
List<XpackPluginsDfVO> dfPlugins();
|
||||
|
||||
@GetMapping("/syncPlugins")
|
||||
List<XpackPluginsSyncDatasourceVO> syncPlugins();
|
||||
|
||||
@GetMapping("/pluginStaticInfo/{moduleName}")
|
||||
void pluginStaticInfo(@PathVariable("moduleName") String moduleName);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ package io.dataease.api.sync.datasource.api;
|
||||
|
||||
import io.dataease.api.sync.datasource.dto.DBTableDTO;
|
||||
import io.dataease.api.sync.datasource.dto.DatasourceGridRequest;
|
||||
import io.dataease.api.sync.datasource.dto.GetDatasourceRequest;
|
||||
import io.dataease.api.sync.datasource.dto.SyncDatasourceDTO;
|
||||
import io.dataease.api.sync.datasource.vo.SyncDatasourceVO;
|
||||
import io.dataease.auth.DeApiPath;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.extensions.sync.model.datasource.DatasourceDTO;
|
||||
import io.dataease.extensions.sync.model.datasource.DatasourceRequest;
|
||||
import io.dataease.result.PageResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -26,16 +25,16 @@ import static io.dataease.constant.AuthResourceEnum.SYNC_DATASOURCE;
|
||||
public interface SyncDatasourceApi {
|
||||
|
||||
@PostMapping("/source/pager/{goPage}/{pageSize}")
|
||||
PageResult<SyncDatasourceVO> sourcePager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody DatasourceGridRequest request);
|
||||
PageResult<DatasourceRequest> sourcePager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody DatasourceGridRequest request);
|
||||
|
||||
@PostMapping("/target/pager/{goPage}/{pageSize}")
|
||||
PageResult<SyncDatasourceVO> targetPager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody DatasourceGridRequest request);
|
||||
PageResult<DatasourceRequest> targetPager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody DatasourceGridRequest request);
|
||||
|
||||
@PostMapping("/save")
|
||||
void save(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException;
|
||||
void save(@RequestBody DatasourceRequest datasourceRequest) throws DEException;
|
||||
|
||||
@PostMapping("/update")
|
||||
Map<String, Object> update(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException;
|
||||
Map<String, Object> update(@RequestBody DatasourceRequest datasourceRequest) throws DEException;
|
||||
|
||||
@PostMapping("/delete/{datasourceId}")
|
||||
void delete(@PathVariable("datasourceId") String datasourceId) throws DEException;
|
||||
@@ -44,28 +43,28 @@ public interface SyncDatasourceApi {
|
||||
Object datasourceTypes() throws DEException;
|
||||
|
||||
@PostMapping("/validate")
|
||||
String validate(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException;
|
||||
String validate(@RequestBody DatasourceRequest datasourceRequest) throws DEException;
|
||||
|
||||
@PostMapping("/getSchema")
|
||||
List<String> getSchema(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException;
|
||||
List<String> getSchema(@RequestBody DatasourceRequest datasourceRequest) throws DEException;
|
||||
|
||||
@GetMapping("/validate/{datasourceId}")
|
||||
SyncDatasourceDTO validate(@PathVariable("datasourceId") String datasourceId) throws DEException;
|
||||
DatasourceDTO validate(@PathVariable("datasourceId") String datasourceId) throws DEException;
|
||||
|
||||
@PostMapping("/latestUse/{sourceType}")
|
||||
List<String> latestUse(@PathVariable("sourceType") String sourceType);
|
||||
|
||||
@GetMapping("/get/{datasourceId}")
|
||||
SyncDatasourceDTO get(@PathVariable("datasourceId") String datasourceId) throws DEException;
|
||||
DatasourceDTO get(@PathVariable("datasourceId") String datasourceId) throws DEException;
|
||||
|
||||
@PostMapping("/batchDel")
|
||||
void batchDel(@RequestBody List<String> ids) throws DEException;
|
||||
|
||||
@PostMapping("/fields")
|
||||
Map<String, Object> getFields(@RequestBody GetDatasourceRequest getDsRequest) throws DEException;
|
||||
Map<String, Object> getFields(@RequestBody DatasourceRequest getDsRequest) throws DEException;
|
||||
|
||||
@GetMapping("/list/{type}")
|
||||
List<SyncDatasourceDTO> listByType(@PathVariable("type") String type) throws DEException;
|
||||
List<DatasourceDTO> listByType(@PathVariable("type") String type) throws DEException;
|
||||
|
||||
@GetMapping("/table/list/{dsId}")
|
||||
List<DBTableDTO> getTableList(@PathVariable("dsId") String dsId) throws DEException;
|
||||
|
||||
@@ -2,10 +2,9 @@ package io.dataease.api.sync.task.api;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.api.sync.task.dto.TaskGridRequest;
|
||||
import io.dataease.api.sync.task.dto.TaskInfoDTO;
|
||||
import io.dataease.api.sync.task.vo.TaskInfoVO;
|
||||
import io.dataease.auth.DeApiPath;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.extensions.sync.model.task.TaskInfoVO;
|
||||
import io.dataease.result.PageResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -33,11 +32,11 @@ public interface TaskApi {
|
||||
|
||||
@Operation(hidden = true)
|
||||
@PostMapping("/add")
|
||||
void add(@RequestBody TaskInfoDTO jobInfo) throws DEException;
|
||||
void add(@RequestBody TaskInfoVO jobInfo) throws DEException;
|
||||
|
||||
@Operation(hidden = true)
|
||||
@PostMapping("/update")
|
||||
void update(@RequestBody TaskInfoDTO jobInfo) throws DEException;
|
||||
void update(@RequestBody TaskInfoVO jobInfo) throws DEException;
|
||||
|
||||
@Operation(hidden = true)
|
||||
@PostMapping("/remove/{id}")
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
package io.dataease.api.sync.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author fit2cloud
|
||||
* @date 2023/11/28 17:17
|
||||
**/
|
||||
@Data
|
||||
public class TaskInfoDTO {
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 任务类型KEY
|
||||
*/
|
||||
private String jobKey;
|
||||
|
||||
private String desc;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private Long modifyBy;
|
||||
|
||||
/**
|
||||
* 任务参数
|
||||
*/
|
||||
private String parameter;
|
||||
|
||||
/**
|
||||
* 扩展参数
|
||||
*/
|
||||
private String extParameter;
|
||||
|
||||
/**
|
||||
* 当前任务状态
|
||||
* unexecuted未执行 currentTime<startTime
|
||||
* waiting等待执行 stopTime>=currentTime>=startTime,status=1
|
||||
* suspend暂停 stopTime>=currentTime>=startTime,status=0
|
||||
* done执行结束 currentTime>stopTime
|
||||
* running执行中,通过当前任务的日志状态判断,如果有日志在执行中
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 任务执行超时时间
|
||||
*/
|
||||
private Long executorTimeout;
|
||||
|
||||
/**
|
||||
* 任务执行失败重试次数
|
||||
*/
|
||||
private Long executorFailRetryCount;
|
||||
|
||||
/**
|
||||
* 上次调度时间
|
||||
*/
|
||||
private Long triggerLastTime;
|
||||
|
||||
/**
|
||||
* 下次次调度时间
|
||||
*/
|
||||
private Long triggerNextTime;
|
||||
|
||||
/**
|
||||
* 调度类型,NONE,CRON,FIX_RATE,FIX_DELAY
|
||||
*/
|
||||
private String schedulerType;
|
||||
|
||||
/**
|
||||
* 调度配置,取决于调度类型
|
||||
*/
|
||||
private String schedulerConf;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String stopTime;
|
||||
|
||||
|
||||
/**
|
||||
* 源数据源信息
|
||||
*/
|
||||
private Source source;
|
||||
/**
|
||||
* 目标数据源信息
|
||||
*/
|
||||
private Target target;
|
||||
|
||||
/**
|
||||
* 编辑标识
|
||||
*/
|
||||
private boolean editing;
|
||||
/**
|
||||
* 所有内容可编辑
|
||||
*/
|
||||
private boolean editable;
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
package io.dataease.api.sync.task.vo;
|
||||
|
||||
import io.dataease.api.sync.task.dto.Source;
|
||||
import io.dataease.api.sync.task.dto.Target;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author fit2cloud
|
||||
* @date 2023/11/28 17:15
|
||||
**/
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
public class TaskInfoVO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 任务类型KEY
|
||||
*/
|
||||
private String jobKey;
|
||||
|
||||
private String desc;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 任务参数
|
||||
*/
|
||||
private String parameter;
|
||||
|
||||
/**
|
||||
* 扩展参数
|
||||
*/
|
||||
private String extParameter;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
* unexecuted未执行 currentTime<startTime
|
||||
* waiting等待执行 stopTime>=currentTime>=startTime,status=1
|
||||
* suspend暂停 stopTime>=currentTime>=startTime,status=0
|
||||
* done执行结束 currentTime>stopTime
|
||||
* running执行中,通过当前任务的日志状态判断,如果有日志在执行中
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 任务执行超时时间
|
||||
*/
|
||||
private Long executorTimeout;
|
||||
|
||||
/**
|
||||
* 任务执行失败重试次数
|
||||
*/
|
||||
private Long executorFailRetryCount;
|
||||
|
||||
/**
|
||||
* 上次调度时间
|
||||
*/
|
||||
private Long triggerLastTime;
|
||||
|
||||
/**
|
||||
* 下次次调度时间
|
||||
*/
|
||||
private Long triggerNextTime;
|
||||
|
||||
/**
|
||||
* 调度类型,NONE,CRON,FIX_RATE,FIX_DELAY
|
||||
*/
|
||||
private String schedulerType;
|
||||
|
||||
/**
|
||||
* 调度配置,取决于调度类型
|
||||
*/
|
||||
private String schedulerConf;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Long startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Long stopTime;
|
||||
|
||||
private Source source;
|
||||
private Target target;
|
||||
|
||||
/**
|
||||
* 上次执行结果,获取任务最新的日志状态
|
||||
* running执行中
|
||||
* success
|
||||
* fail失败
|
||||
*/
|
||||
private String lastExecuteStatus;
|
||||
/**
|
||||
* 增量任务
|
||||
*/
|
||||
private boolean incrementTask;
|
||||
|
||||
// 以下为日志信息
|
||||
private String logId;
|
||||
private Long executorStartTime;
|
||||
private Long executorEndTime;
|
||||
private String executorMsg;
|
||||
/**
|
||||
* 成功SUCCESS,失败FAIL,执行中RUNNING
|
||||
*/
|
||||
private String logStatus;
|
||||
|
||||
/**
|
||||
* 在执行周期内
|
||||
*/
|
||||
private boolean withinCycle;
|
||||
|
||||
/**
|
||||
* 所有内容可编辑
|
||||
*/
|
||||
private boolean editable;
|
||||
|
||||
private Long oid;
|
||||
|
||||
}
|
||||
@@ -146,6 +146,12 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>extensions-sync</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -41,6 +41,7 @@ public class Configuration {
|
||||
private String sshPassword;
|
||||
private String sshKey;
|
||||
private String sshKeyPassword;
|
||||
private String version;
|
||||
|
||||
|
||||
public String getLHost(){
|
||||
|
||||
39
sdk/extensions/extensions-sync/pom.xml
Normal file
39
sdk/extensions/extensions-sync/pom.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>extensions</artifactId>
|
||||
<version>${dataease.version}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>extensions-sync</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>extensions-datasource</artifactId>
|
||||
<version>${dataease.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcraft</groupId>
|
||||
<artifactId>jsch</artifactId>
|
||||
<version>${jsch.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>fit2cloud-public</id>
|
||||
<name>Fit2cloud Public</name>
|
||||
<url>https://repository.fit2cloud.com/repository/fit2cloud-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
||||
@@ -14,6 +14,7 @@
|
||||
<module>extensions-view</module>
|
||||
<module>extensions-datasource</module>
|
||||
<module>extensions-datafilling</module>
|
||||
<module>extensions-sync</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>extensions</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user