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; import com.teaching.backend.service.knowtmp.KnowtmpService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * @Author:youhang * @Date:2024-08-07-19:38 * @Description: */ @RestController @RequestMapping("/knowtmp") public class KnowtmpController { @Autowired private KnowtmpService knowtmpService; //返回课程下所有知识点 @GetMapping("/getAllKnows") BaseResponse getAllKnows(@RequestParam String courseId){ return knowtmpService.getAllKnows(courseId); } // 添加知识点 @PostMapping("/addKnow") BaseResponse add(@RequestBody KnowtempAdd knowtempAdd){ return knowtmpService.add(knowtempAdd); } //修改知识点 @PostMapping("/updateKnow") BaseResponse update(@RequestBody KnowtempUpdate knowtempUpdate){ return knowtmpService.update(knowtempUpdate); } //删除知识点 @GetMapping("/deleteKnow") BaseResponse delete(Long id){ return knowtmpService.delete(id); } //查询通过chapterId List @GetMapping("/query") BaseResponse query(Long id){ return knowtmpService.query(id); } //查询通过chapterId List @GetMapping("/queryKnow") List queryByChapterId(Long chapterId){ return knowtmpService.queryByChapterId(chapterId); } }