sms

package
v1.0.6-0...-cb436d8 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package sms @author <chengjiang@buffalo-robot.com> @date 2023/5/6 @note

Package sms @author <chengjiang@buffalo-robot.com> @date 2023/5/6 @note

Package sms @author <chengjiang@buffalo-robot.com> @date 2023/5/6 @note

Index

Constants

View Source
const (
	MessageContent        = "你好,世界!"
	VerifyCodeTemplate    = "" /* 149-byte string literal not displayed */
	ConsultApplyTemplate  = "${patient}发起了康复咨询申请,请${doctor}医生注意查看。"
	MeetingTemplate       = "${lower_org_name}机构 ${lower_doctor}医生已申请一个会诊申请,请${upper_doctor}医生及时安排会诊。"
	MeetingReviewTemplate = "八一医院${doctor_81}医生已对该会诊完成安排,请${lo_doctor}医生准时参与会诊。"
)

MessageContent 模板短信:

Variables

View Source
var SendTypeMap = map[SendType]MsgFactory{
	SMS81:  &Msg81Factory{CorpID: "XC012770", Pwd: "612770@"},
	SMSAli: &MsgAliFactory{},
}

SendTypeMap map

View Source
var Template2CodeMap = map[string]string{
	MessageContent:        "你好,世界!",
	VerifyCodeTemplate:    "SMS_194051654",
	ConsultApplyTemplate:  "SMS_276385980",
	MeetingTemplate:       "SMS_271025228",
	MeetingReviewTemplate: "SMS_271025230",
}

Template2CodeMap 模板对应的code,统一。

View Source
var Template2SignMap = map[string]string{
	VerifyCodeTemplate:    "布法罗云脑系统",
	ConsultApplyTemplate:  "布法罗机器人",
	MeetingTemplate:       "布法罗机器人",
	MeetingReviewTemplate: "布法罗机器人",
}

Template2SignMap 模板对应的阿里标签

Functions

This section is empty.

Types

type Msg81Factory

type Msg81Factory struct {
	CorpID string // 企业ID
	Pwd    string // 密码
}

func (*Msg81Factory) SendSms

func (f *Msg81Factory) SendSms(templateCode, phone string, params map[string]string) error

type MsgAliFactory

type MsgAliFactory struct {
	Client *dysmsapi.Client
	// contains filtered or unexported fields
}

func (*MsgAliFactory) SendSms

func (f *MsgAliFactory) SendSms(templateCode, phone string, params map[string]string) error

type MsgFactory

type MsgFactory interface {
	SendSms(templateCode, phone string, params map[string]string) error
}

func NewMsgServ

func NewMsgServ(sendType SendType) MsgFactory

type SendType

type SendType uint8
const (
	SMS81 SendType
	SMSAli
)

Jump to

Keyboard shortcuts

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