接入 hades 升级v1.0.4版本

pull/40/head
3y 2 years ago
parent e30afb0c35
commit 72efb13d0d

@ -39,7 +39,7 @@ public class OfficialAccountParamConstant {
/** /**
* // * //
*/ */
public static final String SUBSCRIBE_TIPS = "项目群还有少量名额,添加我的微信 sanwai3y 备注【项目】,我会拉入项目群"; public static final String SUBSCRIBE_TIPS = "项目群还有少量名额,添加我的微信 java3yyy 备注【项目】,我会拉入官方项目交流群";
public static final String SCAN_TIPS = "咋又扫码啦?重新关注一波吧!"; public static final String SCAN_TIPS = "咋又扫码啦?重新关注一波吧!";
public static final String UNSUBSCRIBE_TIPS = "老乡别走!"; public static final String UNSUBSCRIBE_TIPS = "老乡别走!";

@ -16,8 +16,9 @@ import com.java3y.austin.handler.domain.sms.YunPianSendResult;
import com.java3y.austin.handler.script.SmsScript; import com.java3y.austin.handler.script.SmsScript;
import com.java3y.austin.support.domain.SmsRecord; import com.java3y.austin.support.domain.SmsRecord;
import com.java3y.austin.support.utils.AccountUtils; import com.java3y.austin.support.utils.AccountUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -28,9 +29,11 @@ import java.util.*;
* @date 2022523 * @date 2022523
* https://www.yunpian.com/official/document/sms/zh_CN/domestic_list * https://www.yunpian.com/official/document/sms/zh_CN/domestic_list
*/ */
@Slf4j
@Component("YunPianSmsScript") @Component("YunPianSmsScript")
public class YunPianSmsScript implements SmsScript { public class YunPianSmsScript implements SmsScript {
private static Logger log = LoggerFactory.getLogger(YunPianSmsScript.class);
@Autowired @Autowired
private AccountUtils accountUtils; private AccountUtils accountUtils;

@ -56,6 +56,12 @@ public abstract class AbstractLazyPending<T> {
tasks.add(obj); tasks.add(obj);
} }
// 判断是否停止当前线程
if (stop && CollUtil.isEmpty(tasks)) {
executorService.shutdown();
break;
}
// 处理条件1. 数量超限 2. 时间超限 // 处理条件1. 数量超限 2. 时间超限
if (CollUtil.isNotEmpty(tasks) && dataReady()) { if (CollUtil.isNotEmpty(tasks) && dataReady()) {
List<T> taskRef = tasks; List<T> taskRef = tasks;
@ -66,11 +72,7 @@ public abstract class AbstractLazyPending<T> {
pendingParam.getExecutorService().execute(() -> this.handle(taskRef)); pendingParam.getExecutorService().execute(() -> this.handle(taskRef));
} }
// 判断是否停止当前线程
if (stop && CollUtil.isEmpty(tasks)) {
executorService.shutdown();
break;
}
} catch (Exception e) { } catch (Exception e) {
log.error("Pending#initConsumePending failed:{}", Throwables.getStackTraceAsString(e)); log.error("Pending#initConsumePending failed:{}", Throwables.getStackTraceAsString(e));
} }

@ -85,7 +85,7 @@ apollo.bootstrap.namespaces=${austin.default.apollo.namespace:boss.austin},dynam
nacos.config.server-addr=${austin.nacos.addr.ip:austin-nacos}:${austin.nacos.addr.port:8848} nacos.config.server-addr=${austin.nacos.addr.ip:austin-nacos}:${austin.nacos.addr.port:8848}
nacos.config.username=${austin.nacos.username:nacos} nacos.config.username=${austin.nacos.username:nacos}
nacos.config.password=${austin.nacos.password:nacos} nacos.config.password=${austin.nacos.password:nacos}
nacos.config.namespace=${austin.nacos.namespace:60e2b165-d830-4163-a0e9-b97ec2f7164c} nacos.config.namespace=${austin.nacos.namespace:hades}
nacos.config.enabled=${austin.nacos.enabled} nacos.config.enabled=${austin.nacos.enabled}
nacos.data-id=${austin.nacos.dataId:austin} nacos.data-id=${austin.nacos.dataId:austin}
@ -93,9 +93,8 @@ nacos.group=${austin.nacos.group:DEFAULT_GROUP}
########################################## nacos end ########################################## ########################################## nacos end ##########################################
########################################## rule Engine start ########################################## ########################################## rule Engine start ##########################################
hades.main.config.enabled=${austin.rule.engine.enabled:false} hades.enabled=${austin.rule.engine.enabled:false}
hades.main.config.file-name=${austin.rule.engine.file-name:hades} hades.config-name=${austin.rule.engine.file-name:hades}
hades.main.config.group-name=${austin.rule.engine.group-name:hades}
########################################## rule Engine end ########################################## ########################################## rule Engine end ##########################################
########################################## log start ########################################## ########################################## log start ##########################################

@ -218,17 +218,17 @@
<version>2.2.2</version> <version>2.2.2</version>
</dependency> </dependency>
<!--hades规则引擎https://github.com/ZhongFuCheng3y/hades--> <!-- hades规则引擎https://github.com/ZhongFuCheng3y/hades -->
<dependency> <dependency>
<groupId>io.github.ZhongFuCheng3y</groupId> <groupId>io.github.ZhongFuCheng3y</groupId>
<artifactId>hades-nacos-starter</artifactId> <artifactId>hades-nacos-starter</artifactId>
<version>1.0.3</version> <version>1.0.4</version>
</dependency> </dependency>
<!--用hades规则引擎用nacos做演示apollo注释掉--> <!--用hades规则引擎用nacos做演示apollo注释掉-->
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>io.github.ZhongFuCheng3y</groupId>--> <!-- <groupId>io.github.ZhongFuCheng3y</groupId>-->
<!-- <artifactId>hades-apollo-starter</artifactId>--> <!-- <artifactId>hades-apollo-starter</artifactId>-->
<!-- <version>1.0.3</version>--> <!-- <version>1.0.4</version>-->
<!-- </dependency>--> <!-- </dependency>-->
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>

Loading…
Cancel
Save