|
@@ -0,0 +1,39 @@
|
|
|
|
+package com.kgraph.graph.neo4j.controller;
|
|
|
|
+
|
|
|
|
+import com.kgraph.common.core.controller.BaseController;
|
|
|
|
+import com.kgraph.common.core.domain.AjaxResult;
|
|
|
|
+import com.kgraph.graph.neo4j.domain.Neo4jRelation;
|
|
|
|
+import com.kgraph.graph.neo4j.seavice.INeo4jRelationService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/neo4j/relation")
|
|
|
|
+public class Neo4jRelationController extends BaseController {
|
|
|
|
+ @Autowired
|
|
|
|
+ INeo4jRelationService service;
|
|
|
|
+
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public Page<Neo4jRelation> findAll(Pageable page) {
|
|
|
|
+ return service.findAll(page);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/{id}")
|
|
|
|
+ public Neo4jRelation findById(@PathVariable("id") Long id) {
|
|
|
|
+ return service.findById(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("/save")
|
|
|
|
+ public AjaxResult save(@RequestBody Neo4jRelation entity) {
|
|
|
|
+ service.save(entity);
|
|
|
|
+ return success();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
|
+ public AjaxResult delete(@PathVariable("id") Long id){
|
|
|
|
+ service.delete(id);
|
|
|
|
+ return success();
|
|
|
|
+ }
|
|
|
|
+}
|