Browse Source

sync videoDetail

wangyunpeng 1 week ago
parent
commit
eabdfe2ac1

+ 6 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -8,6 +8,7 @@ import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoData
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoMapper;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.model.po.contentplatform.*;
+import com.tzld.piaoquan.api.util.CdnUtil;
 import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
 import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
@@ -125,6 +126,11 @@ public class ContentPlatformVideoJob {
                         continue;
                     }
                     String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
+                    if (!cover.startsWith(CdnUtil.VIDEO_CDN_URL_HOST)
+                            && StringUtils.hasText(detail.getVideoCoverSnapshotPath())
+                            && detail.getVideoCoverSnapshotPath().startsWith(CdnUtil.VIDEO_CDN_URL_HOST)) {
+                        cover = detail.getVideoCoverSnapshotPath() + cover.substring(cover.indexOf("?"));
+                    }
                     item.setCover(cover);
                     if (detail.getAuditStatus() != 5) {
                         item.setStatus(0);

+ 2 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/bo/VideoDetail.java

@@ -11,6 +11,8 @@ public class VideoDetail {
 
     private String videoPath;
 
+    private String videoCoverSnapshotPath;
+
     // 审核状态  1 审核中,2 不通过 3 待修改,4 自己可见 5 通过
     private Integer auditStatus;
 

+ 15 - 1
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageAttachmentServiceImpl.java

@@ -322,9 +322,11 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
                 String shareImgPath = jsonObject.getString("shareImgPath");
                 String title = jsonObject.getString("title");
                 String videoPath = jsonObject.getString("videoPath");
+                String videoCoverSnapshotPath = jsonObject.getString("videoCoverSnapshotPath");
                 videoDetail.setCover(shareImgPath);
                 videoDetail.setTitle(title);
                 videoDetail.setVideoPath(videoPath);
+                videoDetail.setVideoCoverSnapshotPath(videoCoverSnapshotPath);
                 videoDetail.setAuditStatus(jsonObject.getInteger("auditStatus"));
                 videoDetail.setRecommendStatus(jsonObject.getInteger("recommendStatus"));
                 map.put(videoId, videoDetail);
@@ -386,7 +388,6 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
 
     }
 
-
     @Override
     public String getPage(Staff staff, Long videoId, String typeOne, String typeTwo) {
         try {
@@ -404,6 +405,19 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
         return null;
     }
 
+    @Override
+    public String getPageNoCache(Staff staff, Long videoId, String typeOne, String typeTwo) {
+        try {
+            if (staff == null || staff.getCarrierId() == null) {
+                return "";
+            }
+            return insertPage(staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
+        } catch (IOException e) {
+            log.error("MessageAttachmentService getPageNoCache error", e);
+        }
+        return null;
+    }
+
     private String insertPage(String carrierId, Long videoId, String remark, String typeOne, String typeTwo) throws IOException {
         AdPutFlowParam param = new AdPutFlowParam();
         param.setChannel("tencentqw");

+ 2 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/MessageAttachmentService.java

@@ -27,6 +27,8 @@ public interface MessageAttachmentService {
 
     String getPage(Staff staff, Long videoId, String typeOne, String typeTwo);
 
+    String getPageNoCache(Staff staff, Long videoId, String typeOne, String typeTwo);
+
     String getPage(String channel, String carrierId, String scene, String putTypeOne, String putTypeTwo, String putTypeThree, Long videoId);
 
     CommonResponse<Long> createAttachment(Integer type, MultipartFile file, String url, String picUrl, String page, String title, String desc, String appId, Integer extType);