Jelajahi Sumber

。。。。

wangwei 6 tahun lalu
induk
melakukan
506cbecc8e

+ 14 - 1
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/CourseController.java

@@ -270,8 +270,12 @@ public class CourseController extends ControllerSupport {
 		Long rootOrgId = accessUser.getRootOrgId();
 
 		String code = domain.getCode();
+		String name = domain.getName();
 		if (StringUtils.isBlank(code)) {
-			throw new StatusException("B-620001", "code is blank");
+			throw new StatusException("B-620001", "课程编码不能为空");
+		}
+		if (StringUtils.isBlank(name)) {
+			throw new StatusException("B-620001", "课程名称不能为空");
 		}
 		CourseEntity course = courseRepo.findByRootOrgIdAndCode(rootOrgId, code);
 		if (null != course) {
@@ -305,6 +309,15 @@ public class CourseController extends ControllerSupport {
 		User accessUser = getAccessUser();
 		Long rootOrgId = accessUser.getRootOrgId();
 
+		String code = domain.getCode();
+		String name = domain.getName();
+		if (StringUtils.isBlank(code)) {
+			throw new StatusException("B-620001", "课程编码不能为空");
+		}
+		if (StringUtils.isBlank(name)) {
+			throw new StatusException("B-620001", "课程名称不能为空");
+		}
+
 		CourseInfo info = new CourseInfo();
 		info.setRootOrgId(rootOrgId);
 		info.setCode(domain.getCode());