From 6611999393ffe0d75eed1ca45df6f67f22b9b5d1 Mon Sep 17 00:00:00 2001 From: kalencaya <1942460489@qq.com> Date: Thu, 22 Feb 2024 08:20:54 +0800 Subject: [PATCH] [Feature][scaleph-workspace-seatunnel] update seatunnel module and web (#691) * feature: refactor ws_flink_artifact_cdc * refactor: refactor ws_flink_artifact_cdc * refactor: refactor ws_di_job * feature: refactor ws_di_job * feature: refactor ws_di_job --------- Co-authored-by: wangqi --- ...java => WsArtifactFlinkCDCController.java} | 80 ++++---- ...java => WsArtifactFlinkJarController.java} | 2 +- ...java => WsArtifactFlinkSqlController.java} | 6 +- .../ws/WsArtifactSeaTunnelController.java | 130 ++++++++++++ .../api/controller/ws/WsDiJobController.java | 14 +- .../controller/ws/WsSeaTunnelController.java | 54 ----- .../dict/seatunnel/SeaTunnelVersion.java | 4 + ...tifactCDC.java => WsArtifactFlinkCDC.java} | 18 +- .../entity/master/ws/WsArtifactSeaTunnel.java | 66 +++++++ ...per.java => WsArtifactFlinkCDCMapper.java} | 14 +- .../master/ws/WsArtifactSeaTunnelMapper.java | 48 +++++ .../master/ws/WsArtifactFlinkCDCMapper.xml | 90 +++++++++ .../master/ws/WsArtifactFlinkSqlMapper.xml | 17 ++ .../master/ws/WsArtifactSeaTunnelMapper.xml | 94 +++++++++ .../master/ws/WsFlinkArtifactCDCMapper.xml | 105 ---------- .../sliew/scaleph/dag/service/dto/DagDTO.java | 7 - .../generator/MybatisPlusGenerator.java | 2 +- .../src/locales/zh-CN/pages/project.ts | 5 +- .../Workspace/Artifact/CDC/Dag/index.tsx | 6 +- .../Artifact/CDC/FlinkArtifactCDCForm.tsx | 129 ++++++------ .../Project/Workspace/Artifact/CDC/index.tsx | 42 ++-- .../Artifact/DI/DiJobFlow/Dag/dnd/dnd.tsx | 8 +- .../DI/DiJobFlow/Dag/menubar/index.tsx | 11 +- .../DI/DiJobFlow/Dag/menubar/seatunnel.tsx | 9 +- .../DI/DiJobFlow/Dag/node/init-node.tsx | 170 ++++++++-------- .../Workspace/Artifact/DI/DiJobFlow/index.tsx | 15 +- .../DI/DiJobView/ArtifactSeaTunnelForm.tsx | 82 ++++++++ .../DI/DiJobView/components/DiJobForm.tsx | 99 ---------- .../Workspace/Artifact/DI/DiJobView/index.tsx | 179 +++++++++-------- .../Artifact/Jar/FlinkArtifactJarAddForm.tsx | 4 +- .../Jar/FlinkArtifactJarUpdateForm.tsx | 4 +- .../Workspace/Artifact/Jar/History/index.tsx | 8 +- .../Project/Workspace/Artifact/Jar/index.tsx | 8 +- .../Artifact/Sql/CodeEditor/Editor/index.tsx | 2 +- .../Artifact/Sql/FlinkArtifactSqlForm.tsx | 2 +- .../Project/Workspace/Artifact/Sql/index.tsx | 2 +- .../Workspace/Kubernetes/Job/JobForm.tsx | 6 +- .../src/services/project/SeaTunnelService.ts | 12 -- .../project/WsArtifactFlinkCDCService.ts | 97 +++++++++ ...ervice.ts => WsArtifactFlinkJarService.ts} | 24 +-- ...ervice.ts => WsArtifactFlinkSqlService.ts} | 0 .../project/WsArtifactSeaTunnelService.ts | 96 +++++++++ .../src/services/project/WsFlinkCDCService.ts | 69 ------- .../services/project/flinkArtifact.service.ts | 42 ---- .../src/services/project/typings.d.ts | 95 +++++++-- ...ce.java => WsArtifactFlinkCDCService.java} | 27 ++- ...rt.java => WsArtifactFlinkCDCConvert.java} | 22 +-- ...CDCDTO.java => WsArtifactFlinkCDCDTO.java} | 6 +- .../service/impl/FlinkCDCJobServiceImpl.java | 160 --------------- .../impl/WsArtifactFlinkCDCServiceImpl.java | 168 ++++++++++++++++ ...m.java => WsArtifactFlinkCDCAddParam.java} | 6 +- .../WsArtifactFlinkCDCArtifactParam.java | 33 ++++ ...java => WsArtifactFlinkCDCGraphParam.java} | 2 +- ....java => WsArtifactFlinkCDCListParam.java} | 2 +- ...=> WsArtifactFlinkCDCSelectListParam.java} | 2 +- ...ava => WsArtifactFlinkCDCUpdateParam.java} | 6 +- .../impl/WsArtifactFlinkSqlServiceImpl.java | 2 +- .../service/SeaTunnelDagService.java | 11 ++ .../service/SeatunnelJobService.java | 8 - .../service/WsArtifactSeaTunnelService.java | 55 ++++++ .../convert/WsArtifactSeaTunnelConvert.java | 50 +++++ .../seatunnel/service/dto/DagNodeDTO.java | 47 ----- .../service/dto/WsArtifactSeaTunnelDTO.java | 57 ++++++ .../service/impl/SeaTunnelDagServiceImpl.java | 30 ++- .../service/impl/SeatunnelJobServiceImpl.java | 73 ------- .../impl/WsArtifactSeaTunnelServiceImpl.java | 185 ++++++++++++++++++ .../param/WsArtifactSeaTunnelAddParam.java | 27 +++ .../WsArtifactSeaTunnelArtifactParam.java} | 16 +- .../param/WsArtifactSeaTunnelGraphParam.java | 40 ++++ .../param/WsArtifactSeaTunnelListParam.java | 38 ++++ .../WsArtifactSeaTunnelSelectListParam.java | 35 ++++ .../param/WsArtifactSeaTunnelUpdateParam.java | 27 +++ .../seatunnel/service/vo/DagPanalVO.java | 49 ----- .../seatunnel/service/vo/DiJobRunVO.java | 49 ----- .../docker/mysql/init.d/scaleph-ws-mysql.sql | 32 ++- 75 files changed, 2010 insertions(+), 1232 deletions(-) rename scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/{WsFlinkCDCController.java => WsArtifactFlinkCDCController.java} (59%) rename scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/{WsArtifactJarController.java => WsArtifactFlinkJarController.java} (99%) rename scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/{WsArtifactSqlController.java => WsArtifactFlinkSqlController.java} (95%) create mode 100644 scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactSeaTunnelController.java delete mode 100644 scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsSeaTunnelController.java rename scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/{WsFlinkArtifactCDC.java => WsArtifactFlinkCDC.java} (75%) create mode 100644 scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsArtifactSeaTunnel.java rename scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/{WsFlinkArtifactCDCMapper.java => WsArtifactFlinkCDCMapper.java} (77%) create mode 100644 scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.java create mode 100644 scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkCDCMapper.xml create mode 100644 scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.xml delete mode 100644 scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsFlinkArtifactCDCMapper.xml create mode 100644 scaleph-ui-react2/src/pages/Project/Workspace/Artifact/DI/DiJobView/ArtifactSeaTunnelForm.tsx delete mode 100644 scaleph-ui-react2/src/pages/Project/Workspace/Artifact/DI/DiJobView/components/DiJobForm.tsx delete mode 100644 scaleph-ui-react2/src/services/project/SeaTunnelService.ts create mode 100644 scaleph-ui-react2/src/services/project/WsArtifactFlinkCDCService.ts rename scaleph-ui-react2/src/services/project/{flinkArtifactJar.service.ts => WsArtifactFlinkJarService.ts} (66%) rename scaleph-ui-react2/src/services/project/{WsFlinkArtifactSqlService.ts => WsArtifactFlinkSqlService.ts} (100%) create mode 100644 scaleph-ui-react2/src/services/project/WsArtifactSeaTunnelService.ts delete mode 100644 scaleph-ui-react2/src/services/project/WsFlinkCDCService.ts delete mode 100644 scaleph-ui-react2/src/services/project/flinkArtifact.service.ts rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/{FlinkCDCJobService.java => WsArtifactFlinkCDCService.java} (53%) rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/convert/{WsFlinkArtifactCDCConvert.java => WsArtifactFlinkCDCConvert.java} (62%) rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/dto/{WsFlinkArtifactCDCDTO.java => WsArtifactFlinkCDCDTO.java} (90%) delete mode 100644 scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/impl/FlinkCDCJobServiceImpl.java create mode 100644 scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/impl/WsArtifactFlinkCDCServiceImpl.java rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/param/{WsFlinkArtifactCDCAddParam.java => WsArtifactFlinkCDCAddParam.java} (79%) create mode 100644 scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/param/WsArtifactFlinkCDCArtifactParam.java rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/param/{WsFlinkArtifactCDCGraphParam.java => WsArtifactFlinkCDCGraphParam.java} (96%) rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/param/{WsFlinkArtifactCDCListParam.java => WsArtifactFlinkCDCListParam.java} (95%) rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/param/{WsFlinkArtifactCDCSelectListParam.java => WsArtifactFlinkCDCSelectListParam.java} (95%) rename scaleph-workspace/scaleph-workspace-flink-cdc/src/main/java/cn/sliew/scaleph/workspace/flink/cdc/service/param/{WsFlinkArtifactCDCUpdateParam.java => WsArtifactFlinkCDCUpdateParam.java} (79%) create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/WsArtifactSeaTunnelService.java create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/convert/WsArtifactSeaTunnelConvert.java delete mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/dto/DagNodeDTO.java create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/dto/WsArtifactSeaTunnelDTO.java create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/impl/WsArtifactSeaTunnelServiceImpl.java create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/param/WsArtifactSeaTunnelAddParam.java rename scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/{dto/DagPanelDTO.java => param/WsArtifactSeaTunnelArtifactParam.java} (73%) create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/param/WsArtifactSeaTunnelGraphParam.java create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/param/WsArtifactSeaTunnelListParam.java create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/param/WsArtifactSeaTunnelSelectListParam.java create mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/param/WsArtifactSeaTunnelUpdateParam.java delete mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/vo/DagPanalVO.java delete mode 100644 scaleph-workspace/scaleph-workspace-seatunnel/src/main/java/cn/sliew/scaleph/workspace/seatunnel/service/vo/DiJobRunVO.java diff --git a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsFlinkCDCController.java b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkCDCController.java similarity index 59% rename from scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsFlinkCDCController.java rename to scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkCDCController.java index ff13f7cb1..1249764da 100644 --- a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsFlinkCDCController.java +++ b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkCDCController.java @@ -21,15 +21,11 @@ import cn.sliew.scaleph.api.annotation.Logging; import cn.sliew.scaleph.common.exception.ScalephException; import cn.sliew.scaleph.dag.xflow.dnd.DndDTO; -import cn.sliew.scaleph.workspace.flink.cdc.service.FlinkCDCDagService; -import cn.sliew.scaleph.workspace.flink.cdc.service.FlinkCDCJobService; -import cn.sliew.scaleph.workspace.flink.cdc.service.dto.WsFlinkArtifactCDCDTO; -import cn.sliew.scaleph.workspace.flink.cdc.service.param.WsFlinkArtifactCDCAddParam; -import cn.sliew.scaleph.workspace.flink.cdc.service.param.WsFlinkArtifactCDCListParam; -import cn.sliew.scaleph.workspace.flink.cdc.service.param.WsFlinkArtifactCDCSelectListParam; -import cn.sliew.scaleph.workspace.flink.cdc.service.param.WsFlinkArtifactCDCUpdateParam; -import cn.sliew.scaleph.plugin.framework.exception.PluginException; import cn.sliew.scaleph.system.model.ResponseVO; +import cn.sliew.scaleph.workspace.flink.cdc.service.FlinkCDCDagService; +import cn.sliew.scaleph.workspace.flink.cdc.service.WsArtifactFlinkCDCService; +import cn.sliew.scaleph.workspace.flink.cdc.service.dto.WsArtifactFlinkCDCDTO; +import cn.sliew.scaleph.workspace.flink.cdc.service.param.*; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -42,53 +38,61 @@ import javax.validation.Valid; import java.util.List; -@Tag(name = "Flink CDC") +@Tag(name = "Artifact管理-Flink-CDC") @RestController -@RequestMapping(path = "/api/flink-cdc") -public class WsFlinkCDCController { +@RequestMapping(path = "/api/artifact/flink/cdc") +public class WsArtifactFlinkCDCController { @Autowired private FlinkCDCDagService flinkCDCDagService; @Autowired - private FlinkCDCJobService flinkCDCJobService; - - @Logging - @GetMapping("/dag/dnd") - @Operation(summary = "查询DAG节点元信息", description = "后端统一返回节点信息") - public ResponseEntity>> loadNodeMeta() throws PluginException { - List dnds = flinkCDCDagService.getDnds(); - return new ResponseEntity<>(ResponseVO.success(dnds), HttpStatus.OK); - } + private WsArtifactFlinkCDCService wsArtifactFlinkCDCService; @Logging @GetMapping @Operation(summary = "查询 fink cdc 列表", description = "分页查询 fink cdc 列表") - public ResponseEntity> listJob(@Valid WsFlinkArtifactCDCListParam param) { - Page page = flinkCDCJobService.listByPage(param); + public ResponseEntity> list(@Valid WsArtifactFlinkCDCListParam param) { + Page page = wsArtifactFlinkCDCService.list(param); return new ResponseEntity<>(page, HttpStatus.OK); } + @Logging + @GetMapping("/history") + @Operation(summary = "根据 artifact 分页查询 fink cdc 列表", description = "根据 artifact 分页查询 fink cdc 列表") + public ResponseEntity> listByArtifact(@Valid WsArtifactFlinkCDCArtifactParam param) { + Page result = wsArtifactFlinkCDCService.listByArtifact(param); + return new ResponseEntity<>(result, HttpStatus.OK); + } + @Logging @GetMapping("/all") @Operation(summary = "查询 fink cdc 列表", description = "查询 fink cdc 列表") - public ResponseEntity> listAll(@Valid WsFlinkArtifactCDCSelectListParam param) { - List result = flinkCDCJobService.listAll(param); + public ResponseEntity> listAll(@Valid WsArtifactFlinkCDCSelectListParam param) { + List result = wsArtifactFlinkCDCService.listAll(param); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @Logging + @GetMapping("/{id}") + @Operation(summary = "查询 flink cdc 详情", description = "查询 flink cdc 详情") + public ResponseEntity selectOne(@PathVariable("id") Long id) { + WsArtifactFlinkCDCDTO result = wsArtifactFlinkCDCService.selectOne(id); return new ResponseEntity<>(result, HttpStatus.OK); } @Logging @PutMapping @Operation(summary = "新增 fink cdc", description = "新增 fink cdc,不涉及 DAG") - public ResponseEntity> simpleAddJob(@Validated @RequestBody WsFlinkArtifactCDCAddParam param) { - WsFlinkArtifactCDCDTO wsFlinkArtifactCDCDTO = flinkCDCJobService.insert(param); + public ResponseEntity> insert(@Validated @RequestBody WsArtifactFlinkCDCAddParam param) { + WsArtifactFlinkCDCDTO wsFlinkArtifactCDCDTO = wsArtifactFlinkCDCService.insert(param); return new ResponseEntity<>(ResponseVO.success(wsFlinkArtifactCDCDTO), HttpStatus.CREATED); } @Logging @PostMapping @Operation(summary = "修改 fink cdc", description = "只修改 fink cdc 属性,不涉及 DAG") - public ResponseEntity simpleEditJob(@Validated @RequestBody WsFlinkArtifactCDCUpdateParam param) { - flinkCDCJobService.update(param); + public ResponseEntity update(@Validated @RequestBody WsArtifactFlinkCDCUpdateParam param) { + wsArtifactFlinkCDCService.update(param); return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); } @@ -96,7 +100,7 @@ public ResponseEntity simpleEditJob(@Validated @RequestBody WsFlinkA @DeleteMapping("{id}") @Operation(summary = "删除 fink cdc", description = "删除 fink cdc") public ResponseEntity deleteJob(@PathVariable("id") Long id) throws ScalephException { - flinkCDCJobService.delete(id); + wsArtifactFlinkCDCService.delete(id); return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); } @@ -104,15 +108,23 @@ public ResponseEntity deleteJob(@PathVariable("id") Long id) throws @DeleteMapping("batch") @Operation(summary = "批量删除 fink cdc", description = "批量删除 fink cdc") public ResponseEntity deleteBatch(@RequestBody List ids) throws ScalephException { - flinkCDCJobService.deleteBatch(ids); + wsArtifactFlinkCDCService.deleteBatch(ids); return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); } @Logging - @DeleteMapping("all") - @Operation(summary = "批量删除 fink cdc", description = "批量删除 fink cdc") - public ResponseEntity deleteAll(@RequestParam("flinkArtifactId") Long flinkArtifactId) throws ScalephException { - flinkCDCJobService.deleteAll(flinkArtifactId); + @DeleteMapping("artifact/{artifactId}") + @Operation(summary = "删除 artifact", description = "删除 artifact") + public ResponseEntity deleteArtifact(@PathVariable("artifactId") Long artifactId) throws ScalephException { + wsArtifactFlinkCDCService.deleteArtifact(artifactId); return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); } + + @Logging + @GetMapping("/dag/dnd") + @Operation(summary = "查询DAG节点元信息", description = "后端统一返回节点信息") + public ResponseEntity>> loadNodeMeta() { + List dnds = flinkCDCDagService.getDnds(); + return new ResponseEntity<>(ResponseVO.success(dnds), HttpStatus.OK); + } } \ No newline at end of file diff --git a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactJarController.java b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkJarController.java similarity index 99% rename from scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactJarController.java rename to scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkJarController.java index 5232e81cd..9281a7007 100644 --- a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactJarController.java +++ b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkJarController.java @@ -42,7 +42,7 @@ @Tag(name = "Artifact管理-Flink-Jar") @RestController @RequestMapping(path = "/api/artifact/flink/jar") -public class WsArtifactJarController { +public class WsArtifactFlinkJarController { @Autowired private WsArtifactFlinkJarService wsArtifactFlinkJarService; diff --git a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactSqlController.java b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkSqlController.java similarity index 95% rename from scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactSqlController.java rename to scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkSqlController.java index b98421ce7..57d8e106f 100644 --- a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactSqlController.java +++ b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactFlinkSqlController.java @@ -37,7 +37,7 @@ @Tag(name = "Artifact管理-Flink-Sql") @RestController @RequestMapping(path = "/api/artifact/flink/sql") -public class WsArtifactSqlController { +public class WsArtifactFlinkSqlController { @Autowired private WsArtifactFlinkSqlService wsArtifactFlinkSqlService; @@ -108,8 +108,8 @@ public ResponseEntity delete(@PathVariable("id") Long id) { @Logging @DeleteMapping("/artifact/{artifactId}") - @Operation(summary = "删除所有 flink sql", description = "删除所有 flink sql") - public ResponseEntity deleteAll(@PathVariable("artifactId") Long artifactId) { + @Operation(summary = "删除 artifact", description = "删除 artifactl") + public ResponseEntity deleteArtifact(@PathVariable("artifactId") Long artifactId) { wsArtifactFlinkSqlService.deleteArtifact(artifactId); return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); } diff --git a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactSeaTunnelController.java b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactSeaTunnelController.java new file mode 100644 index 000000000..ace9b56b3 --- /dev/null +++ b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactSeaTunnelController.java @@ -0,0 +1,130 @@ +/* + * 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 cn.sliew.scaleph.api.controller.ws; + +import cn.sliew.scaleph.api.annotation.Logging; +import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelEngineType; +import cn.sliew.scaleph.dag.xflow.dnd.DndDTO; +import cn.sliew.scaleph.plugin.framework.exception.PluginException; +import cn.sliew.scaleph.system.model.ResponseVO; +import cn.sliew.scaleph.workspace.seatunnel.service.SeaTunnelDagService; +import cn.sliew.scaleph.workspace.seatunnel.service.WsArtifactSeaTunnelService; +import cn.sliew.scaleph.workspace.seatunnel.service.dto.WsArtifactSeaTunnelDTO; +import cn.sliew.scaleph.workspace.seatunnel.service.param.*; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +@Tag(name = "Artifact管理-SeaTunnel") +@RestController +@RequestMapping(path = "/api/artifact/seatunnel") +public class WsArtifactSeaTunnelController { + + @Autowired + private WsArtifactSeaTunnelService wsArtifactSeaTunnelService; + @Autowired + private SeaTunnelDagService seaTunnelDagService; + + @Logging + @GetMapping + @Operation(summary = "查询 seatunnel 列表", description = "查询 seatunnel 列表") + public ResponseEntity> list(@Valid WsArtifactSeaTunnelListParam param) { + Page result = wsArtifactSeaTunnelService.list(param); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @Logging + @GetMapping("/history") + @Operation(summary = "根据 artifact 分页查询 seatunnel 列表", description = "根据 artifact 分页查询 seatunnel 列表") + public ResponseEntity> listByArtifact(@Valid WsArtifactSeaTunnelArtifactParam param) { + Page result = wsArtifactSeaTunnelService.listByArtifact(param); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @Logging + @GetMapping("/all") + @Operation(summary = "查询 seatunnel 列表", description = "查询 seatunnel 列表") + public ResponseEntity> listAll(@Valid WsArtifactSeaTunnelSelectListParam param) { + List result = wsArtifactSeaTunnelService.listAll(param); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @Logging + @GetMapping("/{id}") + @Operation(summary = "查询 seatunnel 详情", description = "查询 seatunnel 详情") + public ResponseEntity selectOne(@PathVariable("id") Long id) { + WsArtifactSeaTunnelDTO result = wsArtifactSeaTunnelService.selectOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @Logging + @PutMapping + @Operation(summary = "新增 seatunnel", description = "新增 seatunnel") + public ResponseEntity> insert(@RequestBody @Valid WsArtifactSeaTunnelAddParam param) { + WsArtifactSeaTunnelDTO dto = wsArtifactSeaTunnelService.insert(param); + return new ResponseEntity<>(ResponseVO.success(dto), HttpStatus.OK); + } + + @Logging + @PostMapping + @Operation(summary = "修改 seatunnel", description = "修改 seatunnel") + public ResponseEntity update(@RequestBody @Valid WsArtifactSeaTunnelUpdateParam param) { + wsArtifactSeaTunnelService.update(param); + return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); + } + + @Logging + @PostMapping("graph") + @Operation(summary = "修改 seatunnel graph", description = "修改 seatunnel graph") + public ResponseEntity updateGraph(@RequestBody @Valid WsArtifactSeaTunnelGraphParam param) { + wsArtifactSeaTunnelService.updateGraph(param); + return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); + } + + @Logging + @DeleteMapping("/{id}") + @Operation(summary = "删除 seatunnel", description = "删除 seatunnel") + public ResponseEntity delete(@PathVariable("id") Long id) { + wsArtifactSeaTunnelService.delete(id); + return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); + } + + @Logging + @DeleteMapping("/artifact/{artifactId}") + @Operation(summary = "删除 artifact", description = "删除 artifactl") + public ResponseEntity deleteArtifact(@PathVariable("artifactId") Long artifactId) { + wsArtifactSeaTunnelService.deleteArtifact(artifactId); + return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); + } + + @Logging + @GetMapping("/dag/dnd/{type}") + @Operation(summary = "查询DAG节点元信息", description = "后端统一返回节点信息") + public ResponseEntity>> loadNodeMeta(@PathVariable("type") SeaTunnelEngineType type) throws PluginException { + List dnds = seaTunnelDagService.getDnds(type); + return new ResponseEntity<>(ResponseVO.success(dnds), HttpStatus.OK); + } +} \ No newline at end of file diff --git a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsDiJobController.java b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsDiJobController.java index f65fe7f0d..fa91ecd09 100644 --- a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsDiJobController.java +++ b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsDiJobController.java @@ -19,16 +19,13 @@ package cn.sliew.scaleph.api.controller.ws; import cn.sliew.scaleph.api.annotation.Logging; -import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelEngineType; import cn.sliew.scaleph.common.exception.ScalephException; +import cn.sliew.scaleph.system.model.ResponseVO; import cn.sliew.scaleph.workspace.seatunnel.service.SeatunnelJobService; import cn.sliew.scaleph.workspace.seatunnel.service.WsDiJobService; -import cn.sliew.scaleph.workspace.seatunnel.service.dto.DagPanelDTO; import cn.sliew.scaleph.workspace.seatunnel.service.dto.WsDiJobDTO; import cn.sliew.scaleph.workspace.seatunnel.service.param.*; import cn.sliew.scaleph.workspace.seatunnel.service.vo.DiJobAttrVO; -import cn.sliew.scaleph.plugin.framework.exception.PluginException; -import cn.sliew.scaleph.system.model.ResponseVO; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -159,13 +156,4 @@ public ResponseEntity previewJob(@PathVariable("id") Long id) throws String conf = seatunnelJobService.preview(id); return new ResponseEntity<>(ResponseVO.success(conf), HttpStatus.OK); } - - @Logging - @GetMapping("/node/meta/{type}") - @Operation(summary = "查询DAG节点元信息", description = "后端统一返回节点信息") - @PreAuthorize("@svs.validate(T(cn.sliew.scaleph.common.constant.PrivilegeConstants).DATADEV_JOB_SELECT)") - public ResponseEntity> loadNodeMeta(@PathVariable("type") SeaTunnelEngineType type) throws PluginException { - List list = seatunnelJobService.loadDndPanelInfo(type); - return new ResponseEntity<>(list, HttpStatus.OK); - } } \ No newline at end of file diff --git a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsSeaTunnelController.java b/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsSeaTunnelController.java deleted file mode 100644 index 5fb6898c1..000000000 --- a/scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsSeaTunnelController.java +++ /dev/null @@ -1,54 +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 cn.sliew.scaleph.api.controller.ws; - -import cn.sliew.scaleph.api.annotation.Logging; -import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelEngineType; -import cn.sliew.scaleph.dag.xflow.dnd.DndDTO; -import cn.sliew.scaleph.workspace.seatunnel.service.SeaTunnelDagService; -import cn.sliew.scaleph.plugin.framework.exception.PluginException; -import cn.sliew.scaleph.system.model.ResponseVO; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@Tag(name = "SeaTunnel") -@RestController -@RequestMapping(path = {"/api/seatunnel", "/api/seatunnel"}) -public class WsSeaTunnelController { - - @Autowired - private SeaTunnelDagService seaTunnelDagService; - - @Logging - @GetMapping("/dag/dnd/{type}") - @Operation(summary = "查询DAG节点元信息", description = "后端统一返回节点信息") - public ResponseEntity>> loadNodeMeta(@PathVariable("type") SeaTunnelEngineType type) throws PluginException { - List dnds = seaTunnelDagService.getDnds(type); - return new ResponseEntity<>(ResponseVO.success(dnds), HttpStatus.OK); - } -} \ No newline at end of file diff --git a/scaleph-common/src/main/java/cn/sliew/scaleph/common/dict/seatunnel/SeaTunnelVersion.java b/scaleph-common/src/main/java/cn/sliew/scaleph/common/dict/seatunnel/SeaTunnelVersion.java index b9614040d..c9f911a20 100644 --- a/scaleph-common/src/main/java/cn/sliew/scaleph/common/dict/seatunnel/SeaTunnelVersion.java +++ b/scaleph-common/src/main/java/cn/sliew/scaleph/common/dict/seatunnel/SeaTunnelVersion.java @@ -38,6 +38,10 @@ public static SeaTunnelVersion of(String value) { .findAny().orElseThrow(() -> new EnumConstantNotPresentException(SeaTunnelVersion.class, value)); } + public static SeaTunnelVersion current() { + return values()[values().length - 1]; + } + @EnumValue private String value; private String label; diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsFlinkArtifactCDC.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsArtifactFlinkCDC.java similarity index 75% rename from scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsFlinkArtifactCDC.java rename to scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsArtifactFlinkCDC.java index 669c6edd5..f7ae5fc9a 100644 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsFlinkArtifactCDC.java +++ b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsArtifactFlinkCDC.java @@ -24,38 +24,32 @@ import cn.sliew.scaleph.dao.entity.BaseDO; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** - * flink artifact cdc + * artifact flink-cdc */ @Data -@TableName("ws_flink_artifact_cdc") -@Schema(name = "WsFlinkArtifactCDC", description = "flink artifact cdc") -public class WsFlinkArtifactCDC extends BaseDO { +@TableName("ws_artifact_flink_cdc") +public class WsArtifactFlinkCDC extends BaseDO { private static final long serialVersionUID = 1L; - @Schema(description = "作业artifact id") - @TableField("flink_artifact_id") - private Long flinkArtifactId; + @TableField("artifact_id") + private Long artifactId; @TableField(exist = false) - private WsArtifact wsArtifact; + private WsArtifact artifact; - @Schema(description = "flink版本") @TableField("flink_version") private FlinkVersion flinkVersion; - @Schema(description = "作业引擎") @TableField("flink_cdc_version") private FlinkCDCVersion flinkCDCVersion; @TableField("dag_id") private Long dagId; - @Schema(description = "current artifact") @TableField("`current`") private YesOrNo current; } diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsArtifactSeaTunnel.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsArtifactSeaTunnel.java new file mode 100644 index 000000000..3207b79b5 --- /dev/null +++ b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsArtifactSeaTunnel.java @@ -0,0 +1,66 @@ +/* + * 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 cn.sliew.scaleph.dao.entity.master.ws; + +import cn.sliew.scaleph.common.dict.common.YesOrNo; +import cn.sliew.scaleph.common.dict.flink.FlinkVersion; +import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelEngineType; +import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelVersion; +import cn.sliew.scaleph.dao.entity.BaseDO; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * artifact seatunnel + */ +@Data +@TableName("ws_artifact_seatunnel") +@Schema(name = "WsArtifactSeaTunnel", description = "artifact seatunnel") +public class WsArtifactSeaTunnel extends BaseDO { + + private static final long serialVersionUID = 1L; + + @Schema(description = "作业artifact id") + @TableField("artifact_id") + private Long artifactId; + + @TableField(exist = false) + private WsArtifact artifact; + + @Schema(description = "seatunnel 引擎") + @TableField("seatunnel_engine") + private SeaTunnelEngineType seaTunnelEngine; + + @Schema(description = "flink 版本") + @TableField("flink_version") + private FlinkVersion flinkVersion; + + @Schema(description = "seatunnel 版本") + @TableField("seatunnel_version") + private SeaTunnelVersion seaTunnelVersion; + + @TableField("dag_id") + private Long dagId; + + @Schema(description = "current artifact") + @TableField("`current`") + private YesOrNo current; +} diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsFlinkArtifactCDCMapper.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkCDCMapper.java similarity index 77% rename from scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsFlinkArtifactCDCMapper.java rename to scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkCDCMapper.java index c15fd2ccf..c8b8794ae 100644 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsFlinkArtifactCDCMapper.java +++ b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkCDCMapper.java @@ -19,7 +19,7 @@ package cn.sliew.scaleph.dao.mapper.master.ws; import cn.sliew.scaleph.common.dict.flink.FlinkVersion; -import cn.sliew.scaleph.dao.entity.master.ws.WsFlinkArtifactCDC; +import cn.sliew.scaleph.dao.entity.master.ws.WsArtifactFlinkCDC; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Param; @@ -28,20 +28,20 @@ import java.util.List; /** - * flink artifact cdc Mapper 接口 + * artifact flink-cdc Mapper 接口 */ @Repository -public interface WsFlinkArtifactCDCMapper extends BaseMapper { +public interface WsArtifactFlinkCDCMapper extends BaseMapper { - Page list(Page page, + Page list(Page page, @Param("projectId") Long projectId, @Param("name") String name, @Param("flinkVersion") FlinkVersion flinkVersion); - List listAll(@Param("projectId") Long projectId, + List listAll(@Param("projectId") Long projectId, @Param("name") String name); - WsFlinkArtifactCDC selectOne(@Param("id") Long id); + WsArtifactFlinkCDC selectOne(@Param("id") Long id); - WsFlinkArtifactCDC selectCurrent(@Param("artifactId") Long artifactId); + WsArtifactFlinkCDC selectCurrent(@Param("artifactId") Long artifactId); } diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.java new file mode 100644 index 000000000..8bf010b83 --- /dev/null +++ b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.java @@ -0,0 +1,48 @@ +/* + * 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 cn.sliew.scaleph.dao.mapper.master.ws; + +import cn.sliew.scaleph.common.dict.flink.FlinkVersion; +import cn.sliew.scaleph.dao.entity.master.ws.WsArtifactFlinkCDC; +import cn.sliew.scaleph.dao.entity.master.ws.WsArtifactSeaTunnel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * artifact seatunnel Mapper 接口 + */ +@Repository +public interface WsArtifactSeaTunnelMapper extends BaseMapper { + + Page list(Page page, + @Param("projectId") Long projectId, + @Param("name") String name, + @Param("flinkVersion") FlinkVersion flinkVersion); + + List listAll(@Param("projectId") Long projectId, + @Param("name") String name); + + WsArtifactSeaTunnel selectOne(@Param("id") Long id); + + WsArtifactSeaTunnel selectCurrent(@Param("artifactId") Long artifactId); +} diff --git a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkCDCMapper.xml b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkCDCMapper.xml new file mode 100644 index 000000000..bd3cb18d5 --- /dev/null +++ b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkCDCMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + id, creator, create_time, editor, update_time, + artifact_id, flink_version, flink_cdc_version, dag_id, `current` + + + + + + + + + + diff --git a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkSqlMapper.xml b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkSqlMapper.xml index fd1dbfe90..0c0a7ba8a 100644 --- a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkSqlMapper.xml +++ b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactFlinkSqlMapper.xml @@ -1,4 +1,21 @@ + + diff --git a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.xml b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.xml new file mode 100644 index 000000000..1d665cf89 --- /dev/null +++ b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsArtifactSeaTunnelMapper.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + id, + creator, + create_time, + editor, + update_time, + artifact_id, + seatunnel_engine, + flink_version, + seatunnel_version, + dag_id, + `current` + + + + + + + + + + diff --git a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsFlinkArtifactCDCMapper.xml b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsFlinkArtifactCDCMapper.xml deleted file mode 100644 index 84aa067b9..000000000 --- a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsFlinkArtifactCDCMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, - creator, - create_time, - editor, - update_time, - flink_artifact_id, flink_version, flink_cdc_version, dag_id, `current` - - - - - - - - - - - diff --git a/scaleph-support/scaleph-dag/src/main/java/cn/sliew/scaleph/dag/service/dto/DagDTO.java b/scaleph-support/scaleph-dag/src/main/java/cn/sliew/scaleph/dag/service/dto/DagDTO.java index 916250477..291e2414f 100644 --- a/scaleph-support/scaleph-dag/src/main/java/cn/sliew/scaleph/dag/service/dto/DagDTO.java +++ b/scaleph-support/scaleph-dag/src/main/java/cn/sliew/scaleph/dag/service/dto/DagDTO.java @@ -18,7 +18,6 @@ package cn.sliew.scaleph.dag.service.dto; -import com.fasterxml.jackson.databind.JsonNode; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -31,12 +30,6 @@ @Schema(name = "Dag", description = "DAG") public class DagDTO extends DagInstanceDTO { - @Schema(description = "元数据") - private JsonNode dagMeta; - - @Schema(description = "属性") - private JsonNode dagAttrs; - @Schema(description = "连线") private List links; diff --git a/scaleph-support/scaleph-generator/src/main/java/cn/sliew/scaleph/generator/MybatisPlusGenerator.java b/scaleph-support/scaleph-generator/src/main/java/cn/sliew/scaleph/generator/MybatisPlusGenerator.java index a890e742f..24c59e5fa 100644 --- a/scaleph-support/scaleph-generator/src/main/java/cn/sliew/scaleph/generator/MybatisPlusGenerator.java +++ b/scaleph-support/scaleph-generator/src/main/java/cn/sliew/scaleph/generator/MybatisPlusGenerator.java @@ -54,7 +54,7 @@ public class MybatisPlusGenerator { /** * just add table names here and run the {@link #main(String[])} method. */ - private static final String[] TABLES = {"ws_flink_artifact_cdc"}; + private static final String[] TABLES = {"ws_artifact_seatunnel"}; public static void main(String[] args) { //自动生成配置 diff --git a/scaleph-ui-react2/src/locales/zh-CN/pages/project.ts b/scaleph-ui-react2/src/locales/zh-CN/pages/project.ts index 6a866bece..ce94da61a 100644 --- a/scaleph-ui-react2/src/locales/zh-CN/pages/project.ts +++ b/scaleph-ui-react2/src/locales/zh-CN/pages/project.ts @@ -23,9 +23,10 @@ export default { 'pages.project.artifact.sql': 'SQL', 'pages.project.artifact.seatunnel': 'SeaTunnel', - 'pages.project.artifact.seatunnel.jobEngine': 'Engine', + 'pages.project.artifact.seatunnel.seaTunnelEngine': 'Engine', + 'pages.project.artifact.seatunnel.seaTunnelVersion': 'SeaTunnel 版本', 'pages.project.artifact.cdc': 'CDC', - 'pages.project.artifact.cdc.flinkCDCVersion': 'Flink CDC Version', + 'pages.project.artifact.cdc.flinkCDCVersion': 'Flink CDC 版本', 'pages.project.job.jar': 'Jar', 'pages.project.job.jar.args': 'Main Args', diff --git a/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/Dag/index.tsx b/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/Dag/index.tsx index 372f45ff2..27b5f521d 100644 --- a/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/Dag/index.tsx +++ b/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/Dag/index.tsx @@ -2,17 +2,17 @@ import React from 'react'; import {PageContainer} from "@ant-design/pro-components"; import {useAccess, useIntl, useLocation} from '@umijs/max'; import {WORKSPACE_CONF} from '@/constants/constant'; -import {WsFlinkArtifactCDC} from "@/services/project/typings"; +import {WsArtifactFlinkCDC} from "@/services/project/typings"; const FlinkArtifactCDCDagWeb: React.FC = () => { const intl = useIntl(); const access = useAccess(); - const data = useLocation().state as WsFlinkArtifactCDC; + const data = useLocation().state as WsArtifactFlinkCDC; const projectId = localStorage.getItem(WORKSPACE_CONF.projectId); return ( - Flink CDC Dag Web: {data.wsFlinkArtifact?.name} + Flink CDC Dag Web: {data.artifact?.name} ); }; diff --git a/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/FlinkArtifactCDCForm.tsx b/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/FlinkArtifactCDCForm.tsx index 17efbc781..bb7330c76 100644 --- a/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/FlinkArtifactCDCForm.tsx +++ b/scaleph-ui-react2/src/pages/Project/Workspace/Artifact/CDC/FlinkArtifactCDCForm.tsx @@ -1,97 +1,80 @@ -import {Form, message, Modal} from 'antd'; -import {ProForm, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea} from "@ant-design/pro-components"; +import {Form, message} from 'antd'; +import {ModalForm, ProFormDigit, ProFormText, ProFormTextArea} from "@ant-design/pro-components"; import {useIntl} from '@umijs/max'; import {ModalFormProps} from '@/typings'; import {WORKSPACE_CONF} from '@/constants/constant'; -import {DICT_TYPE} from '@/constants/dictType'; -import {WsFlinkArtifactCDC} from '@/services/project/typings'; -import {DictDataService} from "@/services/admin/dictData.service"; -import {WsFlinkCDCService} from "@/services/project/WsFlinkCDCService"; +import {WsArtifactFlinkCDC} from '@/services/project/typings'; +import {WsArtifactFlinkCDCService} from "@/services/project/WsArtifactFlinkCDCService"; -const FlinkArtifactCDCForm: React.FC> = ({ +const FlinkArtifactCDCForm: React.FC> = ({ data, visible, - onVisibleChange, - onCancel + onVisibleChange }) => { const intl = useIntl(); const [form] = Form.useForm(); const projectId = localStorage.getItem(WORKSPACE_CONF.projectId); return ( - { - form.validateFields().then((values) => { - const param = { - id: values.id, - projectId: projectId, - name: values.name, - remark: values.remark, - flinkVersion: values.flinkVersion, - }; - data?.id - ? WsFlinkCDCService.update(param).then((response) => { - if (response.success) { - message.success(intl.formatMessage({id: 'app.common.operate.edit.success'})); - if (onVisibleChange) { - onVisibleChange(false); - } + layout={"horizontal"} + labelCol={{span: 6}} + wrapperCol={{span: 16}} + modalProps={{ + destroyOnClose: true, + closeIcon: false + }} + onFinish={(values: Record) => { + const param = { + id: values.id, + projectId: projectId, + name: values.name, + remark: values.remark + }; + return values.id + ? WsArtifactFlinkCDCService.update(param).then((response) => { + if (response.success) { + message.success(intl.formatMessage({id: 'app.common.operate.edit.success'})); + if (onVisibleChange) { + onVisibleChange(false); } - }) - : WsFlinkCDCService.add(param).then((response) => { - if (response.success) { - message.success(intl.formatMessage({id: 'app.common.operate.new.success'})); - if (onVisibleChange) { - onVisibleChange(false); - } + } + }) + : WsArtifactFlinkCDCService.add(param).then((response) => { + if (response.success) { + message.success(intl.formatMessage({id: 'app.common.operate.new.success'})); + if (onVisibleChange) { + onVisibleChange(false); } - }) - }); + } + }) }} > - - - +