Documentation ¶
Index ¶
- Variables
- type AuditStatus
- type Manager
- func (m *Manager) CreateTemplate(args TemplateRequest) (ret sms.TemplateResponse, err error)
- func (m *Manager) QueryMessage(args QueryMessageRequest) (pagination MessagePagination, err error)
- func (m *Manager) QuerySignature(args QuerySignatureRequest) (pagination sms.SignaturePagination, err error)
- func (m *Manager) QueryTemplate(args sms.QueryTemplateRequest) (pagination TemplatePagination, err error)
- func (m *Manager) QueryTemplateByID(id string) (smsTemplate Template, err error)
- func (m *Manager) SendMessage(args MessagesRequest) (ret MessagesResponse, err error)
- type Message
- type MessagePagination
- type MessagesRequest
- type MessagesResponse
- type QueryMessageRequest
- type QuerySignatureRequest
- type QueryTemplateRequest
- type SignatureSrcType
- type Template
- type TemplatePagination
- type TemplateRequest
- type TemplateType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// Host 为 QiNiu SMS Server API 服务域名
Host = "https://sms.qiniuapi.com"
)
Functions ¶
This section is empty.
Types ¶
type AuditStatus ¶
type AuditStatus string
AuditStatus 审核状态
const ( // AuditStatusPassed 通过 AuditStatusPassed AuditStatus = "passed" // AuditStatusReject 未通过 AuditStatusReject AuditStatus = "rejected" // AuditStatusReviewing 审核中 AuditStatusReviewing AuditStatus = "reviewing" )
func (AuditStatus) String ¶
func (a AuditStatus) String() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 提供了 Qiniu SMS Server API 相关功能
func NewManager ¶
func NewManager(mac *auth.Credentials) (manager *Manager)
NewManager 用来构建一个新的 Manager
func (*Manager) CreateTemplate ¶
func (m *Manager) CreateTemplate(args TemplateRequest) (ret sms.TemplateResponse, err error)
CreateTemplate 创建模板
func (*Manager) QueryMessage ¶
func (m *Manager) QueryMessage(args QueryMessageRequest) (pagination MessagePagination, err error)
QueryMessage 查询短信发送状态
func (*Manager) QuerySignature ¶
func (m *Manager) QuerySignature(args QuerySignatureRequest) (pagination sms.SignaturePagination, err error)
QuerySignature 查询签名
func (*Manager) QueryTemplate ¶
func (m *Manager) QueryTemplate(args sms.QueryTemplateRequest) (pagination TemplatePagination, err error)
QueryTemplate 查询模板
func (*Manager) QueryTemplateByID ¶
QueryTemplate 查询模板
func (*Manager) SendMessage ¶
func (m *Manager) SendMessage(args MessagesRequest) (ret MessagesResponse, err error)
SendMessage 发送短信
type Message ¶
type Message struct { Content string `json:"content" xml:"content"` Type string `json:"type" xml:"type"` Error string `json:"error" xml:"error"` Count int `json:"count" xml:"count"` JobID string `json:"job_id" xml:"job_id"` Mobile string `json:"mobile" xml:"mobile"` CreatedAt uint64 `json:"created_at" xml:"created_at"` DelivrdAt uint64 `json:"delivrd_at" xml:"delivrd_at"` MessageID string `json:"message_id" xml:"message_id"` Status string `json:"status" xml:"status"` }
Message 模板
type MessagePagination ¶
type MessagePagination struct { Page int `json:"page"` // 页码,默认为 1 PageSize int `json:"page_size"` // 分页大小,默认为 20 Total int `json:"total"` // 总记录条数 Items []Message `json:"items"` // 模板 }
MessagePagination 短信分页
type MessagesRequest ¶
type MessagesRequest struct { TemplateID string `json:"template_id"` Mobiles []string `json:"mobiles"` Parameters map[string]interface{} `json:"parameters"` }
MessagesRequest 短信消息
type MessagesResponse ¶
type MessagesResponse struct {
JobID string `json:"job_id"`
}
MessagesResponse 发送短信响应
type QueryMessageRequest ¶
type QuerySignatureRequest ¶
type QuerySignatureRequest struct { AuditStatus sms.AuditStatus `json:"audit_status"` // 审核状态 Page int `json:"page"` // 页码,默认为 1 PageSize int `json:"page_size"` // 分页大小,默认为 20 }
QuerySignatureRequest 查询签名参数
type QueryTemplateRequest ¶
type QueryTemplateRequest struct { JobID string `json:"job_id"` MessageID string `json:"message_id"` Mobile string `json:"mobile"` }
QueryTemplateRequest 查询短信参数
type SignatureSrcType ¶
type SignatureSrcType string
SignatureSrcType 签名类型
const ( // EnterprisesAndInstitutions 企事业单位的全称或简称 EnterprisesAndInstitutions SignatureSrcType = "enterprises_and_institutions" // Website 工信部备案网站的全称或简称 Website SignatureSrcType = "website" // APP APP应用的全称或简称 APP SignatureSrcType = "app" // PublicNumberOrSmallProgram 公众号或小程序的全称或简称 PublicNumberOrSmallProgram SignatureSrcType = "public_number_or_small_program" // StoreName 电商平台店铺名的全称或简称 StoreName SignatureSrcType = "store_name" // TradeName 商标名的全称或简称 TradeName SignatureSrcType = "trade_name" )
func (SignatureSrcType) String ¶
func (s SignatureSrcType) String() string
type Template ¶
type Template struct { ID string `json:"id"` Name string `json:"name"` Type sms.TemplateType `json:"type"` Template string `json:"template"` Description string `json:"description"` AuditStatus sms.AuditStatus `json:"audit_status"` RejectReason string `json:"reject_reason"` SignatureID string `json:"signature_id"` // 模版绑定的签名ID SignatureText string `json:"signature_text"` // 模版绑定的签名内容 UpdatedAt uint64 `json:"updated_at"` CreatedAt uint64 `json:"created_at"` }
Template 模板
type TemplatePagination ¶
type TemplatePagination struct { Page int `json:"page"` // 页码,默认为 1 PageSize int `json:"page_size"` // 分页大小,默认为 20 Total int `json:"total"` // 总记录条数 Items []Template `json:"items"` // 模板 }
TemplatePagination 模板分页
type TemplateRequest ¶
type TemplateType ¶
type TemplateType string
TemplateType 模版类型
const ( // NotificationType 通知类短信 NotificationType TemplateType = "notification" // VerificationType 验证码短信 VerificationType TemplateType = "verification" // MarketingType 营销类短信 MarketingType TemplateType = "marketing" // VoiceType 语音短信 VoiceType TemplateType = "voice" )
Click to show internal directories.
Click to hide internal directories.