This is an automated email from the ASF dual-hosted git repository.
gongchao pushed a commit to branch clean-home
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/clean-home by this push:
new 103abcd93 update refer from
103abcd93 is described below
commit 103abcd933be8dccc8adb7ddfaccea009683f25c
Author: tomsun28 <[email protected]>
AuthorDate: Sat May 4 21:55:15 2024 +0800
update refer from
Signed-off-by: tomsun28 <[email protected]>
---
.../hertzbeat/common/util/AliYunSendSmsUtil.java | 24 +++++++++++-----------
e2e/start.sh | 1 +
.../nativex/HertzbeatRuntimeHintsRegistrar.java | 2 ++
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git
a/common/src/main/java/org/apache/hertzbeat/common/util/AliYunSendSmsUtil.java
b/common/src/main/java/org/apache/hertzbeat/common/util/AliYunSendSmsUtil.java
index fe718cb00..e22351a67 100644
---
a/common/src/main/java/org/apache/hertzbeat/common/util/AliYunSendSmsUtil.java
+++
b/common/src/main/java/org/apache/hertzbeat/common/util/AliYunSendSmsUtil.java
@@ -17,6 +17,7 @@
package org.apache.hertzbeat.common.util;
+import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
import com.aliyun.teaopenapi.models.Config;
@@ -28,25 +29,24 @@ import java.util.Map;
*/
public class AliYunSendSmsUtil {
- public static com.aliyun.dysmsapi20170525.Client createClient(String
accessKeyId, String accessKeySecret) throws Exception {
+ public static Client createClient(String accessKeyId, String
accessKeySecret) throws Exception {
Config config = new Config();
config.accessKeyId = accessKeyId;
config.accessKeySecret = accessKeySecret;
- return new com.aliyun.dysmsapi20170525.Client(config);
+ return new Client(config);
}
/**
* Method for sending SMS messages: Enter the map format
*/
- public static SendSmsResponse send(Map<String, Object> map, String
singName, String templateCode, String phone, String accessKeyId, String
accessKeySecret) throws Exception {
- com.aliyun.dysmsapi20170525.Client client =
AliYunSendSmsUtil.createClient(accessKeyId, accessKeySecret);
+ public static SendSmsResponse send(Map<String, Object> map, String
singName, String templateCode, String phone,
+ String accessKeyId, String
accessKeySecret) throws Exception {
+ Client client = AliYunSendSmsUtil.createClient(accessKeyId,
accessKeySecret);
SendSmsRequest sendReq = new SendSmsRequest()
- .setPhoneNumbers(phone)//The phone number that received the
text message
- .setSignName(singName)//SMS signature
- .setTemplateCode(templateCode)//SMS Template Code
- .setTemplateParam(new ObjectMapper().writeValueAsString(map));
//The actual value of the SMS template variable
- SendSmsResponse sendResp = client.sendSms(sendReq);
- return sendResp;
-
+ .setPhoneNumbers(phone)
+ .setSignName(singName)
+ .setTemplateCode(templateCode)
+ .setTemplateParam(new ObjectMapper().writeValueAsString(map));
+ return client.sendSms(sendReq);
}
-}
\ No newline at end of file
+}
diff --git a/e2e/start.sh b/e2e/start.sh
index 2e157910a..52a23b982 100755
--- a/e2e/start.sh
+++ b/e2e/start.sh
@@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
+# Derived from Api Testing
https://github.com/LinuxSuRen/api-testing/blob/master/e2e/start.sh
file=$1
if [ "$file" == "" ]
diff --git
a/manager/src/main/java/org/apache/hertzbeat/manager/nativex/HertzbeatRuntimeHintsRegistrar.java
b/manager/src/main/java/org/apache/hertzbeat/manager/nativex/HertzbeatRuntimeHintsRegistrar.java
index 8217fe7d7..d1d58f01a 100644
---
a/manager/src/main/java/org/apache/hertzbeat/manager/nativex/HertzbeatRuntimeHintsRegistrar.java
+++
b/manager/src/main/java/org/apache/hertzbeat/manager/nativex/HertzbeatRuntimeHintsRegistrar.java
@@ -36,6 +36,8 @@ import org.springframework.aot.hint.TypeReference;
import org.springframework.util.ClassUtils;
/**
+ * Derived from SpringCloud
org.springframework.cloud.config.server.config.ConfigServerRuntimeHints
+ * @see <a
href="https://github.com/spring-cloud/spring-cloud-config/blob/main/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerRuntimeHints.java">ConfigServerRuntimeHints</a>
*/
public class HertzbeatRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]