图谱-后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

65 lines
1.7 KiB

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<Long> getAllKnows(@RequestParam String courseId){
return knowtmpService.getAllKnows(courseId);
}
// 添加知识点
@PostMapping("/addKnow")
BaseResponse<String> add(@RequestBody KnowtempAdd knowtempAdd){
return knowtmpService.add(knowtempAdd);
}
//修改知识点
@PostMapping("/updateKnow")
BaseResponse<String> update(@RequestBody KnowtempUpdate knowtempUpdate){
return knowtmpService.update(knowtempUpdate);
}
//删除知识点
@GetMapping("/deleteKnow")
BaseResponse<String> delete(Long id){
return knowtmpService.delete(id);
}
//查询通过chapterId List
@GetMapping("/query")
BaseResponse<Knowtmp> query(Long id){
return knowtmpService.query(id);
}
//查询通过chapterId List
@GetMapping("/queryKnow")
List<Knowtmp> queryByChapterId(Long chapterId){
return knowtmpService.queryByChapterId(chapterId);
}
}