Ver código fonte

视频内容池晋级增加视频处理任务

wangyunpeng 3 meses atrás
pai
commit
21ba09005a

+ 4 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/LongArticleBaseMapper.java

@@ -89,4 +89,8 @@ public interface LongArticleBaseMapper {
     List<String> getPassContentIds();
 
     List<DatastatSortStrategy> getTopContent(String dateStr);
+
+    VideoEndScreenTransformationTask getVideoEndScreenTransformationTask(Long videoOriginId);
+
+    void saveVideoEndScreenTransformationTask(VideoEndScreenTransformationTask task);
 }

+ 43 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/VideoEndScreenTransformationTask.java

@@ -0,0 +1,43 @@
+package com.tzld.longarticle.recommend.server.model.entity.longArticle;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@Table(name = "video_end_screen_transformation_task")
+public class VideoEndScreenTransformationTask {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "task_id")
+    private Long TaskId;
+
+    @Column(name = "video_origin_type")
+    private String videoOriginType ;
+
+    @Column(name = "video_origin_id")
+    private Long videoOriginId;
+
+    @Column(name = "title")
+    private String title;
+
+    @Column(name = "oss_path")
+    private String ossPath;
+
+    @Column(name = "new_oss_path")
+    private String newOssPath;
+
+    @Column(name = "status")
+    private Integer status;
+
+    @Column(name = "status_update_timestamp")
+    private Date statusUpdateTimestamp;
+
+}

+ 11 - 5
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticlePromotionService.java

@@ -16,10 +16,7 @@ import com.tzld.longarticle.recommend.server.model.dto.CrawlerContent;
 import com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO;
 import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.PublishSortLog;
-import com.tzld.longarticle.recommend.server.model.entity.longArticle.ArticlePoolPromotionSource;
-import com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy;
-import com.tzld.longarticle.recommend.server.model.entity.longArticle.PublishSingleVideoSource;
-import com.tzld.longarticle.recommend.server.model.entity.longArticle.VideoTitleReWrite;
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.*;
 import com.tzld.longarticle.recommend.server.model.param.PublishContentParam;
 import com.tzld.longarticle.recommend.server.model.vo.IdNameVO;
 import com.tzld.longarticle.recommend.server.model.vo.WxContentDetailResponse;
@@ -450,7 +447,7 @@ public class ArticlePromotionService {
             upLevel.setUpLevelSource(singleVideoSource.getContentTraceId());
             upLevel.setContentTraceId("video" + UUID.randomUUID().toString().replace("-", ""));
             upLevel.setFlowPoolLevel(poolLevel);
-            publishSingleVideoSourceRepository.save(upLevel);
+            upLevel = publishSingleVideoSourceRepository.save(upLevel);
 
             List<VideoTitleReWrite> videoTitleReWrites = videoTitleReWriteRepository.getByContentTraceId(singleVideoSource.getContentTraceId());
             if (CollectionUtils.isNotEmpty(videoTitleReWrites)) {
@@ -460,6 +457,15 @@ public class ArticlePromotionService {
                     videoTitleReWriteRepository.save(videoTitleReWrite);
                 }
             }
+
+            VideoEndScreenTransformationTask task = new VideoEndScreenTransformationTask();
+            task.setVideoOriginId(upLevel.getId());
+            task.setVideoOriginType("video_pool");
+            task.setTitle(upLevel.getArticleTitle());
+            task.setOssPath(upLevel.getVideoOssPath());
+            task.setStatus(0);
+            longArticleBaseMapper.saveVideoEndScreenTransformationTask(task);
+
             promotionNum++;
         }
         ContentPoolEnum poolEnum = ContentPoolEnum.from(poolLevel);

+ 12 - 1
long-article-recommend-service/src/main/resources/mapper/longArticle/LongArticleBaseMapper.xml

@@ -335,7 +335,18 @@
                          and first_level is not null
                          and strategy is not null
                        GROUP BY title) top on dss.title = top.title and dss.read_rate = top.read_rate
-        limit 100
     </select>
 
+    <select id="getVideoEndScreenTransformationTask"
+            resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.VideoEndScreenTransformationTask">
+        select * from video_end_screen_transformation_task where video_origin_id = #{videoOriginId}
+    </select>
+
+    <insert id="saveVideoEndScreenTransformationTask">
+        insert into video_end_screen_transformation_task
+        (video_origin_id, video_origin_type, title, oss_path, status)
+        values
+        (#{videoOriginId}, #{videoOriginType}, #{title}, #{ossPath}, #{status})
+    </insert>
+
 </mapper>