sms

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: GPL-2.0 Imports: 17 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

View Source
const (
	SmsHttp  = 1 // HTTP
	SmsAli   = 2 //阿里大鱼
	SmsCl253 = 3 //创蓝253
)

Variables

This section is empty.

Functions

func AppendCheckPhoneParams

func AppendCheckPhoneParams(provider string, param map[string]interface{}) map[string]interface{}

附加检查手机短信的参数

func CheckSmsApiPerm

func CheckSmsApiPerm(provider string, s *notify.SmsApiPerm) error

检查API接口数据是否正确

func EncodingTransform

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

编码

func SendSms

func SendSms(provider string, api *SmsApi, phoneNum string, content string,
	params map[string]interface{}) error

发送短信,tpl:短信内容模板

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
	//发送成功,包含的字符,用于检测是否发送成功
	SuccessChar string
}

短信接口

Directories

Path Synopsis
* * Copyright 2015 @ 56x.net.
* * Copyright 2015 @ 56x.net.
* * Copyright 2015 @ 56x.net.
* * Copyright 2015 @ 56x.net.

Jump to

Keyboard shortcuts

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