|
|
|
package com.teaching.backend.controller.Know;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Author:youhang
|
|
|
|
* @Date:2024-06-09-9:55
|
|
|
|
* @Description:
|
|
|
|
*/
|
|
|
|
import com.teaching.backend.common.BaseResponse;
|
|
|
|
import com.teaching.backend.model.dto.Know.*;
|
|
|
|
import com.teaching.backend.model.entity.know.*;
|
|
|
|
import com.teaching.backend.model.entity.knowtmp.Knowtmp;
|
|
|
|
import com.teaching.backend.model.vo.knowGraph.KnowVO;
|
|
|
|
import com.teaching.backend.service.Know.KnowService;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/api/knowNeo")
|
|
|
|
@Api(tags= "图-知识点管理")
|
|
|
|
public class KnowController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private KnowService knowService;
|
|
|
|
|
|
|
|
|
|
|
|
//通过courseId 查询所有结点,存储成JSON
|
|
|
|
@ApiOperation(value = "通过courseId 查询所有结点,存储成JSON")
|
|
|
|
@GetMapping("/showGraphJson")
|
|
|
|
BaseResponse<String> showGraphJson(@RequestParam String courseId){
|
|
|
|
return knowService.showGraphJson(courseId);
|
|
|
|
}
|
|
|
|
|
|
|
|
//通过courseId 查询 JSON 生成图
|
|
|
|
@ApiOperation(value = "通过courseId 查询 JSON 生成图")
|
|
|
|
@GetMapping("/generateGraph")
|
|
|
|
BaseResponse<String> generateGraph(@RequestParam String courseId){
|
|
|
|
return knowService.generateGraph(courseId);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//生成知识点学习路径 默认从第一个知识点到第最后个知识点
|
|
|
|
@ApiOperation(value = "生成知识点学习路径")
|
|
|
|
@GetMapping("/knowLearnPath")
|
|
|
|
BaseResponse<BaseKnowReturn> knowLearnPath(@RequestParam String corseId){
|
|
|
|
return knowService.knowLearnPath(corseId);
|
|
|
|
}
|
|
|
|
|
|
|
|
//返回depth层知识点
|
|
|
|
@ApiOperation(value = "返回depth层知识点")
|
|
|
|
@GetMapping("/getNodeByDepth")
|
|
|
|
BaseResponse<BaseKnowReturn> getNodeByDepth(@RequestParam Long id,@RequestParam Long depth){
|
|
|
|
return knowService.getNodeByDepth(id,depth);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//返回课程下指定关系的知识图谱
|
|
|
|
@ApiOperation(value = "返回课程下指定关系的知识图谱")
|
|
|
|
@GetMapping("/getRelsNodesByCourseId")
|
|
|
|
BaseResponse<BaseKnowReturn> getRelsNodesByCourseId(@RequestParam String courseId,@RequestParam List<String>types){
|
|
|
|
return knowService.getRelsNodesByCourseId(courseId,types);
|
|
|
|
}
|
|
|
|
//返回知识点的前后知识点
|
|
|
|
@ApiOperation(value = "返回知识点的前后知识点")
|
|
|
|
@GetMapping("/getFontedAndBackKnows")
|
|
|
|
BaseResponse<List<KnowVO>> getFontedAndBackKnows(@RequestParam Long id){
|
|
|
|
return knowService.getFontedAndBackKnows(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//返回知识点下指定关系的知识图谱
|
|
|
|
@ApiOperation(value = "返回知识点下指定关系的知识图谱")
|
|
|
|
@GetMapping("/getRelsNodesById")
|
|
|
|
BaseResponse<BaseKnowReturn> getRelsNodesById(@RequestParam Long id,@RequestParam List<String>types){
|
|
|
|
return knowService.getRelsNodesById(id,types);
|
|
|
|
}
|
|
|
|
|
|
|
|
//重置 知识点下 知识图谱
|
|
|
|
@ApiOperation(value = "重置-知识点下-知识图谱")
|
|
|
|
@GetMapping("/getKnowGraphById")
|
|
|
|
BaseResponse<BaseKnowReturn> getKnowGraphById(@RequestParam Long id){
|
|
|
|
return knowService.getKnowGraphById(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//通过courseId 删除所有节点
|
|
|
|
@ApiOperation(value = "通过courseId 删除所有节点")
|
|
|
|
@GetMapping("/deleteAllByCourseId")
|
|
|
|
BaseResponse<String> deleteAllByCourseId(@RequestParam String courseId){
|
|
|
|
return knowService.deleteAllByCourseId(courseId);
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取课程下的所有知识点
|
|
|
|
@ApiOperation(value = "获取课程下的所有知识点")
|
|
|
|
@GetMapping("/getAllKnowByCourseId")
|
|
|
|
BaseResponse<BaseKnowReturn> getAllKnowByCourseId(@RequestParam String id){
|
|
|
|
return knowService.getAllKnowByCourseId(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
//批量修改节点关系
|
|
|
|
@ApiOperation(value = "批量修改节点关系")
|
|
|
|
@PostMapping("/updateLinks")
|
|
|
|
BaseResponse<String> updateLinks(@RequestBody List<LinksVO> linksList){
|
|
|
|
return knowService.updateLinks(linksList);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|