hwcloud

package
v0.0.0-...-c9b56a8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2021 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

和华为云相关的

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SMSId

type SMSId struct {
	SMSMsgId   string // 短信的唯一标识。
	From       string // 短信发送方的号码。
	OriginTo   string // 短信接收方的号码。
	Status     string // 短信状态码, API错误码:https://support.huaweicloud.com/devg-msgsms/sms_04_0009.html
	CreateTime string // 短信资源的创建时间,即短信平台接收到客户发送短信请求的时间,为UTC时间。格式为:yyyy-MM-dd'T'HH:mm:ss'Z'。
}

短信ID列表,当目的号码存在多个时,每个号码都会返回一个SmsID。

type SMSSender

type SMSSender struct {
	URL       string // APP接入地址+接口访问URI
	AppKey    string
	AppSecret string
	Channel   string // 参数Channel为通道号,短信平台为短信签名分配的通道号码。
	Signature string // 参数signature为签名名称,必须是已审核通过的,与模板类型一致的签名名称。
}

func (*SMSSender) SendMessage

func (h *SMSSender) SendMessage(templateID, to string, params ...string) (smsID *SMSId, err error)

参数templateID为短信模板ID,用于唯一标识短信模板,在申请短信模板时获取模板ID。位置:签名管理 - 通道号 参数to, 字符串类型,表示接收者电话号码,多个号码之间用英文逗号隔开; 示例:"+8615123456789,+8615234567890" 参数params为短信模板变量数组,用于依次填充“templateID”参数指定的模板内容中的变量,该参数需填写为JSONArray格式。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL