Skip to content

Commit 5b02857

Browse files
kalencayawangqi
and
wangqi
authored
[Feature][scaleph-workspace] update flink artifact multiple modules (flowerfine#689)
* refactor: add scaleph-workspace * refactor: refactor ws_flink_artifact * refactor: refactor ws_flink_artifact * refactor: refactor ws_flink_artifact_jar * refactor: refactor ws_flink_artifact_jar * refactor: refactor ws_flink_artifact_jar * refactor: refactor ws_flink_artifact_jar * refactor: refactor ws_flink_artifact_sql * refactor: refactor ws_flink_artifact_sql * fix: remove unused imports * fix: npm install timeout * fix: npm install timeout --------- Co-authored-by: wangqi <[email protected]>
1 parent 59229ff commit 5b02857

File tree

192 files changed

+1679
-3373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+1679
-3373
lines changed

lombok.config

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
lombok.addLombokGeneratedAnnotation = true

pom.xml

+11-15
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@
9393
<module>scaleph-resource</module>
9494
<module>scaleph-support</module>
9595
<module>scaleph-config</module>
96-
9796
<module>scaleph-api</module>
9897
<module>scaleph-meta</module>
99-
<module>scaleph-project</module>
98+
10099
<module>scaleph-engine</module>
100+
<module>scaleph-workspace</module>
101101
<module>scaleph-plugins</module>
102102
<module>scaleph-workflow</module>
103103
<module>scaleph-datasource</module>
@@ -260,49 +260,45 @@
260260
<artifactId>scaleph-meta</artifactId>
261261
<version>${project.version}</version>
262262
</dependency>
263-
<dependency>
264-
<groupId>${project.groupId}</groupId>
265-
<artifactId>scaleph-project</artifactId>
266-
<version>${project.version}</version>
267-
</dependency>
268263
<dependency>
269264
<groupId>${project.groupId}</groupId>
270265
<artifactId>scaleph-api</artifactId>
271266
<version>${project.version}</version>
272267
</dependency>
273268
<dependency>
274269
<groupId>${project.groupId}</groupId>
275-
<artifactId>scaleph-engine-doris</artifactId>
270+
<artifactId>scaleph-workspace-project</artifactId>
276271
<version>${project.version}</version>
277272
</dependency>
278273
<dependency>
279-
<groupId>cn.sliew</groupId>
280-
<artifactId>scaleph-engine-doris-sql</artifactId>
274+
<groupId>${project.groupId}</groupId>
275+
<artifactId>scaleph-workspace-flink</artifactId>
281276
<version>${project.version}</version>
282277
</dependency>
283278
<dependency>
284279
<groupId>${project.groupId}</groupId>
285-
<artifactId>scaleph-engine-flink-client</artifactId>
280+
<artifactId>scaleph-workspace-flink-sql</artifactId>
286281
<version>${project.version}</version>
287282
</dependency>
288283
<dependency>
289284
<groupId>${project.groupId}</groupId>
290-
<artifactId>scaleph-engine-flink</artifactId>
285+
<artifactId>scaleph-workspace-flink-cdc</artifactId>
291286
<version>${project.version}</version>
292287
</dependency>
293288
<dependency>
294289
<groupId>${project.groupId}</groupId>
295-
<artifactId>scaleph-engine-sql</artifactId>
290+
<artifactId>scaleph-workspace-seatunnel</artifactId>
296291
<version>${project.version}</version>
297292
</dependency>
293+
298294
<dependency>
299295
<groupId>${project.groupId}</groupId>
300-
<artifactId>scaleph-engine-seatunnel</artifactId>
296+
<artifactId>scaleph-engine-doris</artifactId>
301297
<version>${project.version}</version>
302298
</dependency>
303299
<dependency>
304300
<groupId>${project.groupId}</groupId>
305-
<artifactId>scaleph-engine-flink-cdc</artifactId>
301+
<artifactId>scaleph-engine-flink-client</artifactId>
306302
<version>${project.version}</version>
307303
</dependency>
308304
<dependency>

scaleph-api/pom.xml

-12
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
<artifactId>scaleph-api</artifactId>
2929

3030
<dependencies>
31-
<dependency>
32-
<groupId>cn.sliew</groupId>
33-
<artifactId>scaleph-engine-doris-sql</artifactId>
34-
</dependency>
3531
<dependency>
3632
<groupId>${project.parent.groupId}</groupId>
3733
<artifactId>scaleph-engine-doris</artifactId>
@@ -100,14 +96,6 @@
10096
<groupId>com.github.xiaoymin</groupId>
10197
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
10298
</dependency>
103-
<!-- <dependency>-->
104-
<!-- <groupId>com.github.xiaoymin</groupId>-->
105-
<!-- <artifactId>knife4j-openapi2-spring-boot-starter</artifactId>-->
106-
<!-- </dependency>-->
107-
<!-- <dependency>-->
108-
<!-- <groupId>io.springfox</groupId>-->
109-
<!-- <artifactId>springfox-swagger-ui</artifactId>-->
110-
<!-- </dependency>-->
11199

112100
<dependency>
113101
<groupId>commons-beanutils</groupId>

scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/studio/DataBoardController.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
import cn.sliew.scaleph.api.annotation.Logging;
2222
import cn.sliew.scaleph.api.vo.TransferVO;
23-
import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobService;
24-
import cn.sliew.scaleph.project.service.WsProjectService;
23+
import cn.sliew.scaleph.workspace.seatunnel.service.WsDiJobService;
24+
import cn.sliew.scaleph.workspace.project.service.WsProjectService;
2525
import io.swagger.v3.oas.annotations.Operation;
2626
import io.swagger.v3.oas.annotations.tags.Tag;
2727
import org.springframework.beans.factory.annotation.Autowired;

scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactController.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
import cn.sliew.scaleph.api.annotation.Logging;
2222
import cn.sliew.scaleph.common.exception.ScalephException;
23-
import cn.sliew.scaleph.project.service.WsFlinkArtifactService;
24-
import cn.sliew.scaleph.project.service.dto.WsFlinkArtifactDTO;
25-
import cn.sliew.scaleph.project.service.param.WsFlinkArtifactListParam;
23+
import cn.sliew.scaleph.workspace.project.service.WsArtifactService;
24+
import cn.sliew.scaleph.workspace.project.service.dto.WsArtifactDTO;
25+
import cn.sliew.scaleph.workspace.project.service.param.WsArtifactListParam;
2626
import cn.sliew.scaleph.system.model.ResponseVO;
2727
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
2828
import io.swagger.v3.oas.annotations.Operation;
@@ -40,37 +40,37 @@
4040
public class WsArtifactController {
4141

4242
@Autowired
43-
private WsFlinkArtifactService wsFlinkArtifactService;
43+
private WsArtifactService wsArtifactService;
4444

4545
@Logging
4646
@GetMapping
4747
@Operation(summary = "查询 artifact 列表", description = "查询 artifact 列表")
48-
public ResponseEntity<Page<WsFlinkArtifactDTO>> list(@Valid WsFlinkArtifactListParam param) {
49-
final Page<WsFlinkArtifactDTO> result = wsFlinkArtifactService.list(param);
48+
public ResponseEntity<Page<WsArtifactDTO>> list(@Valid WsArtifactListParam param) {
49+
final Page<WsArtifactDTO> result = wsArtifactService.list(param);
5050
return new ResponseEntity<>(result, HttpStatus.OK);
5151
}
5252

5353
@Logging
5454
@PutMapping
5555
@Operation(summary = "新增 artifact", description = "新增 artifact")
56-
public ResponseEntity<ResponseVO> insert(@Valid @RequestBody WsFlinkArtifactDTO param) {
57-
wsFlinkArtifactService.insert(param);
56+
public ResponseEntity<ResponseVO> insert(@Valid @RequestBody WsArtifactDTO param) {
57+
wsArtifactService.insert(param);
5858
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
5959
}
6060

6161
@Logging
6262
@PostMapping
6363
@Operation(summary = "修改 artifact", description = "修改 artifact")
64-
public ResponseEntity<ResponseVO> update(@Valid @RequestBody WsFlinkArtifactDTO param) {
65-
wsFlinkArtifactService.update(param);
64+
public ResponseEntity<ResponseVO> update(@Valid @RequestBody WsArtifactDTO param) {
65+
wsArtifactService.update(param);
6666
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
6767
}
6868

6969
@Logging
7070
@DeleteMapping("{id}")
7171
@Operation(summary = "删除 artifact", description = "删除 artifact")
7272
public ResponseEntity<ResponseVO> deleteById(@PathVariable("id") Long id) throws ScalephException {
73-
wsFlinkArtifactService.deleteById(id);
73+
wsArtifactService.deleteById(id);
7474
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
7575
}
7676

scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsArtifactJarController.java

+33-35
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919
package cn.sliew.scaleph.api.controller.ws;
2020

2121
import cn.sliew.scaleph.api.annotation.Logging;
22-
import cn.sliew.scaleph.common.exception.ScalephException;
23-
import cn.sliew.scaleph.engine.flink.service.WsFlinkArtifactJarService;
24-
import cn.sliew.scaleph.engine.flink.service.dto.WsFlinkArtifactJarDTO;
25-
import cn.sliew.scaleph.engine.flink.service.param.*;
2622
import cn.sliew.scaleph.system.model.ResponseVO;
27-
import cn.sliew.scaleph.system.snowflake.exception.UidGenerateException;
23+
import cn.sliew.scaleph.workspace.flink.service.WsArtifactFlinkJarService;
24+
import cn.sliew.scaleph.workspace.flink.service.dto.WsArtifactFlinkJarDTO;
25+
import cn.sliew.scaleph.workspace.flink.service.param.*;
2826
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
2927
import io.swagger.v3.oas.annotations.Operation;
3028
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -41,59 +39,59 @@
4139
import java.net.URLEncoder;
4240
import java.util.List;
4341

44-
@Tag(name = "Flink管理-artifact-jar")
42+
@Tag(name = "Artifact管理-Flink-Jar")
4543
@RestController
46-
@RequestMapping(path = "/api/flink/artifact/jar")
44+
@RequestMapping(path = "/api/artifact/flink/jar")
4745
public class WsArtifactJarController {
4846

4947
@Autowired
50-
private WsFlinkArtifactJarService wsFlinkArtifactJarService;
48+
private WsArtifactFlinkJarService wsArtifactFlinkJarService;
5149

5250
@Logging
5351
@GetMapping
54-
@Operation(summary = "查询 artifact jar 列表", description = "查询 artifact jar 列表")
55-
public ResponseEntity<Page<WsFlinkArtifactJarDTO>> list(@Valid WsFlinkArtifactJarListParam param) {
56-
Page<WsFlinkArtifactJarDTO> result = wsFlinkArtifactJarService.list(param);
52+
@Operation(summary = "查询 flink jar 列表", description = "查询 flink jar 列表")
53+
public ResponseEntity<Page<WsArtifactFlinkJarDTO>> list(@Valid WsArtifactFlinkJarListParam param) {
54+
Page<WsArtifactFlinkJarDTO> result = wsArtifactFlinkJarService.list(param);
5755
return new ResponseEntity<>(result, HttpStatus.OK);
5856
}
5957

6058
@Logging
61-
@GetMapping("/page")
62-
@Operation(summary = "根据 id 分页查询 artifact jar 列表", description = "根据 id 分页查询 artifact jar 列表")
63-
public ResponseEntity<Page<WsFlinkArtifactJarDTO>> listByArtifact(@Valid WsFlinkArtifactJarHistoryParam param) {
64-
final Page<WsFlinkArtifactJarDTO> result = wsFlinkArtifactJarService.listByArtifact(param);
59+
@GetMapping("/history")
60+
@Operation(summary = "根据 artifact 分页查询 flink jar 列表", description = "根据 artifact 分页查询 flink jar 列表")
61+
public ResponseEntity<Page<WsArtifactFlinkJarDTO>> listByArtifact(@Valid WsArtifactFlinkJarArtifactParam param) {
62+
Page<WsArtifactFlinkJarDTO> result = wsArtifactFlinkJarService.listByArtifact(param);
6563
return new ResponseEntity<>(result, HttpStatus.OK);
6664
}
6765

6866
@Logging
6967
@GetMapping("/all")
70-
@Operation(summary = "查询 artifact jar 列表", description = "查询 artifact jar 列表")
71-
public ResponseEntity<List<WsFlinkArtifactJarDTO>> listAll(@Valid WsFlinkArtifactJarSelectListParam param) {
72-
final List<WsFlinkArtifactJarDTO> result = wsFlinkArtifactJarService.listAll(param);
68+
@Operation(summary = "查询 flink jar 列表", description = "查询 flink jar 列表")
69+
public ResponseEntity<List<WsArtifactFlinkJarDTO>> listAll(@Valid WsArtifactFlinkJarSelectListParam param) {
70+
List<WsArtifactFlinkJarDTO> result = wsArtifactFlinkJarService.listAll(param);
7371
return new ResponseEntity<>(result, HttpStatus.OK);
7472
}
7573

7674
@Logging
7775
@GetMapping("/{id}")
78-
@Operation(summary = "查询 artifact jar 详情", description = "查询 artifact jar 详情")
79-
public ResponseEntity<WsFlinkArtifactJarDTO> selectOne(@PathVariable("id") Long id) {
80-
WsFlinkArtifactJarDTO result = wsFlinkArtifactJarService.selectOne(id);
76+
@Operation(summary = "查询 flink jar 详情", description = "查询 flink jar 详情")
77+
public ResponseEntity<WsArtifactFlinkJarDTO> selectOne(@PathVariable("id") Long id) {
78+
WsArtifactFlinkJarDTO result = wsArtifactFlinkJarService.selectOne(id);
8179
return new ResponseEntity<>(result, HttpStatus.OK);
8280
}
8381

8482
@Logging
8583
@PutMapping
86-
@Operation(summary = "上传 artifact jar", description = "上传 artifact jar")
87-
public ResponseEntity<ResponseVO> upload(@Valid WsFlinkArtifactJarUploadParam param, @RequestPart("file") MultipartFile file) throws IOException, UidGenerateException {
88-
wsFlinkArtifactJarService.upload(param, file);
84+
@Operation(summary = "上传 flink jar", description = "上传 flink jar")
85+
public ResponseEntity<ResponseVO> upload(@Valid WsArtifactFlinkJarUploadParam param, @RequestPart("file") MultipartFile file) throws IOException {
86+
wsArtifactFlinkJarService.upload(param, file);
8987
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
9088
}
9189

9290
@Logging
9391
@PostMapping("jar")
94-
@Operation(summary = "修改 artifact jar", description = "修改 artifact jar")
95-
public ResponseEntity<ResponseVO> updateJar(@Valid WsFlinkArtifactJarUpdateParam param, @RequestPart(value = "file", required = false) MultipartFile file) throws UidGenerateException, IOException {
96-
this.wsFlinkArtifactJarService.update(param, file);
92+
@Operation(summary = "修改 flink jar", description = "修改 flink jar")
93+
public ResponseEntity<ResponseVO> updateJar(@Valid WsArtifactFlinkJarUpdateParam param, @RequestPart(value = "file", required = false) MultipartFile file) throws IOException {
94+
wsArtifactFlinkJarService.update(param, file);
9795
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
9896
}
9997

@@ -102,7 +100,7 @@ public ResponseEntity<ResponseVO> updateJar(@Valid WsFlinkArtifactJarUpdateParam
102100
@Operation(summary = "下载 artifact jar", description = "下载 artifact jar")
103101
public ResponseEntity<ResponseVO> download(@PathVariable("id") Long id, HttpServletResponse response) throws IOException {
104102
try (ServletOutputStream outputStream = response.getOutputStream()) {
105-
String fileName = wsFlinkArtifactJarService.download(id, outputStream);
103+
String fileName = wsArtifactFlinkJarService.download(id, outputStream);
106104
response.setCharacterEncoding("utf-8");// 设置字符编码
107105
response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); // 设置响应头
108106
}
@@ -111,17 +109,17 @@ public ResponseEntity<ResponseVO> download(@PathVariable("id") Long id, HttpServ
111109

112110
@Logging
113111
@DeleteMapping("/{id}")
114-
@Operation(summary = "删除 artifact jar", description = "删除 artifact jar")
115-
public ResponseEntity<ResponseVO> delete(@PathVariable("id") Long id) throws ScalephException, IOException {
116-
wsFlinkArtifactJarService.deleteOne(id);
112+
@Operation(summary = "删除 flink jar", description = "删除 flink jar")
113+
public ResponseEntity<ResponseVO> delete(@PathVariable("id") Long id) throws IOException {
114+
wsArtifactFlinkJarService.deleteOne(id);
117115
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
118116
}
119117

120118
@Logging
121-
@DeleteMapping("/all/{id}")
122-
@Operation(summary = "删除所有 artifact jar", description = "删除所有 artifact jar")
123-
public ResponseEntity<ResponseVO> deleteAll(@PathVariable("id") Long id) throws IOException, ScalephException {
124-
wsFlinkArtifactJarService.deleteAll(id);
119+
@DeleteMapping("/artifact/{artifactId}")
120+
@Operation(summary = "删除 artifact 下所有 flink jar", description = "删除 artifact 下所有 flink jar")
121+
public ResponseEntity<ResponseVO> deleteArtifact(@PathVariable("artifactId") Long artifactId) throws IOException {
122+
wsArtifactFlinkJarService.deleteArtifact(artifactId);
125123
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
126124
}
127125
}

0 commit comments

Comments
 (0)