diff --git a/pom.xml b/pom.xml
index f3f4d71..1f52a11 100644
--- a/pom.xml
+++ b/pom.xml
@@ -243,6 +243,12 @@
httpclient
4.5.6
+
+ com.google.code.gson
+ gson
+ 2.8.9
+
+
diff --git a/src/main/java/com/teaching/backend/controller/Know/Edge.java b/src/main/java/com/teaching/backend/controller/Know/Edge.java
new file mode 100644
index 0000000..12d70cc
--- /dev/null
+++ b/src/main/java/com/teaching/backend/controller/Know/Edge.java
@@ -0,0 +1,21 @@
+package com.teaching.backend.controller.Know;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @Author:youhang
+ * @Date:2024-08-19-15:41
+ * @Description:
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class Edge {
+ private String source;
+ private String target;
+ private String type;
+ private Integer sta; // 1 课程-章节 2 章节 - 章节 3 章节 - 知识点 4 点 - 点
+
+}
diff --git a/src/main/java/com/teaching/backend/controller/Know/KnowChapterVO.java b/src/main/java/com/teaching/backend/controller/Know/KnowChapterVO.java
new file mode 100644
index 0000000..1c7c577
--- /dev/null
+++ b/src/main/java/com/teaching/backend/controller/Know/KnowChapterVO.java
@@ -0,0 +1,38 @@
+package com.teaching.backend.controller.Know;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+public class KnowChapterVO implements Serializable {
+
+
+ /**
+ * 章节id
+ */
+
+ private Long chapterId;
+
+
+ /**
+ * 知识点名称
+ */
+
+ private String name;
+
+ /**
+ * 信息
+ */
+
+ private String info;
+ /**
+ * 学时
+ */
+
+ private double hour;
+
+
+}
+
diff --git a/src/main/java/com/teaching/backend/controller/Know/KnowController.java b/src/main/java/com/teaching/backend/controller/Know/KnowController.java
index c508fc2..cd67565 100644
--- a/src/main/java/com/teaching/backend/controller/Know/KnowController.java
+++ b/src/main/java/com/teaching/backend/controller/Know/KnowController.java
@@ -7,6 +7,7 @@ package com.teaching.backend.controller.Know;
*/
import com.teaching.backend.common.BaseResponse;
+import com.teaching.backend.mapper.know.KnowRepository;
import com.teaching.backend.model.dto.Know.*;
import com.teaching.backend.model.entity.know.Know;
import com.teaching.backend.model.entity.know.KnowChapter;
@@ -28,6 +29,42 @@ public class KnowController {
@Autowired
private KnowService knowService;
+ @Autowired
+ private KnowRepository knowRepository;
+
+
+
+
+ //返回2层知识点
+ @GetMapping("/twoLevelKnows")
+ BaseResponse getTwoLevelKnows(@RequestParam Long id){
+ return knowService.getTwoLevelKnows(id);
+ }
+ //返回3层知识点
+ @GetMapping("/threeLevelKnows")
+ BaseResponse getThreeLevelKnows(@RequestParam Long id){
+ return knowService.getThreeLevelKnows(id);
+ }
+ //返回4层知识点
+ @GetMapping("/fourLevelKnows")
+ BaseResponse getFourLevelKnows(@RequestParam Long id){
+ return knowService.getFourLevelKnows(id);
+ }
+
+
+ //通过courseId 显示图的JSON
+ @GetMapping("/test")
+ void test(@RequestParam String courseId){
+ int res = knowRepository.addCourseRelationship(courseId,932L,"related");
+ }
+
+ //通过courseId 显示图的JSON
+ @GetMapping("/showGraphJson")
+ BaseResponse showGraphJson(@RequestParam String courseId){
+ return knowService.showGraphJson(courseId);
+ }
+
+
// 添加全部知识点
@PostMapping("/addAllKnow")
BaseResponse addAllKnow(@RequestParam String courseId){
@@ -42,11 +79,11 @@ public class KnowController {
//===================
- // 添加知识点
- @PostMapping("/addKnow")
- BaseResponse addKnow(@RequestBody KnowRequest knowRequest){
- return knowService.addKnow(knowRequest);
- }
+// // 添加知识点
+// @PostMapping("/addKnow")
+// BaseResponse addKnow(@RequestBody KnowRequest knowRequest){
+// return knowService.addKnow(knowRequest);
+// }
// 修改知识点
@PostMapping("/updateKnow")
@@ -129,4 +166,13 @@ public class KnowController {
}
+ //获取二级知识图谱
+ @GetMapping("/getsecondKnowsById")
+ BaseResponse getsecondKnowsById(@RequestParam Long id){
+ return knowService.getsecondKnowsById(id);
+ }
+
+
+
+
}
diff --git a/src/main/java/com/teaching/backend/controller/Know/KnowCourseVO.java b/src/main/java/com/teaching/backend/controller/Know/KnowCourseVO.java
new file mode 100644
index 0000000..eff546c
--- /dev/null
+++ b/src/main/java/com/teaching/backend/controller/Know/KnowCourseVO.java
@@ -0,0 +1,33 @@
+package com.teaching.backend.controller.Know;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class KnowCourseVO implements Serializable {
+
+
+ /**
+ * 课程id
+ */
+
+ private String courseId;
+
+
+ /**
+ * 知识点名称
+ */
+
+ private String name;
+
+ /**
+ * 信息
+ */
+ private String info;
+ private double hour;
+
+
+
+}
+
diff --git a/src/main/java/com/teaching/backend/controller/Know/KnowJson.java b/src/main/java/com/teaching/backend/controller/Know/KnowJson.java
new file mode 100644
index 0000000..09e4911
--- /dev/null
+++ b/src/main/java/com/teaching/backend/controller/Know/KnowJson.java
@@ -0,0 +1,42 @@
+package com.teaching.backend.controller.Know;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class KnowJson implements Serializable {
+
+
+ /**
+ * mysql 中 知识点id
+ */
+
+ private Long knowId;
+
+
+ /**
+ * 知识点名称
+ */
+
+ private String name;
+
+ /**
+ * 信息
+ */
+
+ private String info;
+ /**
+ * 学时
+ */
+
+ private double hour;
+
+
+}
+
diff --git a/src/main/java/com/teaching/backend/controller/Know/KnowJsonListVO.java b/src/main/java/com/teaching/backend/controller/Know/KnowJsonListVO.java
new file mode 100644
index 0000000..421fea8
--- /dev/null
+++ b/src/main/java/com/teaching/backend/controller/Know/KnowJsonListVO.java
@@ -0,0 +1,31 @@
+package com.teaching.backend.controller.Know;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+
+public class KnowJsonListVO implements Serializable {
+
+ private List knowJsonList;
+ public List KnowJsonListVO() {
+ return knowJsonList;
+ }
+
+ public void setKnowJsonList(List knowJsonList) {
+ this.knowJsonList = knowJsonList;
+ }
+
+ public List getKnowJsonList() {
+ return this.knowJsonList ;
+ }
+
+
+
+
+}
+
diff --git a/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java b/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java
index 85ab55d..c71c1a8 100644
--- a/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java
+++ b/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java
@@ -1,6 +1,7 @@
package com.teaching.backend.controller.Knowtmp;
import com.teaching.backend.common.BaseResponse;
+import com.teaching.backend.model.dto.Know.BaseKnowReturn;
import com.teaching.backend.model.dto.Knowtmp.KnowtempAdd;
import com.teaching.backend.model.dto.Knowtmp.KnowtempUpdate;
import com.teaching.backend.model.entity.knowtmp.Knowtmp;
@@ -22,6 +23,14 @@ public class KnowtmpController {
@Autowired
private KnowtmpService knowtmpService;
+ //返回课程下所有知识点
+ @GetMapping("/getAllKnows")
+ BaseResponse getAllKnows(@RequestParam String courseId){
+ return knowtmpService.getAllKnows(courseId);
+ }
+
+
+
// 添加知识点
@PostMapping("/addKnow")
diff --git a/src/main/java/com/teaching/backend/controller/resource/ResourceController.java b/src/main/java/com/teaching/backend/controller/resource/ResourceController.java
index 29cdfd4..9c45bd9 100644
--- a/src/main/java/com/teaching/backend/controller/resource/ResourceController.java
+++ b/src/main/java/com/teaching/backend/controller/resource/ResourceController.java
@@ -47,6 +47,7 @@ public class ResourceController {
public ResponseEntity readFile(@RequestParam String filename) {
return resourceService.readFile(filename);
}
+
@GetMapping("/addRelationship/BetweenCourseAndResources")
public BaseResponse addResourcesAndKnowByCourseId(@RequestParam String courseId, @RequestParam List resourcesIds){
return resourceService.addResourcesAndKnowByCourseId(courseId,resourcesIds);
@@ -77,6 +78,11 @@ public class ResourceController {
BaseResponse> queryBesidesKnowToResources(@RequestParam Long KnowId){
return resourceService.queryBesidesKnowToResources(KnowId);
}
+ //查询知识点下资源
+ @GetMapping("/queryResourcesByKnowId")
+ BaseResponse> queryResourcesByKnowId(@RequestParam Long KnowId){
+ return resourceService.queryResourcesByKnowId(KnowId);
+ }
diff --git a/src/main/java/com/teaching/backend/mapper/Knowtemp/KnowtmpMapper.java b/src/main/java/com/teaching/backend/mapper/Knowtemp/KnowtmpMapper.java
index 5aee0cb..fd799d1 100644
--- a/src/main/java/com/teaching/backend/mapper/Knowtemp/KnowtmpMapper.java
+++ b/src/main/java/com/teaching/backend/mapper/Knowtemp/KnowtmpMapper.java
@@ -2,7 +2,11 @@ package com.teaching.backend.mapper.Knowtemp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teaching.backend.model.entity.knowtmp.Knowtmp;
+import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
/**
@@ -11,6 +15,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface KnowtmpMapper extends BaseMapper {
+ @Select("SELECT * FROM Knowtmp WHERE chapterid = #{chapterId} ORDER BY ordernum")
+ List queryIdByChapterId(@Param("chapterid") Long chapterId);
+
+
}
diff --git a/src/main/java/com/teaching/backend/mapper/chapter/ChapterMapper.java b/src/main/java/com/teaching/backend/mapper/chapter/ChapterMapper.java
index 01859f9..1866cc8 100644
--- a/src/main/java/com/teaching/backend/mapper/chapter/ChapterMapper.java
+++ b/src/main/java/com/teaching/backend/mapper/chapter/ChapterMapper.java
@@ -21,6 +21,24 @@ public interface ChapterMapper extends BaseMapper {
@Select("SELECT * FROM chapter WHERE course_id = #{courseId}")
List selectSectionsByCourseId(@Param("courseId") String courseId);
+ @Select("SELECT id FROM chapter WHERE course_id = #{courseId}")
+ List selectChapterIdsByCourseId(@Param("courseId") String courseId);
+
+
+ @Select("SELECT * FROM chapter WHERE course_id = #{courseId} ORDER BY order_num")
+ List selectSectionsOrderByNumByCourseId(@Param("courseId") String courseId);
+
+ @Select("SELECT * FROM chapter WHERE course_id = #{courseId} AND pid = 0 ORDER BY order_num")
+ List selectChapterPIDByCourseId(@Param("courseId") String courseId);
+
+ @Select("SELECT * FROM chapter WHERE pid = #{parentId} ORDER BY order_num")
+ List selectChapterChildrenOrderByNum(@Param("parentId") Long parentId);
+
+
+ @Select("SELECT id FROM chapter WHERE pid = #{chapterId} ORDER BY order_num")
+ List selectSectionsOrderByNumByChapterId(@Param("pid") Integer chapterId);
+
+
@Select("SELECT * FROM course_chapter WHERE course_id = #{courseId} AND (pid = #{parentId} )")
List selectSectionsWithChildren(@Param("courseId") String courseId, @Param("parentId") String parentId);
@Select("SELECT * FROM chapter WHERE id = #{excelId}")
diff --git a/src/main/java/com/teaching/backend/mapper/know/KnowRepository.java b/src/main/java/com/teaching/backend/mapper/know/KnowRepository.java
index e58df2f..958a8ac 100644
--- a/src/main/java/com/teaching/backend/mapper/know/KnowRepository.java
+++ b/src/main/java/com/teaching/backend/mapper/know/KnowRepository.java
@@ -7,22 +7,31 @@ package com.teaching.backend.mapper.know;
*/
+import com.teaching.backend.model.entity.courses.Courses;
import com.teaching.backend.model.entity.know.Know;
import com.teaching.backend.model.entity.know.KnowChapter;
import com.teaching.backend.model.entity.know.KnowCourse;
import com.teaching.backend.model.entity.resource.Resources;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
+import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Set;
public interface KnowRepository extends Neo4jRepository {
+
+
+ @Query("MATCH (p:Know)-[:FatherAndSon]->(n:Know) WHERE p.chapterId = $chapterId RETURN p.id ORDER BY ordernum;")
+ ListqueryKnowIdByChapterId(Long chapterId);
+
+
+
//======================
- @Query("CREATE (n:Know {name: $name,info:$info}) return n;")
- Know addKnow(String name,String info);
+ @Query("CREATE (n:Know {knowId: $KnowId,name: $name,info:$info,hour:$hour}) return ID(n);")
+ Long addKnow(Long KnowId,String name,String info,double hour);
@Query("MATCH ID(p:Know) = $id SET p.name = $name set p.info= $info RETURN count(p);")
@@ -36,8 +45,8 @@ public interface KnowRepository extends Neo4jRepository {
//=============================
- @Query("CREATE (n:Know {name: $name, courseId: $courseId,info:$info,hour:$hour}) return count(n)")
- int addCourse(String courseId, String name, String info,double hour);
+ @Query("CREATE (n:Know {name: $name, courseId: $courseId,info:$info,hour:$hour}) return ID(n) as id")
+ Long addCourse(String courseId, String name, String info, double hour);
@Query("MATCH (p:Know {courseId:$courseId }) SET p.name = $name set p.info= $info RETURN count(p);")
int updateCourse(String courseId, String name, String info);
@@ -50,8 +59,8 @@ public interface KnowRepository extends Neo4jRepository {
//====================
- @Query("CREATE (n:Know {name: $name, chapterId:$chapterId,info:$info,hour:$hour}) return count(n)")
- int addChapter(Long chapterId, String name, String info,double hour);
+ @Query("CREATE (n:Know {name: $name, chapterId:$chapterId,info:$info,hour:$hour}) return ID(n)")
+ Long addChapter(Long chapterId, String name, String info,double hour);
@Query("MATCH (p:Know {chapterId:$chapterId }) SET p.name = $name set p.info= $info RETURN count(p);")
int updateChapter(Long chapterId, String name, String info);
@@ -67,18 +76,47 @@ public interface KnowRepository extends Neo4jRepository {
Set queryBesidesKnowToResources(Long id);
//建立关系 课程 - 章节
- @Query("MATCH (p:Know {courseId: $courseId}), (c:Know {chapterId: $chapterId}) CREATE (p)-[r:FatherAndSon]->(c) return count(r);")
- int addFatherAndSonWithCourse(String courseId,Long chapterId);
+ @Query("MATCH (p:Know {courseId: $courseId}), (c:Know {chapterId: $chapterId}) CREATE (p)-[r:contain]->(c) return count(r);")
+ int addContainWithCourse(String courseId,Long chapterId);
//建立关系 章节与章节
- @Query("MATCH (p:Know {chapterId: $chapterId1}), (c:Know {chapterId: $chapterId2}) CREATE (c)-[r:FatherAndSon]->(p) return count(r);")
- int addFatherAndSonWithChapter(Long chapterId1,Long chapterId2);
+ @Query("MATCH (p:Know {chapterId: $chapterId1}), (c:Know {chapterId: $chapterId2}) CREATE (c)-[r:contain]->(p) return count(r);")
+ int addContainWithChapter(Long chapterId1,Long chapterId2);
//建立关系 章节与知识点
- @Query("MATCH (p:Know), (j:Know) WHERE p.chapterId= $chapterId AND ID(j) = $id CREATE (p)-[r:FatherAndSon]->(j) return count(r);")
- int addFatherAndSonWithKnow(Long id,Long chapterId);
+ @Query("MATCH (p:Know), (j:Know) WHERE p.chapterId= $chapterId AND ID(j) = $id CREATE (p)-[r:contain]->(j) return count(r);")
+ int addContainWithKnow(Long id,Long chapterId);
@Query("MATCH (p:Know), (c:Resources) WHERE ID(p) = $id AND ID(c) = $ResourcesId CREATE (p)-[r:resources]->(c) return count(r)")
int addResourceResourcesKnow(Long id, Long ResourcesId);
+
+ //建立关系 章节与章节 顺序 Subsequent
+ @Query("MATCH (p:Know), (j:Know) WHERE ID(p) = $chapterId1 AND ID(j)= $chapterId2 CREATE (p)-[r:Subsequent]->(j) return count(r);")
+ int addSubsequentByChapterId(Long chapterId1,Long chapterId2);
+
+ //建立关系 章节与章节 顺序 Subsequent
+ @Query("MATCH (p:Know), (j:Know) WHERE ID(p)= $id1 AND ID(j)= $id2 CREATE (p)-[r:order]->(j) return count(r);")
+ int addOrderById(Long id1,Long id2);
+
+ //==========
+ //建立关系 all -课程
+ @Query("MATCH (p:Know {courseId: $courseId}), (j:Know {chapterId: $chapterId}) CREATE (p)-[r:顺序]->(j) return count(p);")
+ int addCourseRelationship(String courseId,Long chapterId,String type);
+
+ //建立关系 all -章节
+ @Query("MATCH (p:Know), (j:Know) WHERE p.chapterId= $chapterId1 AND ID(j)= $chapterId2 CREATE (p)-[r: "+"$type"+"]->(j) return count(r);")
+ int addChapterRelationship(Long chapterId1, Long chapterId2, @Param("type")String type);
+
+ //建立关系 all -节 - 点
+ @Query("MATCH (p:Know), (j:Know) WHERE p.chapterId= $chapterId AND j.knowId= $knowId CREATE (p)-[r: $type]->(j) return count(r);")
+ int addChapterToKnowRelationship(Long chapterId,Long knowId,String type);
+
+
+
+ //建立关系 all - 知识点
+ @Query("MATCH (p:Know), (j:Know) WHERE p.knowId= $knowId1 AND j.knowId = $knowId2 CREATE (p)-[r: $type]->(j) return count(r);")
+ int addKnowRelationship(Long knowId1,Long knowId2,String type);
+
+
}
diff --git a/src/main/java/com/teaching/backend/mapper/resource/ResourcesRepository.java b/src/main/java/com/teaching/backend/mapper/resource/ResourcesRepository.java
index ec4ad2e..256b73c 100644
--- a/src/main/java/com/teaching/backend/mapper/resource/ResourcesRepository.java
+++ b/src/main/java/com/teaching/backend/mapper/resource/ResourcesRepository.java
@@ -45,6 +45,10 @@ public interface ResourcesRepository extends Neo4jRepository {
@Query("MATCh (p:Know)-[*0..1]->(n:Know)-[:resources]->(m:Resources) WHERE ID(p) = $KnowId RETURN m")
Set queryBesidesKnowToResources(Long KnowId);
+ //
+ @Query("MATCH (p)-[r:resources]->(c) WHERE ID(p) = $KnowId RETURN c")
+ Set queryResourcesByKnowId(Long KnowId);
+
diff --git a/src/main/java/com/teaching/backend/service/Know/KnowService.java b/src/main/java/com/teaching/backend/service/Know/KnowService.java
index f50b2be..064bbc5 100644
--- a/src/main/java/com/teaching/backend/service/Know/KnowService.java
+++ b/src/main/java/com/teaching/backend/service/Know/KnowService.java
@@ -18,6 +18,14 @@ import java.util.Set;
*/
public interface KnowService {
+ BaseResponse getTwoLevelKnows(Long id);
+ BaseResponse getThreeLevelKnows(Long id);
+ BaseResponse getFourLevelKnows(Long id);
+
+ //通过courseId 显示图的JSON
+ BaseResponse showGraphJson(String courseId);
+
+
//通过courseId 添加所有节点
BaseResponse addAllKnow(String courseId);
@@ -27,8 +35,8 @@ public interface KnowService {
//=====================
- // 添加知识点
- BaseResponse addKnow(KnowRequest knowRequest);
+// // 添加知识点
+// BaseResponse addKnow(KnowRequest knowRequest);
// 修改知识点
BaseResponse updateKnow(KnowUpdateRequest knowUpdateRequest);
@@ -73,6 +81,9 @@ public interface KnowService {
//获取课程下的所有知识点
BaseResponse getAllKnowByCourseId(String id);
+ //获取课程下的所有知识点
+ BaseResponse getsecondKnowsById(Long id);
+
//获取课程下的所有资源
BaseResponse> getAllResourcesByCourseId(String id);
diff --git a/src/main/java/com/teaching/backend/service/impl/know/knowServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/know/knowServiceImpl.java
index c86cbca..8744014 100644
--- a/src/main/java/com/teaching/backend/service/impl/know/knowServiceImpl.java
+++ b/src/main/java/com/teaching/backend/service/impl/know/knowServiceImpl.java
@@ -1,9 +1,25 @@
package com.teaching.backend.service.impl.know;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonObject;
import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.ErrorCode;
import com.teaching.backend.common.ResultUtils;
+import com.teaching.backend.controller.Know.Edge;
+import com.teaching.backend.controller.Know.KnowJson;
+import com.teaching.backend.controller.Know.KnowJsonListVO;
+import com.teaching.backend.mapper.Knowtemp.KnowtmpMapper;
import com.teaching.backend.mapper.chapter.ChapterMapper;
import com.teaching.backend.mapper.courses.CoursesMapper;
import com.teaching.backend.mapper.know.KnowRepository;
@@ -29,6 +45,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
+import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@@ -43,6 +60,9 @@ public class knowServiceImpl implements KnowService {
@Autowired
private KnowRepository knowRepository;
+ @Autowired
+ private KnowtmpMapper knowtmpMapper;
+
@Autowired
private ChapterMapper chapterMapper;
@@ -51,7 +71,6 @@ public class knowServiceImpl implements KnowService {
private KnowtmpService knowtmpService;
-
@Autowired
CoursesMapper coursesMapper;
@@ -59,107 +78,563 @@ public class knowServiceImpl implements KnowService {
private Neo4jClient neo4jClient;
- public BaseResponse addRelationshipWithresources(Long id, Long resourceId){
- int f = knowRepository.addResourceResourcesKnow(id,resourceId);
- if(f <= 0){
+ public BaseResponse addRelationshipWithresources(Long id, Long resourceId) {
+ int f = knowRepository.addResourceResourcesKnow(id, resourceId);
+ if (f <= 0) {
throw new RuntimeException("添加关系失败");
}
return ResultUtils.success("添加关系成功");
}
+ @Override
+ public BaseResponse getTwoLevelKnows(Long id) {
+ Collection