|
@@ -9,6 +9,9 @@ import cn.seecoder.seecoderportalserver.mapper.CourseMapper;
|
|
|
import cn.seecoder.seecoderportalserver.repository.CourseRepository;
|
|
import cn.seecoder.seecoderportalserver.repository.CourseRepository;
|
|
|
import cn.seecoder.seecoderportalserver.repository.CourseSelectionRepository;
|
|
import cn.seecoder.seecoderportalserver.repository.CourseSelectionRepository;
|
|
|
import cn.seecoder.seecoderportalserver.repository.UserRepository;
|
|
import cn.seecoder.seecoderportalserver.repository.UserRepository;
|
|
|
|
|
+import cn.seecoder.seecoderportalserver.service.Impl.CoderService;
|
|
|
|
|
+import cn.seecoder.seecoderportalserver.service.Impl.EvalService;
|
|
|
|
|
+import cn.seecoder.seecoderportalserver.service.Impl.HelperService;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -27,12 +30,18 @@ public class CourseService {
|
|
|
private final CourseMapper courseMapper;
|
|
private final CourseMapper courseMapper;
|
|
|
private final UserRepository userRepository;
|
|
private final UserRepository userRepository;
|
|
|
private final CourseSelectionRepository courseSelectionRepository;
|
|
private final CourseSelectionRepository courseSelectionRepository;
|
|
|
|
|
+ private final CoderService coderService;
|
|
|
|
|
+ private final HelperService helperService;
|
|
|
|
|
+ private final EvalService evalService;
|
|
|
|
|
|
|
|
- public CourseService(CourseRepository courseRepository, CourseMapper courseMapper, UserRepository userRepository, CourseSelectionRepository courseSelectionRepository) {
|
|
|
|
|
|
|
+ public CourseService(CourseRepository courseRepository, CourseMapper courseMapper, UserRepository userRepository, CourseSelectionRepository courseSelectionRepository, CoderService coderService, HelperService helperService, EvalService evalService) {
|
|
|
this.courseRepository = courseRepository;
|
|
this.courseRepository = courseRepository;
|
|
|
this.courseMapper = courseMapper;
|
|
this.courseMapper = courseMapper;
|
|
|
this.userRepository = userRepository;
|
|
this.userRepository = userRepository;
|
|
|
this.courseSelectionRepository = courseSelectionRepository;
|
|
this.courseSelectionRepository = courseSelectionRepository;
|
|
|
|
|
+ this.coderService = coderService;
|
|
|
|
|
+ this.helperService = helperService;
|
|
|
|
|
+ this.evalService = evalService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public CourseVO getCourse(Long courseId) {
|
|
public CourseVO getCourse(Long courseId) {
|
|
@@ -45,6 +54,8 @@ public class CourseService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public CourseVO createCourse(CourseVO courseVO) {
|
|
public CourseVO createCourse(CourseVO courseVO) {
|
|
|
|
|
+ evalService.getAllExams();
|
|
|
|
|
+
|
|
|
Optional<User> teacher = userRepository.findById(courseVO.getTeacher().getId());
|
|
Optional<User> teacher = userRepository.findById(courseVO.getTeacher().getId());
|
|
|
// 确认授课老师ID存在
|
|
// 确认授课老师ID存在
|
|
|
if (!teacher.isPresent()) {
|
|
if (!teacher.isPresent()) {
|