Ver Fonte

抖小IAA数据回补

huangpingkang há 1 ano atrás
pai
commit
a38bd8f10e

+ 5 - 0
job-bytedance/pom.xml

@@ -178,6 +178,11 @@
             <artifactId>spring-boot-starter-data-redis</artifactId>
         </dependency>
         <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>2.9.0</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-pool2</artifactId>
             <version>2.6.2</version>

+ 18 - 5
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/controller/BytedanceController.java

@@ -1,9 +1,6 @@
 package cn.com.ctop.job.bytedance.controller;
 
-import cn.com.ctop.job.bytedance.data.service.IAdminAdvertiserListService;
-import cn.com.ctop.job.bytedance.data.service.IBytedanceAccountReportService;
-import cn.com.ctop.job.bytedance.data.service.IBytedanceProductReportService;
-import cn.com.ctop.job.bytedance.data.service.IBytedancePromoterReportService;
+import cn.com.ctop.job.bytedance.data.service.*;
 import cn.com.ctop.job.bytedance.data.utils.Check;
 import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
@@ -43,6 +40,9 @@ public class BytedanceController {
     @Autowired
     private IBytedancePromoterReportService promoterReportService;
 
+    @Autowired
+    private IBytedanceMiniAppService bytedanceMiniAppService;
+
 
     @GetMapping("/accountReport")
     public void getChannel(String param) {
@@ -57,7 +57,7 @@ public class BytedanceController {
                 public void run() {
                     if (!Check.isNull(accessToken)) {
                         accountReportService.getBytedanceAccountDaily(advertiserId, accessToken, "2025-02-15", "2025-03-25", 1, 1);
-                  //      accountReportService.getBytedanceAccountHour(advertiserId, accessToken, "2025-02-15", "2025-03-25", 1, 1);
+                        //      accountReportService.getBytedanceAccountHour(advertiserId, accessToken, "2025-02-15", "2025-03-25", 1, 1);
                     }
                 }
             });
@@ -83,7 +83,20 @@ public class BytedanceController {
                 }
             });
         }
+    }
 
+    @GetMapping("/maEcpm")
+    public void maEcpm(@RequestParam(required = false) String appId, String startDate, String endDate) {
+        if (Check.isNull(startDate) || Check.isNull(endDate)) {
+            return;
+        }
+        List<String> iaaAppIds = bytedanceMiniAppService.getIaaAppIds();
+        for (String iaaAppId : iaaAppIds) {
+            if (appId != null && !appId.equals(iaaAppId)) {
+                continue;
+            }
+            bytedanceMiniAppService.getMaEcpm(startDate, endDate, appId, 1, null, null);
+        }
     }
 
 

+ 20 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/BytedanceMiniAppMapper.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.job.bytedance.data.mapper;
+
+import cn.com.ctop.job.bytedance.data.entity.BytedanceAdvertiserReportDaily;
+import cn.com.ctop.job.bytedance.data.entity.BytedanceAdvertiserReportHour;
+import cn.com.ctop.job.bytedance.data.entity.BytedanceErrorLog;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface BytedanceMiniAppMapper {
+    List<String> getEcpmKeys(@Param("startDate") Integer startDate,
+                             @Param("endDate") Integer endDate,
+                             @Param("startTime") String startTime,
+                             @Param("endTime") String endTime);
+
+    List<String> getIaaAppIds();
+
+    List<JSONObject> getMaEcpmRetryJob();
+}

+ 19 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/BytedanceMiniAppMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="cn.com.ctop.job.bytedance.data.mapper.BytedanceMiniAppMapper">
+    <select id="getEcpmKeys" resultType="java.lang.String">
+        SELECT concat(event_timestamp,open_id,cost) as ecpm_keys from media_api.bytedance_webhook_ma_ecpm
+        where stat_date >=  #{startDate} and stat_date &lt;= #{endDate}
+          and event_time >= #{startTime} and event_time &lt;= #{endTime}
+    </select>
+
+    <select id="getIaaAppIds" resultType="java.lang.String">
+        select app_id from deepthink.mini_app_info where business_method in('IAA','MIX') and app_id like 'tt%'
+    </select>
+
+    <select id="getMaEcpmRetryJob" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT is_send AS 'isSend', id AS 'id', start_date AS 'startDate', end_date AS 'endDate', data_dimension AS 'dataDimension', data_type AS 'dataType'
+        FROM media_api.bytedance_error_log where   data_dimension like 'ma_ecpm:%'
+    </select>
+
+</mapper>

+ 11 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/IBytedanceMiniAppService.java

@@ -0,0 +1,11 @@
+package cn.com.ctop.job.bytedance.data.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+
+public interface IBytedanceMiniAppService {
+    List<String> getIaaAppIds();
+    void getMaEcpm(String startDt, String endDt, String appId, Integer isLog, Long errId, Integer isSend);
+    List<JSONObject> getMaEcpmRetryJob();
+}

+ 153 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceMiniAppServiceImpl.java

@@ -0,0 +1,153 @@
+package cn.com.ctop.job.bytedance.data.service.impl;
+
+import cn.com.ctop.job.bytedance.data.entity.BytedanceErrorLog;
+import cn.com.ctop.job.bytedance.data.mapper.BytedanceMiniAppMapper;
+import cn.com.ctop.job.bytedance.data.mapper.BytedancePromoterReportMapper;
+import cn.com.ctop.job.bytedance.data.service.IBytedanceMiniAppService;
+import cn.com.ctop.job.bytedance.data.utils.Check;
+import cn.com.ctop.job.bytedance.data.utils.DateUtils;
+import cn.com.ctop.job.bytedance.data.utils.HttpUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@Slf4j
+public class BytedanceMiniAppServiceImpl implements IBytedanceMiniAppService {
+    @Resource
+    private RedisTemplate redis2Template_db5;
+
+    @Autowired
+    private BytedanceMiniAppMapper bytedanceMiniAppMapper;
+
+    @Autowired
+    private BytedancePromoterReportMapper promoterReportMapper;
+
+    @Override
+    public List<String> getIaaAppIds() {
+        return bytedanceMiniAppMapper.getIaaAppIds();
+    }
+
+    @Override
+    public List<JSONObject> getMaEcpmRetryJob() {
+        return bytedanceMiniAppMapper.getMaEcpmRetryJob();
+    }
+
+    @Override
+    public void getMaEcpm(String startDt, String endDt, String appId, Integer isLog, Long errId, Integer isSend) {
+        try {
+            Long dataRangeSeconds = 3600L;
+            String startTime = startDt + (startDt.contains(" ") ? "" : " 00:00:00");
+            Long startT = DateUtils.getTimestampFormat("yyyy-MM-dd HH:mm:ss", startTime);
+            String endTime = endDt + (endDt.contains(" ") ? "" : " 23:59:59");
+            Long endT = DateUtils.getTimestampFormat("yyyy-MM-dd HH:mm:ss", endTime) + 1;
+            boolean hasMoreTime = true;
+            while (hasMoreTime) {
+                Long thisEndT = startT + dataRangeSeconds;
+                if (thisEndT >= endT) {
+                    thisEndT = endT;
+                }
+                String endEventTime = DateUtils.formatTimestamp("yyyy-MM-dd HH:mm:ss", thisEndT);
+                Integer endEventDate = Integer.parseInt(DateUtils.formatTimestamp("yyyyMMdd", thisEndT));
+                String startEventTime = DateUtils.formatTimestamp("yyyy-MM-dd HH:mm:ss", startT);
+                Integer startEventDate = Integer.parseInt(DateUtils.formatTimestamp("yyyyMMdd", startT));
+                List<String> ecpmKeys = bytedanceMiniAppMapper.getEcpmKeys(startEventDate, endEventDate, startEventTime, endEventTime);
+                String nextCursor = null;
+                boolean hasMore = true;
+                while (hasMore) {
+                    log.info("抖小ma_ecpm拉取 [{}] {}~{} {}", appId, startEventTime, endEventTime, nextCursor);
+                    String url = "https://open.douyin.com/api/traffic/v2/rt_ecpm/query/";
+                    Object tokenObj = redis2Template_db5.opsForValue().get("client-token-key_" + appId);
+                    if (tokenObj == null) {
+                        log.error("抖小ma_ecpm拉取获取token为空 [{}] {}~{} {}", appId, startEventTime, endEventTime, nextCursor);
+                        return;
+                    }
+                    Map<String, Object> params = new JSONObject();
+                    params.put("start_date", startEventTime);
+                    params.put("end_date", endEventTime);
+                    params.put("page_size", 500);
+                    if (nextCursor != null) {
+                        params.put("cursor", nextCursor);
+                    }
+                    HashMap<String, String> headers = new HashMap<>();
+                    headers.put("access-token", tokenObj.toString());
+                    headers.put("Content-Type", "application/json; charset=UTF-8");
+
+                    String s = HttpUtils.httpPostRequest(url, params, headers);
+                    JSONObject jsonObject = JSONObject.parseObject(s);
+                    JSONArray content = new JSONArray();
+                    if (!Check.isNull(jsonObject)) {
+                        Integer code = jsonObject.getInteger("err_no");
+                        if (code == 0) {
+                            JSONObject data = jsonObject.getJSONObject("data");
+
+                            nextCursor = data.getString("next_cursor");
+                            JSONArray result = data.getJSONArray("records");
+                            if (!Check.isNull(result)) {
+                                for (int i = 0; i < result.size(); i++) {
+                                    JSONObject resultJson = result.getJSONObject(i);
+                                    String eventTime = resultJson.getString("event_time");
+                                    String openId = resultJson.getString("open_id");
+                                    String cost = resultJson.getString("cost");
+                                    if (ecpmKeys.contains(eventTime + openId + cost)) {
+                                        continue;
+                                    }
+                                    content.add(resultJson);
+                                }
+                            } else {
+                                hasMore = false;
+                            }
+                        } else {
+                            log.error("[{}]抖小ma_ecpm拉取失败{}~{},返回信息:{}", appId, startEventTime, endEventTime, s);
+                            insertErrorLog(isLog, startEventTime, endTime, "ma_ecpm:" + appId, "daily", s);
+                            return;
+                        }
+                    } else {
+                        log.error("[{}]抖小ma_ecpm拉取返回数据为空{}~{}", appId, startEventTime, endEventTime);
+                        insertErrorLog(isLog, startEventTime, endTime, "ma_ecpm:" + appId, "daily", "数据返回空");
+                        return;
+                    }
+
+                    if (!content.isEmpty()) {
+                        String pushUrl = "https://push.artlinkworld.cn/bytedance/push/miniapp/webhook";
+                        JSONObject pushParam = new JSONObject();
+                        pushParam.put("content", content.toJSONString());
+                        pushParam.put("client_key", appId);
+                        pushParam.put("event", "ma_ecpm");
+                        HttpUtils.httpPostRequest(pushUrl, pushParam, null);
+                    }
+                }
+                hasMoreTime = thisEndT < endT;
+                startT = thisEndT;
+                if (errId != null) {
+                    promoterReportMapper.deleteInfoByErrorId(errId);
+                }
+            }
+            log.info("[{}]抖小ma_ecpm拉取完成{}~{}.", appId, startDt, endDt);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void insertErrorLog(Integer isLog, String startDate, String endDate, String dataDimension, String dataType, String msg) {
+        if (isLog != null && 1 == isLog) {
+            BytedanceErrorLog errorInfo = new BytedanceErrorLog();
+            errorInfo.setAdvertiserId(-1L);
+            errorInfo.setStartDate(startDate);
+            errorInfo.setEndDate(endDate);
+            errorInfo.setDataDimension(dataDimension);
+            errorInfo.setDataType(dataType);
+            errorInfo.setMsg(msg);
+            promoterReportMapper.replaceErrorInfo(errorInfo);
+        }
+    }
+
+}

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/utils/HttpUtils.java

@@ -122,7 +122,7 @@ public class HttpUtils {
                 return httpPostRequest(newUrl, param, headers);
             } else if (statusCode == HttpStatus.SC_OK) {
                 respentity = response.getEntity();
-                strReturn = EntityUtils.toString(respentity);
+                strReturn = EntityUtils.toString(respentity,"UTF-8");
                 return strReturn;
             }
         } catch (Exception e) {

+ 29 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMiniAppJob.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.job.bytedance.handler;
+
+
+import cn.com.ctop.job.bytedance.data.service.IBytedanceMiniAppService;
+import cn.com.ctop.job.bytedance.data.utils.DateUtils;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+@Slf4j
+@Component
+public class BytedanceMiniAppJob {
+    @Autowired
+    private IBytedanceMiniAppService bytedanceMiniAppService;
+
+    @XxlJob("yesterdayMaEcpm")
+    public void yesterdayMaEcpm() throws Exception {
+        List<String> iaaAppIds = bytedanceMiniAppService.getIaaAppIds();
+        for (String iaaAppId : iaaAppIds) {
+            String date = DateUtils.getNowAddDate("yyyy-MM-dd", -1);
+            bytedanceMiniAppService.getMaEcpm(date, date, iaaAppId, 1, null, null);
+        }
+    }
+
+}

+ 22 - 4
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceReportRetryJob.java

@@ -1,10 +1,7 @@
 package cn.com.ctop.job.bytedance.handler;
 
 
-import cn.com.ctop.job.bytedance.data.service.IBytedanceAccountReportService;
-import cn.com.ctop.job.bytedance.data.service.IBytedanceProductReportService;
-import cn.com.ctop.job.bytedance.data.service.IBytedancePromoterReportService;
-import cn.com.ctop.job.bytedance.data.service.IChannelService;
+import cn.com.ctop.job.bytedance.data.service.*;
 import cn.com.ctop.job.bytedance.data.utils.Check;
 import com.alibaba.fastjson.JSONObject;
 import com.xxl.job.core.handler.annotation.XxlJob;
@@ -37,6 +34,9 @@ public class BytedanceReportRetryJob {
     @Autowired
     private IChannelService channelService;
 
+    @Autowired
+    private IBytedanceMiniAppService miniAppService;
+
 
     private static ExecutorService hourAccountRetrExecutorService = Executors.newFixedThreadPool(2);
     private static ExecutorService dailyAccountRetrExecutorService = Executors.newFixedThreadPool(2);
@@ -147,6 +147,24 @@ public class BytedanceReportRetryJob {
             log.info("常读重试列表为空");
         }
 
+        List<JSONObject> maEcpmRetryJob = miniAppService.getMaEcpmRetryJob();
+        if (!Check.isNull(maEcpmRetryJob)) {
+            for (int i = 0; i < maEcpmRetryJob.size(); i++) {
+                JSONObject jsonObject = maEcpmRetryJob.get(i);
+                Long id = jsonObject.getLong("id");
+                String startDate = jsonObject.getString("startDate");
+                String endDate = jsonObject.getString("endDate");
+                String dataDimension = jsonObject.getString("dataDimension");
+                Integer isSend = jsonObject.getInteger("isSend");
+                if (dataDimension != null && dataDimension.startsWith("ma_ecpm:")) {
+                    String appId = dataDimension.split(":")[1];
+                    miniAppService.getMaEcpm(startDate, endDate, appId, 1, id, isSend);
+                }
+            }
+        } else {
+            log.info("抖小IAA重试列表为空");
+        }
+
 
     }
 

+ 206 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/utils/Redis2Config.java

@@ -0,0 +1,206 @@
+package cn.com.ctop.job.bytedance.utils;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+import redis.clients.jedis.JedisPoolConfig;
+
+@Configuration
+public class Redis2Config {
+
+    @Value("${spring.redis2.host}")
+    private String host;
+
+    @Value("${spring.redis2.port}")
+    private int port;
+
+    @Value("${spring.redis2.database}")
+    private int database;
+
+    @Value("${spring.redis2.password}")
+    private String password;
+
+    @Value("${spring.redis2.pool.max-idle}")
+    private int maxIdle;
+
+    @Value("${spring.redis2.pool.min-idle}")
+    private int minIdle;
+
+    @Value("${spring.redis2.pool.max-active}")
+    private int maxActive;
+
+    @Value("${spring.redis2.pool.max-wait}")
+    private int maxWait;
+
+
+    /**
+     * JedisPoolConfig 连接池
+     * @return
+     */
+    public JedisPoolConfig redis2PoolConfig() {
+        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
+        // 最大空闲数
+        jedisPoolConfig.setMaxIdle(maxIdle);
+        jedisPoolConfig.setMinIdle(minIdle);
+        // 连接池的最大数据库连接数
+        jedisPoolConfig.setMaxTotal(maxActive);
+        // 最大建立连接等待时间
+        jedisPoolConfig.setMaxWaitMillis(maxWait);
+        return jedisPoolConfig;
+    }
+
+    private JedisConnectionFactory redis2ConnectionFactory(JedisPoolConfig redisPoolConfig, int database){
+
+        JedisConnectionFactory JedisConnectionFactory = new JedisConnectionFactory(redisPoolConfig);
+
+        JedisConnectionFactory.setHostName(host);
+        JedisConnectionFactory.setPort(port);
+        JedisConnectionFactory.setPassword(password);
+        JedisConnectionFactory.setDatabase(database);
+        JedisConnectionFactory.afterPropertiesSet();
+        return JedisConnectionFactory;
+    }
+
+    private RedisTemplate buildRedis2Template(RedisConnectionFactory connectionFactory){
+
+        RedisTemplate template = new RedisTemplate();
+        template.setConnectionFactory(connectionFactory);
+
+        RedisSerializer<String> stringSerializer = new StringRedisSerializer();
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+
+        template.setKeySerializer(stringSerializer);
+        template.setValueSerializer(stringSerializer);
+        template.setHashKeySerializer(stringSerializer);
+        template.setHashValueSerializer(jackson2JsonRedisSerializer);
+
+        template.afterPropertiesSet();
+        return template;
+    }
+
+    @Bean(name = "redis2TemplateDefault")
+    public RedisTemplate redis2TemplateDefault() {
+        RedisTemplate redisTemplate = buildRedis2Template(redis2ConnectionFactory(redis2PoolConfig(), database));
+        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
+        return redisTemplate;
+    }
+
+    @Bean(name = "redis2Template_db2")
+    public RedisTemplate redis2Template_db2() {
+        RedisTemplate redisTemplate = buildRedis2Template(redis2ConnectionFactory(redis2PoolConfig(), 2));
+        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
+        return redisTemplate;
+    }
+
+    @Bean(name = "redis2Template_db5")
+    public RedisTemplate redis2Template_db5() {
+        RedisTemplate redisTemplate = buildRedis2Template(redis2ConnectionFactory(redis2PoolConfig(), 5));
+        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
+        return redisTemplate;
+    }
+
+    @Bean(name = "redis2Template_db6")
+    public RedisTemplate redis2Template_db6() {
+        RedisTemplate redisTemplate = buildRedis2Template(redis2ConnectionFactory(redis2PoolConfig(), 6));
+        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
+        return redisTemplate;
+    }
+
+    @Bean(name = "redis2Template_db7")
+    public RedisTemplate redis2Template_db7() {
+        RedisTemplate redisTemplate = buildRedis2Template(redis2ConnectionFactory(redis2PoolConfig(), 7));
+        return redisTemplate;
+    }
+
+    @Bean(name = "redis2Template_db8")
+    public RedisTemplate redis2Template_db8() {
+        RedisTemplate redisTemplate = buildRedis2Template(redis2ConnectionFactory(redis2PoolConfig(), 8));
+        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
+        return redisTemplate;
+    }
+
+    @Bean(name = "redis2Template_db9")
+    public RedisTemplate redis2Template_db9() {
+        RedisTemplate redisTemplate = buildRedis2Template(redis2ConnectionFactory(redis2PoolConfig(), 9));
+        redisTemplate.setHashValueSerializer(new StringRedisSerializer());
+        return redisTemplate;
+    }
+
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public void setDatabase(int database) {
+        this.database = database;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public void setMaxIdle(int maxIdle) {
+        this.maxIdle = maxIdle;
+    }
+
+    public void setMinIdle(int minIdle) {
+        this.minIdle = minIdle;
+    }
+
+    public void setMaxActive(int maxActive) {
+        this.maxActive = maxActive;
+    }
+
+    public void setMaxWait(int maxWait) {
+        this.maxWait = maxWait;
+    }
+
+    public String getHost() {
+
+        return host;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public int getDatabase() {
+        return database;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public int getMaxIdle() {
+        return maxIdle;
+    }
+
+    public int getMinIdle() {
+        return minIdle;
+    }
+
+    public int getMaxActive() {
+        return maxActive;
+    }
+
+    public int getMaxWait() {
+        return maxWait;
+    }
+}

+ 11 - 1
job-bytedance/src/main/resources/application.yml

@@ -81,7 +81,7 @@ spring:
       datasource:
         master:
           url: jdbc:mysql://172.16.0.117:3390/media_api?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-         # url: jdbc:mysql://8.147.135.80:3390/media_api?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&useSSL=false
+          #url: jdbc:mysql://8.147.135.80:3390/media_api?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&useSSL=false
           username: data
           password: hr@2025..
           driver-class-name: com.mysql.jdbc.Driver
@@ -109,6 +109,16 @@ spring:
         # #连接池最大阻塞等待时间(使用负值表示没有限制)
         max-wait: -1ms
 
+  redis2:
+    database: 0
+    host: r-2zelacjrljt205nsb1pd.redis.rds.aliyuncs.com
+    password: Huanrui@2025!@
+    pool:
+      max-active: 10
+      max-idle: 10
+      max-wait: 80
+      min-idle: 8
+    port: 6379
 
 
 #mybatis plus 设置