|
|
|
@ -85,7 +85,7 @@ public class knowServiceImpl implements KnowService { |
|
|
|
|
public void addAllKnowTransation(String courseId) throws Exception{ |
|
|
|
|
// 2.从课程表查出课程节点 并添加到 neo
|
|
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
|
int f = knowRepository.addCourse(courseId,courses.getName(),courses.getDescription()); |
|
|
|
|
int f = knowRepository.addCourse(courseId,courses.getName(),courses.getDescription(),courses.getClasshours()); |
|
|
|
|
if(f <= 0){ |
|
|
|
|
throw new RuntimeException("添加课程失败"); |
|
|
|
|
} |
|
|
|
@ -93,7 +93,7 @@ public class knowServiceImpl implements KnowService { |
|
|
|
|
List<Chapter> chapterList = chapterMapper.selectSectionsByCourseId(courseId); |
|
|
|
|
for (int i = 0; i < chapterList.size(); i++) { |
|
|
|
|
Chapter chapter = chapterList.get(i); |
|
|
|
|
f =knowRepository.addChapter(chapter.getId(),chapter.getName(),chapter.getContent()); |
|
|
|
|
f =knowRepository.addChapter(chapter.getId(),chapter.getName(),chapter.getContent(),chapter.getTotalClassHours()); |
|
|
|
|
if(f <= 0){ |
|
|
|
|
throw new RuntimeException("添加章节失败"); |
|
|
|
|
} |
|
|
|
@ -187,7 +187,7 @@ public class knowServiceImpl implements KnowService { |
|
|
|
|
public BaseResponse<String> addCourse(KnowCourseCreateRequest knowCourseCreateRequest) { |
|
|
|
|
KnowCourse knowCourse = new KnowCourse(); |
|
|
|
|
BeanUtils.copyProperties(knowCourseCreateRequest,knowCourse); |
|
|
|
|
int f = knowRepository.addCourse(knowCourse.getCourseId(),knowCourse.getName(),knowCourse.getInfo()); |
|
|
|
|
int f = knowRepository.addCourse(knowCourse.getCourseId(),knowCourse.getName(),knowCourse.getInfo(),knowCourse.getHour()); |
|
|
|
|
if(f >0){ |
|
|
|
|
return ResultUtils.success("添加知识点成功"); |
|
|
|
|
}else{ |
|
|
|
@ -232,7 +232,7 @@ public class knowServiceImpl implements KnowService { |
|
|
|
|
public BaseResponse<String> addChapter(KnowChapterCreateRequest knowChapterCreateRequest) { |
|
|
|
|
KnowChapter knowChapter = new KnowChapter(); |
|
|
|
|
BeanUtils.copyProperties(knowChapterCreateRequest,knowChapter); |
|
|
|
|
int f = knowRepository.addChapter(knowChapter.getChapterId(),knowChapter.getName(),knowChapter.getInfo()); |
|
|
|
|
int f = knowRepository.addChapter(knowChapter.getChapterId(),knowChapter.getName(),knowChapter.getInfo(),knowChapter.getHour()); |
|
|
|
|
if(f>0){ |
|
|
|
|
return ResultUtils.success("添加章节成功"); |
|
|
|
|
}else{ |
|
|
|
@ -272,7 +272,7 @@ public class knowServiceImpl implements KnowService { |
|
|
|
|
|
|
|
|
|
//获取课程下的所有知识点
|
|
|
|
|
@Override |
|
|
|
|
public BaseKnowReturn getAllKnowByCourseId(String id) { |
|
|
|
|
public BaseResponse<BaseKnowReturn> getAllKnowByCourseId(String id) { |
|
|
|
|
Collection<Map<String, Object>> all = |
|
|
|
|
neo4jClient.query( "match(n:Know)-[r*0..]->(p:Know) where n.courseId = '"+id+"' return n as `n`,r as `r`,p as `p`,length(r) as `d`").fetch().all(); |
|
|
|
|
|
|
|
|
@ -319,7 +319,7 @@ public class knowServiceImpl implements KnowService { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
BaseKnowReturn baseKnowReturn = new BaseKnowReturn(knowList,linksList); |
|
|
|
|
return baseKnowReturn; |
|
|
|
|
return ResultUtils.success(baseKnowReturn); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取课程下的所有资源
|
|
|
|
@ -343,12 +343,6 @@ public class knowServiceImpl implements KnowService { |
|
|
|
|
return ResultUtils.success(knowList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取知识点下二级的所有资源
|
|
|
|
|
@Override |
|
|
|
|
public Set<Resources> getSecondResources(Long id) { |
|
|
|
|
Set<Resources>resourcesSet ; |
|
|
|
|
resourcesSet = knowRepository.queryBesidesKnowToResources(id); |
|
|
|
|
return resourcesSet; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|