wangyunpeng 13 часов назад
Родитель
Сommit
0848b92e4c

+ 4 - 5
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDemandVideoJob.java

@@ -13,6 +13,7 @@ import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
@@ -35,10 +36,8 @@ public class ContentPlatformDemandVideoJob {
     @Autowired
     @Autowired
     private MessageAttachmentService messageAttachmentService;
     private MessageAttachmentService messageAttachmentService;
 
 
-    private static final List<String> SYNC_CHANNEL_NAMES = Arrays.asList(
-            "公众号合作-即转-稳定",
-            "群/企微合作-稳定"
-    );
+    @ApolloJsonValue("${sync.channel.names:[\"公众号合作-即转-稳定\",\"群/企微合作-稳定\",\"公众号合作-Daily-自选\"]}")
+    private List<String> syncChannelNames;
 
 
     @XxlJob("syncContentPlatformDemandVideoJob")
     @XxlJob("syncContentPlatformDemandVideoJob")
     public ReturnT<String> syncContentPlatformDemandVideoJob(String param) {
     public ReturnT<String> syncContentPlatformDemandVideoJob(String param) {
@@ -48,7 +47,7 @@ public class ContentPlatformDemandVideoJob {
         }
         }
         log.info("syncContentPlatformDemandVideoJob start, dt={}", dt);
         log.info("syncContentPlatformDemandVideoJob start, dt={}", dt);
 
 
-        for (String syncChannelName : SYNC_CHANNEL_NAMES) {
+        for (String syncChannelName : syncChannelNames) {
             try {
             try {
                 syncByChannel(dt, syncChannelName);
                 syncByChannel(dt, syncChannelName);
             } catch (Exception e) {
             } catch (Exception e) {