From 6378b1e03b15e66ce58ebdb0f748f1330e2324d9 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期二, 05 八月 2025 09:14:15 +0800 Subject: [PATCH] 修改首页视频显示问题 --- framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java index 9cc98f7..0679ce2 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java @@ -19,6 +19,8 @@ import cn.lili.modules.member.entity.dos.Member; import cn.lili.modules.member.service.FootprintService; import cn.lili.modules.member.service.MemberService; +import cn.lili.modules.permission.entity.dos.AdminUser; +import cn.lili.modules.permission.service.AdminUserService; import cn.lili.modules.search.entity.dos.EsGoodsIndex; import cn.lili.rocketmq.RocketmqSendCallbackBuilder; import cn.lili.rocketmq.tags.CommentTagsEnum; @@ -85,7 +87,7 @@ private final VideoGoodsService videoGoodsService; private final KitchenTypeService kitchenTypeService; private final Cache cache; - + private final AdminUserService adminUserService; private final RocketmqCustomProperties rocketmqCustomProperties; private final RocketMQTemplate rocketMQTemplate; private final ThumbsUpRecordService thumbsUpRecordService; @@ -251,7 +253,9 @@ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_ADD_OR_UPDATE.name(); rocketMQTemplate.asyncSend(destination, JSON.toJSONString(videoIndex), RocketmqSendCallbackBuilder.commonCallback()); return Result.ok("鍙戝竷鎴愬姛锛岃棰戝鏍镐腑~"); - } @Override + } + + @Override @Transactional(rollbackFor = Exception.class) public Result systemPublish(WxVideoForm form) { // 1.淇濆瓨瑙嗛 @@ -426,7 +430,10 @@ // 3. 鑾峰彇瑙嗛涓存椂璁块棶鍦板潃銆佽缃棰戞爣绛� page.getRecords().forEach(v -> { v.setTagList(tagMap.get(v.getId())); - v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverUrl())); + String coverUrl = v.getCoverUrl(); + if (StringUtils.isNotBlank(coverUrl)&&!coverUrl.contains("http")) { + 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())); @@ -626,7 +633,10 @@ v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum())); v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum())); v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum())); - v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); + String authorAvatar = v.getAuthorAvatar(); + if (StringUtils.isNotBlank(authorAvatar)&&!authorAvatar.contains("http")) { + v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); + } if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); @@ -799,7 +809,13 @@ @Override public Result getAuthorInfo(String authorId) { - VideoAccountVO vo = baseMapper.getAuthorInfo(authorId, UserContext.getCurrentUserId()); + AdminUser adminUser = adminUserService.getById(authorId); + VideoAccountVO vo; + if (Objects.isNull(adminUser)) { + vo = baseMapper.getAuthorInfo(authorId, UserContext.getCurrentUserId()); + }else { + vo = baseMapper.getAuthorInfoAdmin(authorId, UserContext.getCurrentUserId()); + } vo.setSelf(authorId.equals(UserContext.getCurrentUserId())); // 鏌ヨ鑾疯禐鏁� List<String> videoIds = baseMapper.getVideoIdsByAuthor(authorId); -- Gitblit v1.8.0