Documentation ¶
Overview ¶
Package dysms Copyright 2016 The GiterLab Authors. All rights reserved.
Package dysms Copyright 2016 The GiterLab Authors. All rights reserved.
Package dysms Copyright 2016 The GiterLab Authors. All rights reserved.
Package dysms Copyright 2016 The GiterLab Authors. All rights reserved.
Package dysms Copyright 2016 The GiterLab Authors. All rights reserved.
Index ¶
- Variables
- type Client
- type ErrorMessage
- type QuerySendDetailsRequest
- func (q *QuerySendDetailsRequest) DoActionWithException() (resp *QuerySendDetailsResponse, err error)
- func (q *QuerySendDetailsRequest) GetBizID() string
- func (q *QuerySendDetailsRequest) GetCurrentPage() string
- func (q *QuerySendDetailsRequest) GetOwnerID() string
- func (q *QuerySendDetailsRequest) GetPageSize() string
- func (q *QuerySendDetailsRequest) GetPhoneNumber() string
- func (q *QuerySendDetailsRequest) GetResourceOwnerAccount() string
- func (q *QuerySendDetailsRequest) GetResourceOwnerID() string
- func (q *QuerySendDetailsRequest) GetSendDate() string
- func (q *QuerySendDetailsRequest) SetBizID(bizID string)
- func (q *QuerySendDetailsRequest) SetCurrentPage(currentPage string)
- func (q *QuerySendDetailsRequest) SetOwnerID(ownerID string)
- func (q *QuerySendDetailsRequest) SetPageSize(pageSize string)
- func (q *QuerySendDetailsRequest) SetPhoneNumber(phoneNumber string)
- func (q *QuerySendDetailsRequest) SetResourceOwnerAccount(resourceOwnerAccount string)
- func (q *QuerySendDetailsRequest) SetResourceOwnerID(resourceOwnerID string)
- func (q *QuerySendDetailsRequest) SetSendDate(sendDate string)
- type QuerySendDetailsResponse
- type Request
- type SendSmsRequest
- func (s *SendSmsRequest) DoActionWithException() (resp *SendSmsResponse, err error)
- func (s *SendSmsRequest) GetOutID(outID string) string
- func (s *SendSmsRequest) GetOwnerID() string
- func (s *SendSmsRequest) GetPhoneNumbers() string
- func (s *SendSmsRequest) GetResourceOwnerAccount() string
- func (s *SendSmsRequest) GetResourceOwnerID() string
- func (s *SendSmsRequest) GetSignName() string
- func (s *SendSmsRequest) GetTemplateCode() string
- func (s *SendSmsRequest) GetTemplateParam() string
- func (s *SendSmsRequest) SetOutID(outID string)
- func (s *SendSmsRequest) SetOwnerID(ownerID string)
- func (s *SendSmsRequest) SetPhoneNumbers(phoneNumbers string)
- func (s *SendSmsRequest) SetResourceOwnerAccount(resourceOwnerAccount string)
- func (s *SendSmsRequest) SetResourceOwnerID(resourceOwnerID string)
- func (s *SendSmsRequest) SetSignName(signName string)
- func (s *SendSmsRequest) SetTemplateCode(templateCode string)
- func (s *SendSmsRequest) SetTemplateParam(templateParam string)
- type SendSmsResponse
- type SmsSendDetailDTO
- type SmsSendDetailDTOs
Constants ¶
This section is empty.
Variables ¶
var HTTPDebugEnable = false
HTTPDebugEnable http调试开关
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // API版本 Version string // SMS服务地域, 默认为cn-hangzhou Region string // SMS服务的地址,默认为(http://dysmsapi.aliyuncs.com/) EndPoint string // 访问SMS服务的accessid,通过官方网站申请或通过管理员获取 AccessID string // 访问SMS服务的accesskey,通过官方网站申请或通过管理员获取 AccessKey string // 连接池中每个连接的Socket超时,单位为秒,可以为int或float。默认值为30 SocketTimeout int }
Client HTTP请求配置信息
func (*Client) SetAccessID ¶
SetAccessID 设置短信服务的accessid,通过官方网站申请或通过管理员获取
func (*Client) SetAccessKey ¶
SetAccessKey 设置短信服务的accesskey,通过官方网站申请或通过管理员获取
func (*Client) SetSocketTimeout ¶
SetSocketTimeout 设置短信服务的Socket超时,单位为秒,可以为int或float。默认值为30
type ErrorMessage ¶
type ErrorMessage struct { HTTPCode int `json:"-"` RequestID *string `json:"RequestId,omitempty"` Code *string `json:"Code,omitempty"` Message *string `json:"Message,omitempty"` }
ErrorMessage 短信服务器返回的错误信息
func (*ErrorMessage) GetHTTPCode ¶
func (e *ErrorMessage) GetHTTPCode() int
GetHTTPCode 获取HTTP请求的错误码
func (*ErrorMessage) GetRequestID ¶
func (e *ErrorMessage) GetRequestID() string
GetRequestID 获取请求的ID序列
func (*ErrorMessage) SetHTTPCode ¶
func (e *ErrorMessage) SetHTTPCode(code int)
SetHTTPCode 设置HTTP错误码
type QuerySendDetailsRequest ¶
type QuerySendDetailsRequest struct {
Request *Request
}
QuerySendDetailsRequest 短信发送记录查询接口请求
func QuerySendDetails ¶
func QuerySendDetails(bizID, phoneNumber, pageSize, currentPage, sendDate string) *QuerySendDetailsRequest
QuerySendDetails 短信发送记录查询接口 bizID 可选 - 流水号 phoneNumber 查询的手机号码 pageSize 必填 - 页大小 currentPage 必填 - 当前页码从1开始计数 sendDate 必填 - 发送日期 支持30天内记录查询,格式yyyyMMdd
func (*QuerySendDetailsRequest) DoActionWithException ¶
func (q *QuerySendDetailsRequest) DoActionWithException() (resp *QuerySendDetailsResponse, err error)
DoActionWithException 发起HTTP请求
func (*QuerySendDetailsRequest) GetBizID ¶
func (q *QuerySendDetailsRequest) GetBizID() string
GetBizID 获取发送流水号
func (*QuerySendDetailsRequest) GetCurrentPage ¶
func (q *QuerySendDetailsRequest) GetCurrentPage() string
GetCurrentPage 获取当前页码
func (*QuerySendDetailsRequest) GetOwnerID ¶
func (q *QuerySendDetailsRequest) GetOwnerID() string
GetOwnerID 来源于python,未知参数
func (*QuerySendDetailsRequest) GetPageSize ¶
func (q *QuerySendDetailsRequest) GetPageSize() string
GetPageSize 获取设置页大小
func (*QuerySendDetailsRequest) GetPhoneNumber ¶
func (q *QuerySendDetailsRequest) GetPhoneNumber() string
GetPhoneNumber 获取短信接收号码
func (*QuerySendDetailsRequest) GetResourceOwnerAccount ¶
func (q *QuerySendDetailsRequest) GetResourceOwnerAccount() string
GetResourceOwnerAccount 来源于python,未知参数
func (*QuerySendDetailsRequest) GetResourceOwnerID ¶
func (q *QuerySendDetailsRequest) GetResourceOwnerID() string
GetResourceOwnerID 来源于python,未知参数
func (*QuerySendDetailsRequest) GetSendDate ¶
func (q *QuerySendDetailsRequest) GetSendDate() string
GetSendDate 获取短信发送日期
func (*QuerySendDetailsRequest) SetBizID ¶
func (q *QuerySendDetailsRequest) SetBizID(bizID string)
SetBizID 设置发送流水号 可选 从调用发送接口返回值中获取
func (*QuerySendDetailsRequest) SetCurrentPage ¶
func (q *QuerySendDetailsRequest) SetCurrentPage(currentPage string)
SetCurrentPage 设置当前页码 必须
func (*QuerySendDetailsRequest) SetOwnerID ¶
func (q *QuerySendDetailsRequest) SetOwnerID(ownerID string)
SetOwnerID 来源于python,未知参数
func (*QuerySendDetailsRequest) SetPageSize ¶
func (q *QuerySendDetailsRequest) SetPageSize(pageSize string)
SetPageSize 设置页大小 必须 页大小Max=50
func (*QuerySendDetailsRequest) SetPhoneNumber ¶
func (q *QuerySendDetailsRequest) SetPhoneNumber(phoneNumber string)
SetPhoneNumber 设置短信接收号码 必须
func (*QuerySendDetailsRequest) SetResourceOwnerAccount ¶
func (q *QuerySendDetailsRequest) SetResourceOwnerAccount(resourceOwnerAccount string)
SetResourceOwnerAccount 来源于python,未知参数
func (*QuerySendDetailsRequest) SetResourceOwnerID ¶
func (q *QuerySendDetailsRequest) SetResourceOwnerID(resourceOwnerID string)
SetResourceOwnerID 来源于python,未知参数
func (*QuerySendDetailsRequest) SetSendDate ¶
func (q *QuerySendDetailsRequest) SetSendDate(sendDate string)
SetSendDate 设置短信发送日期 必须 短信发送日期格式yyyyMMdd,支持最近30天记录查询
type QuerySendDetailsResponse ¶
type QuerySendDetailsResponse struct { ErrorMessage TotalCount *int `json:"TotalCount,omitempty"` // 发送总条数 TotalPage *int `json:"TotalPage,omitempty"` // 总页数 SmsSendDetailDTOs *SmsSendDetailDTOs `json:"SmsSendDetailDTOs,omitempty"` // 发送明细结构体 }
QuerySendDetailsResponse 短信发送记录查询接口服务器响应
func (*QuerySendDetailsResponse) GetSmsSendDetailDTOs ¶
func (q *QuerySendDetailsResponse) GetSmsSendDetailDTOs() *SmsSendDetailDTOs
GetSmsSendDetailDTOs 获取短信发送记录
func (*QuerySendDetailsResponse) GetTotalCount ¶
func (q *QuerySendDetailsResponse) GetTotalCount() int
GetTotalCount 发送总条数
func (*QuerySendDetailsResponse) GetTotalPage ¶
func (q *QuerySendDetailsResponse) GetTotalPage() int
GetTotalPage 总页数
func (QuerySendDetailsResponse) String ¶
func (q QuerySendDetailsResponse) String() string
String 序列化成JSON字符串
type Request ¶
Request 请求参数设置
func (*Request) CalcStringToSign ¶
CalcStringToSign 计算签名字符串
type SendSmsRequest ¶
type SendSmsRequest struct {
Request *Request
}
SendSmsRequest 发送短信接口请求
func SendSms ¶
func SendSms(businessID, phoneNumbers, signName, templateCode, templateParam string) *SendSmsRequest
SendSms 发送短信接口 businessID 设置业务请求流水号,必填。 phoneNumbers 短信发送的号码列表,必填。 多手机号使用,分割 signName 短信签名 templateCode 申请的短信模板编码,必填 templateParam 短信模板变量参数
func (*SendSmsRequest) DoActionWithException ¶
func (s *SendSmsRequest) DoActionWithException() (resp *SendSmsResponse, err error)
DoActionWithException 发起HTTP请求
func (*SendSmsRequest) GetOutID ¶
func (s *SendSmsRequest) GetOutID(outID string) string
GetOutID 获取外部流水扩展字段
func (*SendSmsRequest) GetOwnerID ¶
func (s *SendSmsRequest) GetOwnerID() string
GetOwnerID 来源于python,未知参数
func (*SendSmsRequest) GetPhoneNumbers ¶
func (s *SendSmsRequest) GetPhoneNumbers() string
GetPhoneNumbers 获取短信接收号码。
func (*SendSmsRequest) GetResourceOwnerAccount ¶
func (s *SendSmsRequest) GetResourceOwnerAccount() string
GetResourceOwnerAccount 来源于python,未知参数
func (*SendSmsRequest) GetResourceOwnerID ¶
func (s *SendSmsRequest) GetResourceOwnerID() string
GetResourceOwnerID 来源于python,未知参数
func (*SendSmsRequest) GetSignName ¶
func (s *SendSmsRequest) GetSignName() string
GetSignName 获取短信签名
func (*SendSmsRequest) GetTemplateCode ¶
func (s *SendSmsRequest) GetTemplateCode() string
GetTemplateCode 获取短信模板ID
func (*SendSmsRequest) GetTemplateParam ¶
func (s *SendSmsRequest) GetTemplateParam() string
GetTemplateParam 获取短信模板变量替换JSON串,
func (*SendSmsRequest) SetOutID ¶
func (s *SendSmsRequest) SetOutID(outID string)
SetOutID 设置外部流水扩展字段
func (*SendSmsRequest) SetOwnerID ¶
func (s *SendSmsRequest) SetOwnerID(ownerID string)
SetOwnerID 来源于python,未知参数
func (*SendSmsRequest) SetPhoneNumbers ¶
func (s *SendSmsRequest) SetPhoneNumbers(phoneNumbers string)
SetPhoneNumbers 短信接收号码。 支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟, 验证码类型的短信推荐使用单条调用的方式
func (*SendSmsRequest) SetResourceOwnerAccount ¶
func (s *SendSmsRequest) SetResourceOwnerAccount(resourceOwnerAccount string)
SetResourceOwnerAccount 来源于python,未知参数
func (*SendSmsRequest) SetResourceOwnerID ¶
func (s *SendSmsRequest) SetResourceOwnerID(resourceOwnerID string)
SetResourceOwnerID 来源于python,未知参数
func (*SendSmsRequest) SetSignName ¶
func (s *SendSmsRequest) SetSignName(signName string)
SetSignName 设置短信签名
func (*SendSmsRequest) SetTemplateCode ¶
func (s *SendSmsRequest) SetTemplateCode(templateCode string)
SetTemplateCode 短信模板ID
func (*SendSmsRequest) SetTemplateParam ¶
func (s *SendSmsRequest) SetTemplateParam(templateParam string)
SetTemplateParam 短信模板变量替换JSON串, 友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求, 比如短信内容中包含\r\n的情况在JSON中需要表示成\r\n,否则会导致JSON在服务端解析失败
type SendSmsResponse ¶
type SendSmsResponse struct { ErrorMessage BizID *string `json:"BizId,omitempty"` // 发送回执ID,可根据该ID查询具体的发送状态 }
SendSmsResponse 发送短信接口服务器响应
func (*SendSmsResponse) GetBizID ¶
func (s *SendSmsResponse) GetBizID() string
GetBizID 发送回执ID,可根据该ID查询具体的发送状态
type SmsSendDetailDTO ¶
type SmsSendDetailDTO struct { PhoneNum string `json:"PhoneNum"` // 手机号码 SendStatus int `json:"SendStatus"` // 发送状态 1:等待回执,2:发送失败,3:发送成功 ErrCode string `json:"ErrCode"` // 运营商短信错误码 TemplateCode string `json:"TemplateCode"` // 模板ID Content string `json:"Content"` // 短信内容 SendDate string `json:"SendDate"` // 发送时间 ReceiveDate string `json:"ReceiveDate"` // 接收时间 OutID string `json:"OutId"` // 外部流水扩展字段 }
SmsSendDetailDTO 短信发送记录信息
type SmsSendDetailDTOs ¶
type SmsSendDetailDTOs struct {
SmsSendDetailDTO []SmsSendDetailDTO `json:"SmsSendDetailDTO"`
}
SmsSendDetailDTOs 短信发送记录查询列表