修正符合 阿里 插件规范

master
3y 3 years ago
parent 5d2b15fafa
commit 30457baa3d

@ -29,13 +29,13 @@ public class AsyncConfiguration implements AsyncConfigurer {
public ThreadPoolTaskExecutor executor(AsyncExecutionProperties properties) { public ThreadPoolTaskExecutor executor(AsyncExecutionProperties properties) {
log.info("funExecutor -- init "); log.info("funExecutor -- init ");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(properties.getCoreSize()); // 核心线程数 executor.setCorePoolSize(properties.getCoreSize());
executor.setMaxPoolSize(properties.getMaxSize()); // 最大线程数 executor.setMaxPoolSize(properties.getMaxSize());
executor.setKeepAliveSeconds(properties.getKeepAlive()); // 最大存活时间 executor.setKeepAliveSeconds(properties.getKeepAlive());
executor.setQueueCapacity(properties.getQueueCapacity()); // 阻塞队列容量 executor.setQueueCapacity(properties.getQueueCapacity());
executor.setThreadNamePrefix(properties.getThreadNamePrefix()); // 设置名称前缀 executor.setThreadNamePrefix(properties.getThreadNamePrefix());
executor.setRejectedExecutionHandler(properties.getRejectedHandler().getHandler());// 设置拒绝策略 executor.setRejectedExecutionHandler(properties.getRejectedHandler().getHandler());
executor.setAllowCoreThreadTimeOut(properties.isAllowCoreThreadTimeout());// 是否允许核心线程超时 executor.setAllowCoreThreadTimeOut(properties.isAllowCoreThreadTimeout());
executor.setWaitForTasksToCompleteOnShutdown(properties.isWaitForTasksToCompleteOnShutDown()); executor.setWaitForTasksToCompleteOnShutdown(properties.isWaitForTasksToCompleteOnShutDown());
executor.setAwaitTerminationSeconds(properties.getAwaitTerminationSeconds()); executor.setAwaitTerminationSeconds(properties.getAwaitTerminationSeconds());
log.info("austinExecutor: {} ", executor); log.info("austinExecutor: {} ", executor);

@ -8,10 +8,12 @@ import lombok.NoArgsConstructor;
import java.util.Map; import java.util.Map;
/** /**
*
* *
* <p> * <p>
* *
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html * https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html
* * @author zyg
*/ */
@Data @Data
@Builder @Builder

@ -17,6 +17,10 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
/**
* @author zyg
*
*/
@Component @Component
@Slf4j @Slf4j
public class OfficialAccountHandler extends BaseHandler implements Handler { public class OfficialAccountHandler extends BaseHandler implements Handler {

@ -4,6 +4,9 @@ import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
import java.util.List; import java.util.List;
/**
* @author zyg
*/
public interface OfficialAccountScript { public interface OfficialAccountScript {
/** /**

@ -12,7 +12,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* * @author zyg
*/ */
@Service @Service
@Slf4j @Slf4j

@ -5,7 +5,6 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.util.PropertyPlaceholderHelper; import org.springframework.util.PropertyPlaceholderHelper;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@ -64,12 +63,4 @@ public class ContentHolderUtil {
} }
} }
public static void main(String[] args) {
Map<String, String> 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);
}
} }

@ -50,7 +50,7 @@ public class DataServiceImpl implements DataService {
List<SimpleAnchorInfo> sortAnchorList = userInfoList.stream().map(s -> JSON.parseObject(s, SimpleAnchorInfo.class)).sorted((o1, o2) -> Math.toIntExact(o1.getTimestamp() - o2.getTimestamp())).collect(Collectors.toList()); List<SimpleAnchorInfo> 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}]} // 1. 对相同的businessId进行分类 {"businessId":[{businessId,state,timeStamp},{businessId,state,timeStamp}]}
Map<String, List<SimpleAnchorInfo>> map = new HashMap<>(); Map<String, List<SimpleAnchorInfo>> map = MapUtil.newHashMap();
for (SimpleAnchorInfo simpleAnchorInfo : sortAnchorList) { for (SimpleAnchorInfo simpleAnchorInfo : sortAnchorList) {
List<SimpleAnchorInfo> simpleAnchorInfos = map.get(String.valueOf(simpleAnchorInfo.getBusinessId())); List<SimpleAnchorInfo> simpleAnchorInfos = map.get(String.valueOf(simpleAnchorInfo.getBusinessId()));
if (CollUtil.isEmpty(simpleAnchorInfos)) { if (CollUtil.isEmpty(simpleAnchorInfos)) {

Loading…
Cancel
Save