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 showGraphJson(@RequestParam String courseId){ return knowService.showGraphJson(courseId); } //通过courseId 查询 JSON 生成图 @ApiOperation(value = "通过courseId 查询 JSON 生成图") @GetMapping("/generateGraph") BaseResponse generateGraph(@RequestParam String courseId){ return knowService.generateGraph(courseId); } //生成知识点学习路径 默认从第一个知识点到第最后个知识点 @ApiOperation(value = "生成知识点学习路径") @GetMapping("/knowLearnPath") BaseResponse knowLearnPath(@RequestParam String corseId){ return knowService.knowLearnPath(corseId); } //返回depth层知识点 @ApiOperation(value = "返回depth层知识点") @GetMapping("/getNodeByDepth") BaseResponse getNodeByDepth(@RequestParam Long id,@RequestParam Long depth){ return knowService.getNodeByDepth(id,depth); } //返回课程下指定关系的知识图谱 @ApiOperation(value = "返回课程下指定关系的知识图谱") @GetMapping("/getRelsNodesByCourseId") BaseResponse getRelsNodesByCourseId(@RequestParam String courseId,@RequestParam Listtypes){ return knowService.getRelsNodesByCourseId(courseId,types); } //返回知识点的前后知识点 @ApiOperation(value = "返回知识点的前后知识点") @GetMapping("/getFontedAndBackKnows") BaseResponse> getFontedAndBackKnows(@RequestParam Long id){ return knowService.getFontedAndBackKnows(id); } //返回知识点下指定关系的知识图谱 @ApiOperation(value = "返回知识点下指定关系的知识图谱") @GetMapping("/getRelsNodesById") BaseResponse getRelsNodesById(@RequestParam Long id,@RequestParam Listtypes){ return knowService.getRelsNodesById(id,types); } //重置 知识点下 知识图谱 @ApiOperation(value = "重置-知识点下-知识图谱") @GetMapping("/getKnowGraphById") BaseResponse getKnowGraphById(@RequestParam Long id){ return knowService.getKnowGraphById(id); } //通过courseId 删除所有节点 @ApiOperation(value = "通过courseId 删除所有节点") @GetMapping("/deleteAllByCourseId") BaseResponse deleteAllByCourseId(@RequestParam String courseId){ return knowService.deleteAllByCourseId(courseId); } //获取课程下的所有知识点 @ApiOperation(value = "获取课程下的所有知识点") @GetMapping("/getAllKnowByCourseId") BaseResponse getAllKnowByCourseId(@RequestParam String id){ return knowService.getAllKnowByCourseId(id); } //批量修改节点关系 @ApiOperation(value = "批量修改节点关系") @PostMapping("/updateLinks") BaseResponse updateLinks(@RequestBody List linksList){ return knowService.updateLinks(linksList); } }