xueyiming 5 hónapja
szülő
commit
417466f04e

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/enums/ContentStatusEnum.java

@@ -2,6 +2,8 @@ package com.tzld.piaoquan.longarticle.common.enums;
 
 public enum ContentStatusEnum {
 
+    DEFAULT(0, "初始状态"),
+    KIMI_SUCCESS(1, "kimi执行成功"),
     CRAWLER_SUCCESS(2, "爬取视频成功"),
     SUCCESS_3(3, "下载成功"),
     SUCCESS_4(4, "发布成功"),

+ 6 - 6
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/MatchVideoServiceImpl.java

@@ -214,7 +214,7 @@ public class MatchVideoServiceImpl {
 
 
     public void processKimiMatchContent(MatchVideo matchVideo) {
-        if (matchVideo.getContentStatus() != 0) {
+        if (matchVideo.getContentStatus() != ContentStatusEnum.DEFAULT.getStatusCode()) {
             return;
         }
         //1.执行kimi任务
@@ -230,13 +230,13 @@ public class MatchVideoServiceImpl {
             if (lock) {
                 boolean res = kimiService.updateKimiContent(matchVideo.getContentId());
                 if (res) {
-                    updateStatus(matchVideo.getId(), 1);
+                    updateStatus(matchVideo.getId(), ContentStatusEnum.KIMI_SUCCESS.getStatusCode());
                 }
                 redisLock.unlock(lockKey, lockValue);
             }
         } else {
             //更新状态为kimi执行完成
-            updateStatus(matchVideo.getId(), 1);
+            updateStatus(matchVideo.getId(), ContentStatusEnum.KIMI_SUCCESS.getStatusCode());
         }
 
     }
@@ -291,7 +291,7 @@ public class MatchVideoServiceImpl {
 
 
     public void processCrawlerMatchContent(MatchVideo matchVideo) {
-        if (matchVideo.getContentStatus() != 1) {
+        if (matchVideo.getContentStatus() != ContentStatusEnum.KIMI_SUCCESS.getStatusCode()) {
             return;
         }
         boolean existCrawlerVideo = crawlerVideoService.existCrawlerVideo(matchVideo.getContentId());
@@ -417,7 +417,7 @@ public class MatchVideoServiceImpl {
     }
 
     public void processUploadCrawlerVideo(MatchVideo matchVideo) {
-        if (matchVideo.getContentStatus() != 2) {
+        if (matchVideo.getContentStatus() != ContentStatusEnum.CRAWLER_SUCCESS.getStatusCode()) {
             return;
         }
         boolean existUploadCrawlerVideo = crawlerVideoService.existUploadCrawlerVideo(matchVideo.getContentId());
@@ -476,7 +476,7 @@ public class MatchVideoServiceImpl {
                 MatchVideoExample example = new MatchVideoExample();
                 example.createCriteria().andIdGreaterThan(id)
                         .andContentStatusEqualTo(ContentStatusEnum.SUCCESS_3.getStatusCode())
-                        .andPublishFlagEqualTo(1);
+                        .andPublishFlagEqualTo(PublicFlagEnum.PUBLIC.getStatusCode());
                 example.setOrderByClause("id asc");
                 Page<Object> page = new Page<>();
                 page.setCurrentPage(1);