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