WANG 6 anni fa
parent
commit
f37f906d80

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

@@ -282,6 +282,9 @@ public class CourseController extends ControllerSupport {
 		if (StringUtils.isBlank(name)) {
 			throw new StatusException("B-620001", "课程名称不能为空");
 		}
+		if (name.length() > 20) {
+			throw new StatusException("B-620001", "课程名称不能超过20个字符");
+		}
 		CourseEntity course = courseRepo.findByRootOrgIdAndCode(rootOrgId, code);
 		if (null != course) {
 			throw new StatusException("B-620002", "课程编码已被占用");