|
@@ -11,6 +11,7 @@ import cn.rankin.productservice.code.ProductServiceAPICode;
|
|
|
import cn.rankin.productservice.repository.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -46,6 +47,10 @@ public class AppLessonService {
|
|
|
|
|
|
// get courseware id list
|
|
|
List<LessonWareRelation> lessonWareRelationList = lessonWareRelationRepository.findByLessonId(lessonId, BaseStatusEnum.NORMAL);
|
|
|
+ if (CollectionUtils.isEmpty(lessonWareRelationList)) {
|
|
|
+ lesson.setWareList(new ArrayList<>());
|
|
|
+ return APIResult.ok(lesson);
|
|
|
+ }
|
|
|
List<String> wareIdList = new ArrayList<>();
|
|
|
lessonWareRelationList.forEach(relation -> wareIdList.add(relation.getWareId()));
|
|
|
|