| | |
| | | import cn.lili.cache.CachePrefix; |
| | | import cn.lili.common.properties.RocketmqCustomProperties; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.CommonUtil; |
| | | import cn.lili.elasticsearch.EsSuffix; |
| | | import cn.lili.modules.lmk.constant.RedisKeyExpireConstant; |
| | | import cn.lili.modules.lmk.domain.dto.VideoEsUpdateDTO; |
| | |
| | | import org.springframework.data.elasticsearch.core.SearchHits; |
| | | import org.springframework.data.elasticsearch.core.query.NativeSearchQuery; |
| | | import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | page.getRecords().forEach(v -> { |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverUrl())); |
| | | v.getGoodsList().forEach(goods ->{ |
| | | if (StringUtils.isNotBlank(goods.getThumbnail())&&!goods.getThumbnail().contains("http")) { |
| | | goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail())); |
| | | } |
| | | |
| | | }); |
| | | }); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | |
| | | switch (query.getVideoFrom()) { |
| | | case "recommend":// 加载推荐视频 |
| | | baseMapper.recommendVideo(page, query); |
| | | //推荐视频重新排序 |
| | | List<WxVideoVO> records = page.getRecords(); |
| | | Collections.shuffle(records); |
| | | break; |
| | | case "author": // 加载视频主页我发布的视频 |
| | | AuthorVideoQuery query1 = new AuthorVideoQuery(); |