From 30457baa3d57a9c81bbbc09edc0878eea7eda557 Mon Sep 17 00:00:00 2001 From: 3y Date: Wed, 2 Mar 2022 21:09:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=AC=A6=E5=90=88=20?= =?UTF-8?q?=E9=98=BF=E9=87=8C=20=E6=8F=92=E4=BB=B6=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../austin/cron/config/AsyncConfiguration.java | 14 +++++++------- .../handler/domain/OfficialAccountParam.java | 2 ++ .../handler/handler/OfficialAccountHandler.java | 4 ++++ .../handler/script/OfficialAccountScript.java | 3 +++ .../austin/handler/script/WxMpTemplateScript.java | 2 +- .../austin/support/utils/ContentHolderUtil.java | 9 --------- .../austin/web/service/impl/DataServiceImpl.java | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/austin-cron/src/main/java/com/java3y/austin/cron/config/AsyncConfiguration.java b/austin-cron/src/main/java/com/java3y/austin/cron/config/AsyncConfiguration.java index 0333cf2..fcf14cb 100644 --- a/austin-cron/src/main/java/com/java3y/austin/cron/config/AsyncConfiguration.java +++ b/austin-cron/src/main/java/com/java3y/austin/cron/config/AsyncConfiguration.java @@ -29,13 +29,13 @@ public class AsyncConfiguration implements AsyncConfigurer { public ThreadPoolTaskExecutor executor(AsyncExecutionProperties properties) { log.info("funExecutor -- init "); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(properties.getCoreSize()); // 核心线程数 - executor.setMaxPoolSize(properties.getMaxSize()); // 最大线程数 - executor.setKeepAliveSeconds(properties.getKeepAlive()); // 最大存活时间 - executor.setQueueCapacity(properties.getQueueCapacity()); // 阻塞队列容量 - executor.setThreadNamePrefix(properties.getThreadNamePrefix()); // 设置名称前缀 - executor.setRejectedExecutionHandler(properties.getRejectedHandler().getHandler());// 设置拒绝策略 - executor.setAllowCoreThreadTimeOut(properties.isAllowCoreThreadTimeout());// 是否允许核心线程超时 + executor.setCorePoolSize(properties.getCoreSize()); + executor.setMaxPoolSize(properties.getMaxSize()); + executor.setKeepAliveSeconds(properties.getKeepAlive()); + executor.setQueueCapacity(properties.getQueueCapacity()); + executor.setThreadNamePrefix(properties.getThreadNamePrefix()); + executor.setRejectedExecutionHandler(properties.getRejectedHandler().getHandler()); + executor.setAllowCoreThreadTimeOut(properties.isAllowCoreThreadTimeout()); executor.setWaitForTasksToCompleteOnShutdown(properties.isWaitForTasksToCompleteOnShutDown()); executor.setAwaitTerminationSeconds(properties.getAwaitTerminationSeconds()); log.info("austinExecutor: {} ", executor); diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/domain/OfficialAccountParam.java b/austin-handler/src/main/java/com/java3y/austin/handler/domain/OfficialAccountParam.java index 61309ee..dd97e83 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/domain/OfficialAccountParam.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/domain/OfficialAccountParam.java @@ -8,10 +8,12 @@ import lombok.NoArgsConstructor; import java.util.Map; /** + * * 模板消息参数 *

* 参数示例: * https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html + * * @author zyg */ @Data @Builder diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/handler/OfficialAccountHandler.java b/austin-handler/src/main/java/com/java3y/austin/handler/handler/OfficialAccountHandler.java index 9d7a158..9207852 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/handler/OfficialAccountHandler.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/handler/OfficialAccountHandler.java @@ -17,6 +17,10 @@ import java.util.List; import java.util.Map; import java.util.Set; +/** + * @author zyg + * 微信服务号推送处理 + */ @Component @Slf4j public class OfficialAccountHandler extends BaseHandler implements Handler { diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/script/OfficialAccountScript.java b/austin-handler/src/main/java/com/java3y/austin/handler/script/OfficialAccountScript.java index 9f3933a..47f0762 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/script/OfficialAccountScript.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/script/OfficialAccountScript.java @@ -4,6 +4,9 @@ import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; import java.util.List; +/** + * @author zyg + */ public interface OfficialAccountScript { /** diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/script/WxMpTemplateScript.java b/austin-handler/src/main/java/com/java3y/austin/handler/script/WxMpTemplateScript.java index 56d4c63..2790bd1 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/script/WxMpTemplateScript.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/script/WxMpTemplateScript.java @@ -12,7 +12,7 @@ import java.util.ArrayList; import java.util.List; /** - * + * @author zyg */ @Service @Slf4j diff --git a/austin-support/src/main/java/com/java3y/austin/support/utils/ContentHolderUtil.java b/austin-support/src/main/java/com/java3y/austin/support/utils/ContentHolderUtil.java index c843f0f..ae3f868 100644 --- a/austin-support/src/main/java/com/java3y/austin/support/utils/ContentHolderUtil.java +++ b/austin-support/src/main/java/com/java3y/austin/support/utils/ContentHolderUtil.java @@ -5,7 +5,6 @@ import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.util.PropertyPlaceholderHelper; import java.text.MessageFormat; -import java.util.HashMap; import java.util.Map; /** @@ -64,12 +63,4 @@ public class ContentHolderUtil { } } - public static void main(String[] args) { - Map params = new HashMap<>(); - params.put("content", "test"); -// params.put("url", "123"); - String content = ContentHolderUtil.replacePlaceHolder("{\"content\":\"{$content}\",\"url\":\"{$url}\",\"title\":\"\"}", params); - System.out.println(content); - } - } diff --git a/austin-web/src/main/java/com/java3y/austin/web/service/impl/DataServiceImpl.java b/austin-web/src/main/java/com/java3y/austin/web/service/impl/DataServiceImpl.java index 688a650..cc3a1ac 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/service/impl/DataServiceImpl.java +++ b/austin-web/src/main/java/com/java3y/austin/web/service/impl/DataServiceImpl.java @@ -50,7 +50,7 @@ public class DataServiceImpl implements DataService { List sortAnchorList = userInfoList.stream().map(s -> JSON.parseObject(s, SimpleAnchorInfo.class)).sorted((o1, o2) -> Math.toIntExact(o1.getTimestamp() - o2.getTimestamp())).collect(Collectors.toList()); // 1. 对相同的businessId进行分类 {"businessId":[{businessId,state,timeStamp},{businessId,state,timeStamp}]} - Map> map = new HashMap<>(); + Map> map = MapUtil.newHashMap(); for (SimpleAnchorInfo simpleAnchorInfo : sortAnchorList) { List simpleAnchorInfos = map.get(String.valueOf(simpleAnchorInfo.getBusinessId())); if (CollUtil.isEmpty(simpleAnchorInfos)) {