소스 검색

feat(bytedance): 添加广告主推广小时数据接口并调整Token刷新时间

- 新增advertiserPromoterHour接口,支持获取广告主按小时的推广数据
- 调用promoterReportService的getBytedancePromoterHour方法处理数据请求
- 将Token刷新条件改为23小时刷新,优化Token管理逻辑
- 保持代码结构清晰,便于后续维护和扩展
hpk 2 달 전
부모
커밋
484fd78002

+ 10 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -435,6 +435,16 @@ public class BytedanceController {
         }
     }
 
+    @GetMapping("/advertiserPromoterHour")
+    public void advertiserPromoterHour(String advertiserIds, String startDate, String endDate) {
+        for (String advertiserId : advertiserIds.split(",")){
+            executor10Service1.submit(() -> {
+                String accessToken = accountReportService.getTokenByAdvertiserId(Long.valueOf(advertiserId));
+                promoterReportService.getBytedancePromoterHour(Long.valueOf(advertiserId), accessToken, startDate, endDate, 1, 1);
+            });
+        }
+    }
+
 
     @GetMapping("/getWxAppInfo")
     public void getWxAppInfo(Long advertiserId) {

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/BytedanceRefreshTokenMapper.xml

@@ -18,7 +18,7 @@
     <select id="getTokenToRefreshList" resultType="com.alibaba.fastjson.JSONObject">
         SELECT admin_advertiser_id AS 'adminAdvertiserId', access_token AS 'accessToken', refresh_token AS 'refreshToken', app_id AS 'appId', secret AS 'secret'
         FROM deepthink.bytedance_auth_list
-        where timestampdiff(HOUR,token_update_time,now()) >= 24 or token_update_time is null
+        where timestampdiff(HOUR,token_update_time,now()) >= 23 or token_update_time is null
     </select>
 
     <select id="getBaiduYunTokenList" resultType="com.alibaba.fastjson.JSONObject">