package io.dataease.api.sync.datasource.api; import com.baomidou.mybatisplus.core.metadata.IPage; 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 org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; import static io.dataease.constant.AuthResourceEnum.SYNC_DATASOURCE; /** * @author fit2cloud * @date 2023/11/20 10:14 **/ @DeApiPath(value = "/sync/datasource", rt = SYNC_DATASOURCE) public interface SyncDatasourceApi { @PostMapping("/source/pager/{goPage}/{pageSize}") IPage sourcePager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody DatasourceGridRequest request); @PostMapping("/target/pager/{goPage}/{pageSize}") IPage targetPager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody DatasourceGridRequest request); @PostMapping("/save") void save(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException; @PostMapping("/update") Map update(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException; @PostMapping("/delete/{datasourceId}") void delete(@PathVariable("datasourceId") String datasourceId) throws DEException; @GetMapping("/types") Object datasourceTypes() throws DEException; @PostMapping("/validate") String validate(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException; @PostMapping("/getSchema") List getSchema(@RequestBody SyncDatasourceDTO dataSourceDTO) throws DEException; @GetMapping("/validate/{datasourceId}") SyncDatasourceDTO validate(@PathVariable("datasourceId") String datasourceId) throws DEException; @PostMapping("/latestUse/{sourceType}") List latestUse(@PathVariable("sourceType") String sourceType); @GetMapping("/get/{datasourceId}") SyncDatasourceDTO get(@PathVariable("datasourceId") String datasourceId) throws DEException; @PostMapping("/batchDel") void batchDel(@RequestBody List ids) throws DEException; @PostMapping("/fields") Map getFields(@RequestBody GetDatasourceRequest getDsRequest) throws DEException; @GetMapping("/list/{type}") List listByType(@PathVariable("type") String type) throws DEException; @GetMapping("/table/list/{dsId}") List getTableList(@PathVariable("dsId") String dsId) throws DEException; @GetMapping("/query2Root/{id}") String query2Root(@PathVariable("id") Long id); @GetMapping("/getLogResourceId/{id}") Long getLogResourceId(@PathVariable("id") String id); }