Browse Source

Merge branch '20251208-wyp-videoCustomTitleCover' into test

wangyunpeng 2 tuần trước cách đây
mục cha
commit
b76304ba51

+ 9 - 3
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -198,7 +198,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         String pageUrl = videoItemVO.getPageUrl();
         try {
             if (Objects.nonNull(video.getCustomTitleId()) && StringUtils.hasText(videoItemVO.getCustomTitle())) {
-                pageUrl += URLEncoder.encode("?shareTitleId=" + video.getCustomTitleId() + "?shareTitle=" + video.getTitle(), "UTF-8");
+                pageUrl += URLEncoder.encode("?shareTitleId=" + video.getCustomTitleId() + "?shareTitle=" + video.getCustomTitle(), "UTF-8");
             }
             if (Objects.nonNull(video.getCustomCoverId()) && StringUtils.hasText(videoItemVO.getCustomCover())) {
                 pageUrl += URLEncoder.encode("?shareImageId=" + video.getCustomCoverId() + "?shareImageUrl=" + URLEncoder.encode(video.getCustomCover(), "UTF-8"), "UTF-8");
@@ -411,14 +411,17 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     private void setCustomTitle(ContentPlatformGzhPlanVideo item, GzhPlanVideoContentItemParam vo) {
         if (StringUtils.hasText(vo.getCustomTitle())) {
             List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = gzhPlanVideoListByVideoTitle(vo.getVideoId());
+            boolean customCoverExist = false;
             if (CollectionUtils.isNotEmpty(gzhPlanVideoList)) {
                 for (ContentPlatformGzhPlanVideo gzhPlanVideo : gzhPlanVideoList) {
                     if (gzhPlanVideo.getCustomTitle().equals(vo.getCustomTitle())) {
                         item.setCustomTitleId(gzhPlanVideo.getCustomTitleId());
+                        customCoverExist = true;
                         break;
                     }
                 }
-            } else {
+            }
+            if (!customCoverExist) {
                 JSONObject multiTitle = managerApiService.videoMultiTitleSave(vo.getVideoId(), vo.getCustomTitle());
                 item.setCustomTitleId(multiTitle.getLong("id"));
             }
@@ -435,14 +438,17 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     private void setCustomCover(ContentPlatformGzhPlanVideo item, GzhPlanVideoContentItemParam vo) {
         if (StringUtils.hasText(vo.getCustomCover())) {
             List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = gzhPlanVideoListByVideoCover(vo.getVideoId());
+            boolean customCoverExist = false;
             if (CollectionUtils.isNotEmpty(gzhPlanVideoList)) {
                 for (ContentPlatformGzhPlanVideo gzhPlanVideo : gzhPlanVideoList) {
                     if (gzhPlanVideo.getCustomCover().equals(vo.getCustomCover())) {
                         item.setCustomCoverId(gzhPlanVideo.getCustomCoverId());
+                        customCoverExist = true;
                         break;
                     }
                 }
-            } else {
+            }
+            if (!customCoverExist) {
                 JSONObject multiCover = managerApiService.videoMultiCoverSave(vo.getVideoId(), vo.getCustomCover());
                 item.setCustomCoverId(multiCover.getLong("id"));
             }