|
@@ -1,6 +1,7 @@
|
|
|
package com.tzld.piaoquan.api.service.contentplatform.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
|
|
|
import com.tzld.piaoquan.api.common.exception.CommonException;
|
|
|
import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
|
|
@@ -330,8 +331,12 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
if (CollectionUtils.isEmpty(videoList)) {
|
|
|
return null;
|
|
|
}
|
|
|
- Set<Long> videoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toSet());
|
|
|
- Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(videoIds);
|
|
|
+ List<Long> videoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
|
|
|
+ Map<Long, VideoDetail> coverMap = new HashMap<>();
|
|
|
+ for (List<Long> partition : Lists.partition(videoIds, 20)) {
|
|
|
+ Set<Long> ids = new HashSet<>(partition);
|
|
|
+ coverMap.putAll(messageAttachmentService.getVideoDetail(ids));
|
|
|
+ }
|
|
|
List<VideoContentItemVO> result = new ArrayList<>();
|
|
|
for (ContentPlatformVideo video : videoList) {
|
|
|
VideoContentItemVO item = new VideoContentItemVO();
|