|
|
@@ -2,6 +2,7 @@ package cn.seecoder.seecoderportalserver.service;
|
|
|
|
|
|
import cn.seecoder.seecoderportalcommon.vo.CourseState;
|
|
|
import cn.seecoder.seecoderportalcommon.vo.CourseVO;
|
|
|
+import cn.seecoder.seecoderportalcommon.vo.UserRole;
|
|
|
import cn.seecoder.seecoderportalserver.domain.Course;
|
|
|
import cn.seecoder.seecoderportalserver.domain.CourseSelection;
|
|
|
import cn.seecoder.seecoderportalserver.domain.User;
|
|
|
@@ -64,6 +65,9 @@ public class CourseService {
|
|
|
if (!teacher.isPresent()) {
|
|
|
throw new PortalException(ExceptionType.ERROR, "该老师不存在");
|
|
|
}
|
|
|
+ if(!teacher.get().getRole().equals(UserRole.TEACHER) && !teacher.get().getRole().equals(UserRole.ADMIN)){
|
|
|
+ throw new PortalException(ExceptionType.ERROR, "该老师不存在");
|
|
|
+ }
|
|
|
|
|
|
// 创建Coder课程
|
|
|
JSONObject coderRes = coderService.createService(courseVO);
|