Procházet zdrojové kódy

Merge branch 'cooperation_video_candidate_pool_improved_lld_0509' into test

刘立冬 před 3 dny
rodič
revize
1bf0a563e7

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

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

+ 1 - 1
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -264,7 +264,7 @@
         FROM (
         SELECT video_id, category, title, cover, video,
             SUM(IFNULL(rovn, 0) * (1 + LN(GREATEST(IFNULL(exposure, 0) / 5000.0, 1.0)))
-                * POWER(0.8, DATEDIFF(STR_TO_DATE(#{aggDt}, '%Y%m%d'), STR_TO_DATE(dt, '%Y%m%d'))))
+                * POWER(0.5, DATEDIFF(STR_TO_DATE(#{aggDt}, '%Y%m%d'), STR_TO_DATE(dt, '%Y%m%d'))))
                 OVER (PARTITION BY video_id) AS weighted_score,
             ROW_NUMBER() OVER (PARTITION BY video_id ORDER BY dt DESC) AS rn
         FROM content_platform_video