sms

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliSmsClient

type AliSmsClient struct {
	AccessKeyID     string
	AccessKeySecret string
	HTTPDebugEnable bool
}

AliSmsClient

func NewAliSmsClient

func NewAliSmsClient(accessKeyID, accessKeySecret string) *AliSmsClient

NewAliSmsClient get aliyun sms client

func (*AliSmsClient) SendMarket

func (m *AliSmsClient) SendMarket(sign, templateId, phone string) (err error)

SendMarket 营销短信

func (*AliSmsClient) SendVerifyCode

func (m *AliSmsClient) SendVerifyCode(sign, templateID, phone, code string) (err error)

SendVerifyCode 验证码短信

func (*AliSmsClient) SetDebug

func (m *AliSmsClient) SetDebug(enabled bool)

SetDebug SetDebug

type ISMS

type ISMS interface {
	// SendVerifyCode 发送验证码短信
	//	phones为多个时,用,分割
	SendVerifyCode(phones, code string, templateId int) (bool, error)

	// SendNotice 发送通知短信
	SendNotice(phones, code string, templateId int) (bool, error)

	// SendSell 发送营销短信
	SendSell(phones, code string, templateId int) (bool, error)

	//StatusCallBack 状态回调
	StatusCallBack()
}

ISMS 接口

type UpYunMessage

type UpYunMessage struct {
	MessageID int64  `json:"message_id"`
	Mobile    string `json:"mobile"`
}

UpYunMessage UpYunMessage

type UpYunResult

type UpYunResult struct {
	MessageIDS []*UpYunMessage `json:"message_ids"`
}

UpYunResult 返回信息

type UpYunSmsBody

type UpYunSmsBody struct {
	Mobile     string `json:"mobile"`
	TemplateID int64  `json:"template_id"`
	Vars       string `json:"vars"`
}

UpYunSmsBody 发送模型

type UpYunSmsClient

type UpYunSmsClient struct {
	Token string
}

UpYunSmsClient UpYunSmsClient

func NewUpYunSmsClient

func NewUpYunSmsClient(token string) *UpYunSmsClient

func (*UpYunSmsClient) SendSms

func (m *UpYunSmsClient) SendSms(mobile string, templateId int64, vars string) (err error)

SendSms 发送短信 templateId = 模板ID vars = 模板变量 body.Vars = fmt.Sprintf("%v|%v|%v|%v", Datetime,"abc", "123, "456")

Jump to

Keyboard shortcuts

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