添加字段和表

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
*/
private Integer nodeId;
private Long nodeId;
/**
*

View File

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

View File

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

View File

@ -20,7 +20,7 @@ public class TaskInputResp {
/**
* 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.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
/**
* @author Administrator
*/
@RestController
@RequestMapping("node")
@RequestMapping("TaskInput")
public class TaskInputController {
@Autowired
private TaskInputService taskInputService;
@Autowired
private StructureService structureService;
/**
*
*
@ -50,7 +48,10 @@ public class TaskInputController {
*/
@PostMapping()
@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<TaskInput> inputs = list.stream().map(inputAddReq -> {
TaskInput build = TaskInput.builder()
@ -60,8 +61,8 @@ public class TaskInputController {
.databaseId(req.getDatabaseId())
.tableName(req.getTableName())
.tableAsName(req.getTableAsName())
.tableFieId(inputAddReq.getTableFieId())
.tableAsFieId(inputAddReq.getTableAsFieId())
.tableFieId(inputAddReq.getColumnName())
.tableAsFieId(inputAddReq.getTableAsName())
.fieIdAsEngineId(inputAddReq.getFieIdAsEngineId())
.build();
return build;