添加字段和表

master
Cui YongXing 2024-08-30 20:32:55 +08:00
parent 1f1d8c7680
commit 190ec316eb
6 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,45 @@
package com.muyu.common.domian;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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_joint")
public class NodeJoint {
/**
* id
*/
@TableId(value = "id",type = IdType.AUTO)
private Long id;
/**
* id
*/
private Long taskId;
/**
* id
*/
private Long nodeId;
/**
*
*/
private String joint;
/**
*
*/
private String oneFie;
/**
*
*/
private String twoFie;
}

View File

@ -1,5 +1,7 @@
package com.muyu.common.domian;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -16,6 +18,7 @@ public class NodeTable {
/**
*
*/
@TableId(value = "id",type = IdType.AUTO)
private Long id;
/**
* id

View File

@ -0,0 +1,39 @@
package com.muyu.task.server.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.muyu.common.core.domain.Result;
import com.muyu.common.domian.NodeJoint;
import com.muyu.task.server.service.NodeJointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("nodeJoint")
public class NodeJointController {
@Autowired
private NodeJointService nodeJointService;
@PostMapping("add")
public Result save(@RequestBody NodeJoint nodeJoint){
QueryWrapper<NodeJoint> wrapper = new QueryWrapper<>();
wrapper.eq("node_id",nodeJoint.getNodeId());
nodeJointService.remove(wrapper);
boolean save = nodeJointService.save(nodeJoint);
return Result.success(save);
}
}

View File

@ -0,0 +1,9 @@
package com.muyu.task.server.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.common.domian.NodeJoint;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface NodeJointMapper extends BaseMapper<NodeJoint> {
}

View File

@ -0,0 +1,7 @@
package com.muyu.task.server.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.domian.NodeJoint;
public interface NodeJointService extends IService<NodeJoint> {
}

View File

@ -0,0 +1,11 @@
package com.muyu.task.server.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.domian.NodeJoint;
import com.muyu.task.server.mapper.NodeJointMapper;
import com.muyu.task.server.service.NodeJointService;
import org.springframework.stereotype.Service;
@Service
public class NodeJointServiceImpl extends ServiceImpl<NodeJointMapper, NodeJoint> implements NodeJointService {
}