|
@@ -32,6 +32,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
@@ -52,7 +53,8 @@ public class ContentServiceImpl implements ContentService {
|
|
|
|
|
|
|
|
private final String SINGLE_VIDEO_UID = "76862180";
|
|
private final String SINGLE_VIDEO_UID = "76862180";
|
|
|
|
|
|
|
|
- private final Integer VIDEO_NUM = 3;
|
|
|
|
|
|
|
+ @Value("${content.mini.video.num:3}")
|
|
|
|
|
+ private Integer videoNum;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private MatchVideoMapper matchVideoMapper;
|
|
private MatchVideoMapper matchVideoMapper;
|
|
@@ -374,7 +376,7 @@ public class ContentServiceImpl implements ContentService {
|
|
|
AIVideoAbTest aiVideoAbTest = aiVideoAbTests.get(0);
|
|
AIVideoAbTest aiVideoAbTest = aiVideoAbTests.get(0);
|
|
|
abTestList.add(aiVideoAbTest);
|
|
abTestList.add(aiVideoAbTest);
|
|
|
int size = abTestList.size();
|
|
int size = abTestList.size();
|
|
|
- for (int i = size; i < VIDEO_NUM; i++) {
|
|
|
|
|
|
|
+ for (int i = size; i < videoNum; i++) {
|
|
|
AIVideoAbTest newAiVideoAbTest = new AIVideoAbTest();
|
|
AIVideoAbTest newAiVideoAbTest = new AIVideoAbTest();
|
|
|
BeanUtils.copyProperties(aiVideoAbTest, newAiVideoAbTest);
|
|
BeanUtils.copyProperties(aiVideoAbTest, newAiVideoAbTest);
|
|
|
abTestList.add(newAiVideoAbTest);
|
|
abTestList.add(newAiVideoAbTest);
|
|
@@ -530,17 +532,17 @@ public class ContentServiceImpl implements ContentService {
|
|
|
if (planAccount == null) {
|
|
if (planAccount == null) {
|
|
|
return crawlerVideoList;
|
|
return crawlerVideoList;
|
|
|
}
|
|
}
|
|
|
- if (crawlerVideoList.size() < VIDEO_NUM) {
|
|
|
|
|
|
|
+ if (crawlerVideoList.size() < videoNum) {
|
|
|
CrawlerVideo crawlerVideo = crawlerVideoList.get(0);
|
|
CrawlerVideo crawlerVideo = crawlerVideoList.get(0);
|
|
|
- int needAddCount = VIDEO_NUM - crawlerVideoList.size();
|
|
|
|
|
|
|
+ int needAddCount = videoNum - crawlerVideoList.size();
|
|
|
for (int i = 0; i < needAddCount; i++) {
|
|
for (int i = 0; i < needAddCount; i++) {
|
|
|
CrawlerVideo copyCrawlerVideo = new CrawlerVideo();
|
|
CrawlerVideo copyCrawlerVideo = new CrawlerVideo();
|
|
|
BeanUtils.copyProperties(crawlerVideo, copyCrawlerVideo);
|
|
BeanUtils.copyProperties(crawlerVideo, copyCrawlerVideo);
|
|
|
crawlerVideoList.add(copyCrawlerVideo);
|
|
crawlerVideoList.add(copyCrawlerVideo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (crawlerVideoList.size() > VIDEO_NUM) {
|
|
|
|
|
- return crawlerVideoList.subList(0, VIDEO_NUM);
|
|
|
|
|
|
|
+ if (crawlerVideoList.size() > videoNum) {
|
|
|
|
|
+ return crawlerVideoList.subList(0, videoNum);
|
|
|
}
|
|
}
|
|
|
log.info("getContentMiniVideo crawlerVideoList={}", crawlerVideoList);
|
|
log.info("getContentMiniVideo crawlerVideoList={}", crawlerVideoList);
|
|
|
return crawlerVideoList;
|
|
return crawlerVideoList;
|