sms

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTemplate

func AddTemplate(addTemplate *Template) error

func DeleteTemplate

func DeleteTemplate(templateCode string) error

func GetSendStatus

func GetSendStatus(phone string, sendResp *dysmsapi.SendSmsResponse) error

GetSendStatus 查询短信发送结果 @phone 手机号码 @sendResp 发送短信响应

func GetTemplateList

func GetTemplateList(list *[]Template) error

func InitSMSConfig

func InitSMSConfig(conf *SMSConfig) error

func SendSMS

func SendSMS(smsData SMSParam, msgCode string) (err error)

短信发送示例:

sms.SendSMS(sms.SMSParam{
			Phone: "15527557427",
			Code:  "8888",
		})

func SendSMSByData

func SendSMSByData(smsData SMSCustParam) (err error)

Types

type SMSConfig

type SMSConfig struct {
	AccessKeyId     string
	AccessKeySecret string
	SignName        string
}

阿里云短信服务参数

type SMSCustParam

type SMSCustParam struct {
	Phone []string          `common:"手机号"`
	Param map[string]string `common:"短信参数(占位符的key与value)"`
	Code  string            `common:"短信模板Code"`
}

SMSCustParam 自定义短信参数

type SMSParam

type SMSParam struct {
	Phone string `common:"手机号"`
	Data  string `common:"短信参数(占位符的内容)"`
}

SendSMS SMSParam 内置模板

type Template

type Template struct {
	AuditStatus     *string                                                         `json:"auditStatus,omitempty" xml:"AuditStatus,omitempty"`
	CreateDate      *string                                                         `json:"createDate,omitempty" xml:"CreateDate,omitempty"`
	OrderId         *string                                                         `json:"orderId,omitempty" xml:"OrderId,omitempty"`
	Reason          *dysmsapi.QuerySmsTemplateListResponseBodySmsTemplateListReason `json:"reason,omitempty" xml:"Reason,omitempty" type:"Struct"`
	TemplateCode    *string                                                         `json:"templateCode,omitempty" xml:"TemplateCode,omitempty"`
	TemplateContent *string                                                         `json:"templateContent,omitempty" xml:"TemplateContent,omitempty"`
	TemplateName    *string                                                         `json:"templateName,omitempty" xml:"TemplateName,omitempty"`
	TemplateType    *int32                                                          `json:"templateType"`
}

Jump to

Keyboard shortcuts

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