37 lines
2.1 KiB
Go
37 lines
2.1 KiB
Go
package sms
|
||
|
||
import "git.hlsq.asia/alex/proto/topic"
|
||
|
||
type CountryCode string
|
||
|
||
const (
|
||
CountryCodeChina CountryCode = "+86" // 中国
|
||
CountryCodeHongKong CountryCode = "+852" // 中国香港
|
||
CountryCodeMacau CountryCode = "+853" // 中国澳门
|
||
CountryCodeTaiwan CountryCode = "+886" // 中国台湾
|
||
CountryCodeJapan CountryCode = "+81" // 日本
|
||
CountryCodeSouthKorea CountryCode = "+82" // 韩国
|
||
)
|
||
|
||
const (
|
||
TemplateCodeVerificationCodeChinese topic.SmsTemplateCode = "【巢云互动】您的验证码是:%v,该验证码5分钟内有效,请勿泄漏于他人!" // 验证码(中文)
|
||
TemplateCodeVerificationCodeEnglish topic.SmsTemplateCode = "[NEXQUB] Your verification code is %v. It is valid for 5 minutes. Please do not share it with anyone." // 验证码(英文)
|
||
TemplateCodeVerificationCodeJapanese topic.SmsTemplateCode = "[NEXQUB] 認証コード:%v 有効期限5分。このコードを他人に教えないでください。" // 验证码(日文)
|
||
TemplateCodeVerificationCodeKorean topic.SmsTemplateCode = "[NEXQUB] 인증번호 %v 유효시간 5분. 타인과 공유하지 마세요." // 验证码(韩文)
|
||
TemplateCodeVerificationCodeChineseTraditional topic.SmsTemplateCode = "[NEXQUB] 您的驗證碼是:%v,5分鐘內有效,請勿向他人提供。" // 验证码(繁体中文)
|
||
)
|
||
|
||
func GetTemplateCodeVerificationCodeByCountryCode(countryCode CountryCode) topic.SmsTemplateCode {
|
||
switch countryCode {
|
||
case CountryCodeChina:
|
||
return TemplateCodeVerificationCodeChinese
|
||
case CountryCodeHongKong, CountryCodeMacau, CountryCodeTaiwan:
|
||
return TemplateCodeVerificationCodeChineseTraditional
|
||
case CountryCodeJapan:
|
||
return TemplateCodeVerificationCodeJapanese
|
||
case CountryCodeSouthKorea:
|
||
return TemplateCodeVerificationCodeKorean
|
||
}
|
||
return TemplateCodeVerificationCodeEnglish
|
||
}
|