修改分页条数
parent
dac0809d0b
commit
b233ff8d75
|
@ -1,13 +1,11 @@
|
|||
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.NodeRule;
|
||||
import com.muyu.task.server.service.NodeRuleService;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("nodeRule")
|
||||
|
@ -17,8 +15,18 @@ public class NodeRuleController {
|
|||
private NodeRuleService nodeRuleService;
|
||||
|
||||
|
||||
@PostMapping("delete/{id}/{nodeId}")
|
||||
public Result delete(@PathVariable("id") Long id, @PathVariable("nodeId") Long nodeId) {
|
||||
QueryWrapper<NodeRule> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("node_id", nodeId);
|
||||
wrapper.eq("task_id", id);
|
||||
nodeRuleService.remove(wrapper);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("addNodeRule")
|
||||
public Result addNodeRule(@RequestBody NodeRule nodeRule) {
|
||||
delete(nodeRule.getTaskId(), nodeRule.getNodeId());
|
||||
boolean save = nodeRuleService.save(nodeRule);
|
||||
return Result.success(save);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue