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

50 lines
1.6 KiB

package com.teaching.backend.controller.courses;
import com.teaching.backend.common.BaseResponse;
import com.teaching.backend.common.ResultUtils;
import com.teaching.backend.model.dto.courses.ObjectiveContentKnowDTO;
import com.teaching.backend.model.dto.courses.PageDTO;
import com.teaching.backend.model.dto.courses.StudentCoursesDTO;
import com.teaching.backend.model.query.CourseQuery;
import com.teaching.backend.model.vo.courses.CoursesVO;
import com.teaching.backend.service.courses.IStudentCoursesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
/**
* <p>
* 前端控制器
* </p>
*
* @author zjh
* @since 2024-06-13
*/
@Api(tags = "学生课程接口")
@RestController
@RequestMapping("/student_courses")
public class StudentCoursesController {
@Autowired
IStudentCoursesService studentCoursesService;
@ApiOperation("给学生添加课程")
@PostMapping("/addcoursess")
public BaseResponse<String> saveCoursesToStudents(@RequestBody StudentCoursesDTO studentCoursesDTO){
String data = studentCoursesService.saveCoursesToStudents(studentCoursesDTO);
return ResultUtils.success(data);
}
@ApiOperation("查询课程列表")
@GetMapping("/page")
public BaseResponse<PageDTO<CoursesVO>> getCourses(CourseQuery courseQuery){
PageDTO<CoursesVO> coursesList = studentCoursesService.queryCourses(courseQuery);
return ResultUtils.success(coursesList);
}
}