添加字段和表
parent
85489cc5cd
commit
45cce49f3d
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.common.domian;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value ="node_table",autoResultMap = true)
|
||||
public class NodeTable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
private Long nodeId;
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String databaseAndTableId;
|
||||
/**
|
||||
* 表别名
|
||||
*/
|
||||
private String tableAsName;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.task.server.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.domian.NodeTable;
|
||||
import com.muyu.task.server.service.NodeTableService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("nodeTable")
|
||||
public class NodeTableController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private NodeTableService nodeTableService;
|
||||
|
||||
@PostMapping
|
||||
private Result addNodeTable(NodeTable nodeTable) {
|
||||
boolean save = nodeTableService.save(nodeTable);
|
||||
return Result.success(save);
|
||||
}
|
||||
@GetMapping("/{id}")
|
||||
private Result getNodeTable(@PathVariable Long id) {
|
||||
NodeTable byId = nodeTableService.getById(id);
|
||||
return Result.success(byId);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.task.server.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.common.domian.NodeTable;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface NodeTableMapper extends BaseMapper<NodeTable>{
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.muyu.task.server.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.domian.NodeTable;
|
||||
|
||||
public interface NodeTableService extends IService<NodeTable> {
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.task.server.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.domian.NodeTable;
|
||||
import com.muyu.task.server.mapper.NodeTableMapper;
|
||||
import com.muyu.task.server.service.NodeTableService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class NodeTableServiceImpl extends ServiceImpl<NodeTableMapper, NodeTable> implements NodeTableService {
|
||||
}
|
Loading…
Reference in New Issue