From 7a48a45cf427b7ed8fa19cc6061d2f8a0acd1de8 Mon Sep 17 00:00:00 2001 From: Kininaru Date: Fri, 13 Aug 2021 13:10:41 +0800 Subject: [PATCH] feat: change provider name Signed-off-by: Kininaru --- basic.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/basic.go b/basic.go index c3c4670..63e38d0 100644 --- a/basic.go +++ b/basic.go @@ -14,17 +14,23 @@ package go_sms_sender +const ( + Aliyun = "Aliyun SMS" + TencentCloud = "Tencent Cloud SMS" + VolcEngine = "Volc Engine SMS" +) + type SmsClient interface { SendMessage(param map[string]string, targetPhoneNumber ...string) } func NewSmsClient(provider, accessId, accessKey, sign, region, template string, other ...string) SmsClient { switch provider { - case "aliyun": + case Aliyun: return GetAliyunClient(accessId, accessKey, sign, region, template) - case "tencent": + case TencentCloud: return GetTencentClient(accessId, accessKey, sign, region, template, other) - case "volcengine": + case VolcEngine: return GetVolcClient(accessId, accessKey, sign, region, template, other) default: return nil