sms

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: GPL-2.0 Imports: 19 Imported by: 0

README

云海创想

perm.apiUrl = "https://api.zhuanxinyun.com/api/v2/sendSms.json"
perm.key = ""
perm.secret = ""
perm.params = "appKey={key}&appSecret={secret}&phones={phone}&content={content}" +
        "&batchNum={stamp}&templateId={templateId}"
perm.method = "POST"
perm.charset = "utf-8"
perm.signature = "【Go2o】"
perm.successChar = "errorCode\":\"000000\""

Documentation

Overview

*

  • Copyright 2015 @ 56x.net.
  • name : sms
  • author : jarryliu
  • date : 2016-06-14 09:52
  • description : 接口中的参数均以模板和数据形式出现
  • history :

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSmsApiPerm

func CheckSmsApiPerm(s *notify.SmsApiPerm) error

检查API接口数据是否正确

func EncodingTransform

func EncodingTransform(src []byte, enc string) ([]byte, error)

编码

func ResolveMessage added in v0.4.10

func ResolveMessage(tpl string, param []string) string

解析模板中的参数

func SendSms

func SendSms(setting *notify.SmsApiPerm, phoneNum string, content string,
	params []string) error

发送短信

Types

type SmsApi

type SmsApi struct {
	//接口地址
	ApiUrl string
	//接口编号
	Key string
	//接口密钥
	Secret string
	// 请求数据,如: phone={phone}&content={content}
	Params string
	// 请求方式, GET或POST
	Method string
	//发送内容的编码
	Charset string
	// 签名
	Signature string
	// 默认模板编号
	TemplateId string
	//发送成功,包含的字符,用于检测是否发送成功
	SuccessChar string
}

短信接口

Directories

Path Synopsis
*
*
*
*

Jump to

Keyboard shortcuts

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