|
|
@@ -16,6 +16,7 @@ import cn.reghao.tnb.content.app.vod.db.mapper.VideoCategoryPostMapper;
|
|
|
import cn.reghao.tnb.content.app.vod.db.mapper.VideoPostMapper;
|
|
|
import cn.reghao.tnb.content.app.vod.db.mapper.VideoStatisticMapper;
|
|
|
import cn.reghao.tnb.content.app.vod.db.mapper.VideoTagMapper;
|
|
|
+import cn.reghao.tnb.content.app.vod.db.repository.VideoRepository;
|
|
|
import cn.reghao.tnb.content.app.vod.model.po.VideoCategory;
|
|
|
import cn.reghao.tnb.content.app.vod.model.po.VideoPost;
|
|
|
import cn.reghao.tnb.content.app.vod.model.po.VideoCategoryPost;
|
|
|
@@ -57,17 +58,19 @@ public class VideoPostQueryImpl implements VideoPostQuery {
|
|
|
private final VideoTagMapper videoTagMapper;
|
|
|
private final ContentPermission contentPermission;
|
|
|
private final CategoryService categoryService;
|
|
|
+ private final VideoRepository videoRepository;
|
|
|
private final Random random = new SecureRandom();
|
|
|
|
|
|
public VideoPostQueryImpl(VideoPostMapper videoPostMapper, VideoTagMapper videoTagMapper,
|
|
|
VideoStatisticMapper videoStatisticMapper, VideoCategoryPostMapper videoCategoryPostMapper,
|
|
|
- ContentPermission contentPermission, CategoryService categoryService) {
|
|
|
+ ContentPermission contentPermission, CategoryService categoryService, VideoRepository videoRepository) {
|
|
|
this.videoPostMapper = videoPostMapper;
|
|
|
this.videoTagMapper = videoTagMapper;
|
|
|
this.videoStatisticMapper = videoStatisticMapper;
|
|
|
this.videoCategoryPostMapper = videoCategoryPostMapper;
|
|
|
this.contentPermission = contentPermission;
|
|
|
this.categoryService = categoryService;
|
|
|
+ this.videoRepository = videoRepository;
|
|
|
}
|
|
|
|
|
|
public List<VideoCard> getVideoCards(List<String> videoIds) {
|
|
|
@@ -122,7 +125,7 @@ public class VideoPostQueryImpl implements VideoPostQuery {
|
|
|
private String getRandomVideoId() {
|
|
|
long loginUser = UserContext.getUser();
|
|
|
List<Integer> userScopes = contentPermission.getUserScopes(loginUser);
|
|
|
- List<String> videoIds = videoPostMapper.findShortVideo(userScopes);
|
|
|
+ List<String> videoIds = videoRepository.getShortVideoIds(userScopes);
|
|
|
if (videoIds.isEmpty()) {
|
|
|
return null;
|
|
|
}
|