From 709c73064aad8a639c15238f0cd30561497a8279 Mon Sep 17 00:00:00 2001 From: 3y Date: Wed, 29 Mar 2023 21:16:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81smsHandler=E5=85=BC=E5=AE=B9hades?= =?UTF-8?q?=E8=A7=84=E5=88=99=E5=BC=95=E6=93=8E=202=E3=80=81graylog=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/java3y/austin/handler/handler/impl/SmsHandler.java | 5 +++-- austin-web/src/main/resources/application.properties | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/handler/impl/SmsHandler.java b/austin-handler/src/main/java/com/java3y/austin/handler/handler/impl/SmsHandler.java index 9423304..5197db8 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/handler/impl/SmsHandler.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/handler/impl/SmsHandler.java @@ -22,6 +22,7 @@ import com.java3y.austin.support.service.ConfigService; import com.java3y.austin.support.utils.AccountUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; import java.util.*; @@ -46,7 +47,7 @@ public class SmsHandler extends BaseHandler implements Handler { private ConfigService config; @Autowired - private Map smsScripts; + private ApplicationContext applicationContext; @Autowired private AccountUtils accountUtils; @@ -75,7 +76,7 @@ public class SmsHandler extends BaseHandler implements Handler { for (MessageTypeSmsConfig messageTypeSmsConfig : messageTypeSmsConfigs) { smsParam.setScriptName(messageTypeSmsConfig.getScriptName()); smsParam.setSendAccountId(messageTypeSmsConfig.getSendAccount()); - List recordList = smsScripts.get(messageTypeSmsConfig.getScriptName()).send(smsParam); + List recordList = applicationContext.getBean(messageTypeSmsConfig.getScriptName(), SmsScript.class).send(smsParam); if (CollUtil.isNotEmpty(recordList)) { smsRecordDao.saveAll(recordList); return true; diff --git a/austin-web/src/main/resources/application.properties b/austin-web/src/main/resources/application.properties index d1beb7c..b368209 100644 --- a/austin-web/src/main/resources/application.properties +++ b/austin-web/src/main/resources/application.properties @@ -118,5 +118,5 @@ server.shutdown=graceful ########################################## system end ########################################## ########################################## log start ########################################## -austin.grayLog.ip=${austin.graylog:austin-graylog} +austin.graylog.ip=${austin.graylog:austin-graylog} ########################################## log end ########################################## \ No newline at end of file