|
|
@@ -139,9 +139,9 @@ public class CourseService {
|
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
- public CourseVO getCourseByCoderId(Integer coderId) {
|
|
|
+ public Long getCourseByCoderId(Integer coderId) {
|
|
|
Course course = courseRepository.findCourseByCoderId(coderId).orElseThrow(CustomErrorException::courseNotFound);
|
|
|
- return courseMapper.courseToCourseVO(course);
|
|
|
+ return course.getState() == ObjectState.DELETED ? null : courseMapper.courseToCourseVO(course).getId();
|
|
|
}
|
|
|
|
|
|
public Boolean checkCourseNameUnique(Long id, String name) {
|
|
|
@@ -151,7 +151,7 @@ public class CourseService {
|
|
|
|
|
|
public CourseVO getCourseById(Long id) {
|
|
|
Course course = courseRepository.findById(id).orElseThrow(CustomErrorException::courseNotFound);
|
|
|
- return courseMapper.courseToCourseVO(course);
|
|
|
+ return course.getState() == ObjectState.DELETED ? null : courseMapper.courseToCourseVO(course);
|
|
|
}
|
|
|
|
|
|
public String confirmCourseSelection(CourseSelectionKey courseSelectionKey, Long userId) {
|
|
|
@@ -203,4 +203,9 @@ public class CourseService {
|
|
|
Course course = courseRepository.findCourseByInvitationCode(code).orElse(null);
|
|
|
return course == null || course.getId().equals(id);
|
|
|
}
|
|
|
+
|
|
|
+ public Long getCourseByEvalId(int evalId) {
|
|
|
+ Course course = courseRepository.findCourseByEvalId(evalId).orElseThrow(CustomErrorException::courseNotFound);
|
|
|
+ return course.getState() == ObjectState.DELETED ? null : courseMapper.courseToCourseVO(course).getId();
|
|
|
+ }
|
|
|
}
|