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.
32 lines
1.2 KiB
32 lines
1.2 KiB
package rd.controller.schedule;
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckRole;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import rd.data.db.CourseScheduleWithCourseIdName;
|
|
import rd.data.model.response.Response;
|
|
import rd.service.schedule.TeacherCourseScheduleService;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import java.util.List;
|
|
|
|
@RestController
|
|
@RequestMapping("/teacher/course-schedule")
|
|
public class TeacherScheduleController {
|
|
private final TeacherCourseScheduleService teacherCourseScheduleService;
|
|
|
|
public TeacherScheduleController(TeacherCourseScheduleService teacherCourseScheduleService) {
|
|
|
|
this.teacherCourseScheduleService = teacherCourseScheduleService;
|
|
}
|
|
|
|
@SaCheckRole("TEACHER")
|
|
@RequestMapping("/teacher-schedules")
|
|
public Response<List<CourseScheduleWithCourseIdName>> list(@RequestParam("term") String term) {
|
|
var uid = StpUtil.getLoginIdAsLong();
|
|
var result = teacherCourseScheduleService.getTeacherSchedule(uid, term);
|
|
|
|
return Response.success(result);
|
|
}
|
|
}
|
|
|