|
|
@@ -1,73 +1,73 @@
|
|
|
-package seecoder.devcloud.web.controller.tree;
|
|
|
-
|
|
|
-
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import seecoder.devcloud.web.model.po.tree.TreeNodePO;
|
|
|
-import seecoder.devcloud.web.model.vo.Response;
|
|
|
-import seecoder.devcloud.web.model.vo.TreeNodeVO;
|
|
|
-import seecoder.devcloud.web.service.tree.TreeNodeService;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * @Author cyz,xzh
|
|
|
- * @Description 需求树相关操作
|
|
|
- */
|
|
|
-@Api("需求相关API")
|
|
|
-@RestController
|
|
|
-@RequestMapping("/tree")
|
|
|
-public class TreeNodesController {
|
|
|
- @Autowired
|
|
|
- private TreeNodeService treeNodeService;
|
|
|
- //注意 这里混用po和vo了
|
|
|
- @ApiOperation("获取所有nodes")
|
|
|
- @GetMapping("/all")
|
|
|
- public List<TreeNodePO> getAllNodes(){
|
|
|
- return treeNodeService.getAllNodes();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取某个项目所有需求情况
|
|
|
- * @param projectId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "获取project_id对应的所有nodes",httpMethod = "GET")
|
|
|
- @GetMapping("/{projectId}")
|
|
|
- @ApiImplicitParam(value = "projectId",dataType = "int", paramType = "path")
|
|
|
- public Response listTreeNodesByProjectId(@PathVariable("projectId") int projectId){
|
|
|
- return treeNodeService.listTreeNodesByProjectId(projectId);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation("插入节点")
|
|
|
- @PostMapping("/node")
|
|
|
- public Response insertTreeNode(TreeNodeVO treeNodeVO){
|
|
|
- return treeNodeService.insertTreeNode(treeNodeVO);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation("根据nodeId删除节点")
|
|
|
- @DeleteMapping("/node/{nodeId}")
|
|
|
- @ApiImplicitParam(value = "nodeId",dataType = "int", paramType = "path")
|
|
|
- public Response deleteTreeNode(@PathVariable("nodeId") int nodeId) {
|
|
|
- return Response.buildSuccess(treeNodeService.deleteTreeNode(nodeId));
|
|
|
- }
|
|
|
- @ApiOperation("根据父节点fatherId创建一个子节点并返回")
|
|
|
- @PostMapping("/subNode/{fatherId}")
|
|
|
- @ApiImplicitParam(value = "fatherId",dataType = "int", paramType = "path")
|
|
|
- public Response insertTreeNodeByFatherNode(@PathVariable("fatherId") int fatherId){
|
|
|
- Response res = treeNodeService.insertTreeNodeByFatherNode(fatherId);
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation("修改节点属性")
|
|
|
- @PutMapping("/node")
|
|
|
- @ApiImplicitParam(value = "treeNodeVO",dataType = "TreeNodeVO", paramType = "body")
|
|
|
- public Response updateTreeNode(@RequestBody TreeNodeVO treeNodeVO){
|
|
|
- return treeNodeService.updateTreeNode(treeNodeVO);
|
|
|
- }
|
|
|
-}
|
|
|
+//package seecoder.devcloud.web.controller.tree;
|
|
|
+//
|
|
|
+//
|
|
|
+//import io.swagger.annotations.Api;
|
|
|
+//import io.swagger.annotations.ApiImplicitParam;
|
|
|
+//import io.swagger.annotations.ApiOperation;
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.web.bind.annotation.*;
|
|
|
+//import seecoder.devcloud.web.model.po.tree.TreeNodePO;
|
|
|
+//import seecoder.devcloud.web.model.vo.Response;
|
|
|
+//import seecoder.devcloud.web.model.vo.TreeNodeVO;
|
|
|
+//import seecoder.devcloud.web.service.tree.TreeNodeService;
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//import java.util.List;
|
|
|
+//
|
|
|
+///**
|
|
|
+// * @Author cyz,xzh
|
|
|
+// * @Description 需求树相关操作
|
|
|
+// */
|
|
|
+//@Api("需求相关API")
|
|
|
+//@RestController
|
|
|
+//@RequestMapping("/tree")
|
|
|
+//public class TreeNodesController {
|
|
|
+// @Autowired
|
|
|
+// private TreeNodeService treeNodeService;
|
|
|
+// //注意 这里混用po和vo了
|
|
|
+// @ApiOperation("获取所有nodes")
|
|
|
+// @GetMapping("/all")
|
|
|
+// public List<TreeNodePO> getAllNodes(){
|
|
|
+// return treeNodeService.getAllNodes();
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 获取某个项目所有需求情况
|
|
|
+// * @param projectId
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "获取project_id对应的所有nodes",httpMethod = "GET")
|
|
|
+// @GetMapping("/{projectId}")
|
|
|
+// @ApiImplicitParam(value = "projectId", dataTypeClass = Integer.class, paramType = "path")
|
|
|
+// public Response<List<TreeNodePO>> listTreeNodesByProjectId(@PathVariable("projectId") int projectId){
|
|
|
+// return treeNodeService.listTreeNodesByProjectId(projectId);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @ApiOperation(value = "插入节点", httpMethod = "POST")
|
|
|
+// @PostMapping("/node")
|
|
|
+// public Response insertTreeNode(TreeNodeVO treeNodeVO){
|
|
|
+// return treeNodeService.insertTreeNode(treeNodeVO);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @ApiOperation(value = "根据nodeId删除节点", httpMethod = "DELETE")
|
|
|
+// @DeleteMapping("/node/{nodeId}")
|
|
|
+// @ApiImplicitParam(value = "nodeId",dataTypeClass = Integer.class, paramType = "path")
|
|
|
+// public Response deleteTreeNode(@PathVariable("nodeId") int nodeId) {
|
|
|
+// return Response.buildSuccess(treeNodeService.deleteTreeNode(nodeId));
|
|
|
+// }
|
|
|
+// @ApiOperation(value = "根据父节点fatherId创建一个子节点并返回", httpMethod = "POST")
|
|
|
+// @PostMapping("/subNode/{fatherId}")
|
|
|
+// @ApiImplicitParam(value = "fatherId",dataTypeClass = Integer.class, paramType = "path")
|
|
|
+// public Response insertTreeNodeByFatherNode(@PathVariable("fatherId") int fatherId){
|
|
|
+// Response res = treeNodeService.insertTreeNodeByFatherNode(fatherId);
|
|
|
+// return res;
|
|
|
+// }
|
|
|
+//
|
|
|
+// @ApiOperation(value = "修改节点属性", httpMethod = "PUT")
|
|
|
+// @PutMapping("/node")
|
|
|
+// @ApiImplicitParam(value = "treeNodeVO",dataTypeClass = TreeNodeVO.class, paramType = "body")
|
|
|
+// public Response updateTreeNode(@RequestBody TreeNodeVO treeNodeVO){
|
|
|
+// return treeNodeService.updateTreeNode(treeNodeVO);
|
|
|
+// }
|
|
|
+//}
|