添加字段和表
parent
74a444de38
commit
ece2b0c5ac
|
@ -31,7 +31,7 @@ public class TaskInput extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 节点id
|
* 节点id
|
||||||
*/
|
*/
|
||||||
private Integer nodeId;
|
private Long nodeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点名称
|
* 节点名称
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class InputAddReq {
|
||||||
/**
|
/**
|
||||||
* 节点id
|
* 节点id
|
||||||
*/
|
*/
|
||||||
private Integer nodeId;
|
private Long nodeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点名称
|
* 节点名称
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class TaskInputUpdReq {
|
||||||
/**
|
/**
|
||||||
* 节点id
|
* 节点id
|
||||||
*/
|
*/
|
||||||
private Integer nodeId;
|
private Long nodeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点名称
|
* 节点名称
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class TaskInputResp {
|
||||||
/**
|
/**
|
||||||
* 节点id
|
* 节点id
|
||||||
*/
|
*/
|
||||||
private Integer nodeId;
|
private Long nodeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点名称
|
* 节点名称
|
||||||
|
|
|
@ -16,12 +16,12 @@ public class TableVo {
|
||||||
/**
|
/**
|
||||||
* 表字段
|
* 表字段
|
||||||
*/
|
*/
|
||||||
private String tableFieId;
|
private String columnName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表字段别名
|
* 表字段别名
|
||||||
*/
|
*/
|
||||||
private String tableAsFieId;
|
private String tableAsName;
|
||||||
/**
|
/**
|
||||||
* 字段规则
|
* 字段规则
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue