图谱-后端
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.

52 lines
1.4 KiB

8 months ago
package com.teaching.backend.controller.Knowtmp;
import com.teaching.backend.common.BaseResponse;
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;
// 添加知识点
@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("/queryKnow")
BaseResponse<List<Knowtmp>> queryByChapterId(Long chapterId){
return knowtmpService.queryByChapterId(chapterId);
}
}