添加字段和表

master
Cui YongXing 2024-08-27 19:40:30 +08:00
parent 74a444de38
commit ece2b0c5ac
6 changed files with 14 additions and 13 deletions

View File

@ -31,7 +31,7 @@ public class TaskInput extends BaseEntity {
/** /**
* id * id
*/ */
private Integer nodeId; private Long nodeId;
/** /**
* *

View File

@ -18,7 +18,7 @@ public class InputAddReq {
/** /**
* id * id
*/ */
private Integer nodeId; private Long nodeId;
/** /**
* *

View File

@ -15,7 +15,7 @@ public class TaskInputUpdReq {
/** /**
* id * id
*/ */
private Integer nodeId; private Long nodeId;
/** /**
* *

View File

@ -20,7 +20,7 @@ public class TaskInputResp {
/** /**
* id * id
*/ */
private Integer nodeId; private Long nodeId;
/** /**
* *

View File

@ -16,12 +16,12 @@ public class TableVo {
/** /**
* *
*/ */
private String tableFieId; private String columnName;
/** /**
* *
*/ */
private String tableAsFieId; private String tableAsName;
/** /**
* *
*/ */

View File

@ -14,21 +14,19 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
* @author Administrator * @author Administrator
*/ */
@RestController @RestController
@RequestMapping("node") @RequestMapping("TaskInput")
public class TaskInputController { public class TaskInputController {
@Autowired @Autowired
private TaskInputService taskInputService; private TaskInputService taskInputService;
@Autowired
private StructureService structureService;
/** /**
* *
* *
@ -50,7 +48,10 @@ public class TaskInputController {
*/ */
@PostMapping() @PostMapping()
@Operation(summary = "添加节点", description = "添加任务信息表") @Operation(summary = "添加节点", description = "添加任务信息表")
public Result save(@RequestBody @Validated InputAddReq req) { public Result save(@RequestBody InputAddReq req) {
HashMap<String, Object> map = new HashMap<>();
map.put("node_id",req.getNodeId());
taskInputService.removeByMap(map);
List<TableVo> list = req.getList(); List<TableVo> list = req.getList();
List<TaskInput> inputs = list.stream().map(inputAddReq -> { List<TaskInput> inputs = list.stream().map(inputAddReq -> {
TaskInput build = TaskInput.builder() TaskInput build = TaskInput.builder()
@ -60,8 +61,8 @@ public class TaskInputController {
.databaseId(req.getDatabaseId()) .databaseId(req.getDatabaseId())
.tableName(req.getTableName()) .tableName(req.getTableName())
.tableAsName(req.getTableAsName()) .tableAsName(req.getTableAsName())
.tableFieId(inputAddReq.getTableFieId()) .tableFieId(inputAddReq.getColumnName())
.tableAsFieId(inputAddReq.getTableAsFieId()) .tableAsFieId(inputAddReq.getTableAsName())
.fieIdAsEngineId(inputAddReq.getFieIdAsEngineId()) .fieIdAsEngineId(inputAddReq.getFieIdAsEngineId())
.build(); .build();
return build; return build;