mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-23 17:49:34 +08:00
代码优化
This commit is contained in:
parent
46015593e9
commit
39519db020
@ -105,7 +105,7 @@ public class CourseController {
|
||||
@PostMapping("/create")
|
||||
@Transactional
|
||||
public JsonResponse store(@RequestBody @Validated CourseRequest req) throws ParseException {
|
||||
if (req.getShortDesc() != null && req.getShortDesc().length() > 200) {
|
||||
if (req.getShortDesc().length() > 200) {
|
||||
return JsonResponse.error("课程简短介绍不能超过200字");
|
||||
}
|
||||
Course course =
|
||||
@ -144,7 +144,7 @@ public class CourseController {
|
||||
classHourCount = insertHours.size();
|
||||
}
|
||||
} else {
|
||||
if (req.getChapters() == null || req.getChapters().size() == 0) {
|
||||
if (req.getChapters().size() == 0) {
|
||||
return JsonResponse.error("请配置课时");
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class ResourceController {
|
||||
if(!type.equals(BackendConstant.RESOURCE_TYPE_VIDEO) &&
|
||||
!type.equals(BackendConstant.RESOURCE_TYPE_IMAGE)){
|
||||
filter.setType(BackendConstant.RESOURCE_TYPE_ATTACHMENT);
|
||||
data.put("existingType",resourceService.paginateType(filter));
|
||||
data.put("existing_types",resourceService.paginateType(filter));
|
||||
}
|
||||
return JsonResponse.data(data);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user