Documentation
¶
Index ¶
- Constants
- type AddTemplateRequest
- type AddTemplateResponse
- type DeleteTemplateRequest
- type GetCategoryResponse
- type GetPubTemplateKeyWordsByIdRequest
- type GetPubTemplateKeyWordsByIdResponse
- type GetPubTemplateTitleListRequest
- type GetPubTemplateTitleListResponse
- type GetTemplateListResponse
- type MiniprogramState
- type SendData
- type SendRequest
- type SendValue
- type SubscribeMessage
- func (cli *SubscribeMessage) AddTemplate(req *AddTemplateRequest) (*AddTemplateResponse, error)
- func (cli *SubscribeMessage) DeleteTemplate(req *DeleteTemplateRequest) (*request.CommonError, error)
- func (cli *SubscribeMessage) GetCategory() (*GetCategoryResponse, error)
- func (cli *SubscribeMessage) GetPubTemplateKeyWordsById(req *GetPubTemplateKeyWordsByIdRequest) (*GetPubTemplateKeyWordsByIdResponse, error)
- func (cli *SubscribeMessage) GetPubTemplateTitleList(req *GetPubTemplateTitleListRequest) (*GetPubTemplateTitleListResponse, error)
- func (cli *SubscribeMessage) GetTemplateList() (*GetTemplateListResponse, error)
- func (cli *SubscribeMessage) Send(msg *SendRequest) (*request.CommonError, error)
Constants ¶
View Source
const ( MiniprogramStateDeveloper = "developer" MiniprogramStateTrial = "trial" MiniprogramStateFormal = "formal" )
developer为开发版;trial为体验版;formal为正式版;默认为正式版
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTemplateRequest ¶
type AddTemplateResponse ¶
type AddTemplateResponse struct {
request.CommonError
Pid string `json:"priTmplId"` // 添加至帐号下的模板id,发送小程序订阅消息时所需
}
type DeleteTemplateRequest ¶
type DeleteTemplateRequest struct {
// 必填 要删除的模板id
PriTmplId string `json:"priTmplId"`
}
type GetCategoryResponse ¶
type GetCategoryResponse struct {
request.CommonError
Data []struct {
ID int `json:"id"` // 类目id,查询公共库模版时需要
Name string `json:"name"` // 类目的中文名
} `json:"data"` // 类目列表
}
type GetPubTemplateKeyWordsByIdRequest ¶
type GetPubTemplateKeyWordsByIdRequest struct {
// tid string 必填 模板标题 id,可通过接口获取
Tid string `query:"tid"`
}
type GetPubTemplateKeyWordsByIdResponse ¶
type GetPubTemplateKeyWordsByIdResponse struct {
request.CommonError
Count int32 `json:"count"` // 模版标题列表总数
Data []struct {
Kid int `json:"kid"` // 关键词 id,选用模板时需要
Name string `json:"name"` // 关键词内容
Example string `json:"example"` // 关键词内容对应的示例
Rule string `json:"rule"` // 参数类型
} `json:"data"` // 关键词列表
}
type GetPubTemplateTitleListResponse ¶
type GetPubTemplateTitleListResponse struct {
request.CommonError
Count uint `json:"count"` // 模版标题列表总数
Data []struct {
Tid int `json:"tid"` // 模版标题 id
Title string `json:"title"` // 模版标题
Type int32 `json:"type"` // 模版类型,2 为一次性订阅,3 为长期订阅
CategoryId string `json:"categoryId"` // 模版所属类目 id
} `json:"data"` // 模板标题列表
}
帐号所属类目下的公共模板标题
type GetTemplateListResponse ¶
type GetTemplateListResponse struct {
request.CommonError
Data []struct {
Pid string `json:"priTmplId"` // 添加至帐号下的模板 id,发送小程序订阅消息时所需
Title string `json:"title"` // 模版标题
Content string `json:"content"` // 模版内容
Example string `json:"example"` // 模板内容示例
Type int32 `json:"type"` // 模版类型,2 为一次性订阅,3 为长期订阅
} `json:"data"` // 个人模板列表
}
type SendRequest ¶
type SendRequest struct {
ToUser string `json:"touser"`
TemplateID string `json:"template_id"`
Page string `json:"page,omitempty"`
MiniprogramState MiniprogramState `json:"miniprogram_state,omitempty"`
Data SendData `json:"data"`
}
SubscribeMessage 订阅消息
type SubscribeMessage ¶
type SubscribeMessage struct {
// contains filtered or unexported fields
}
func NewSubscribeMessage ¶
func (*SubscribeMessage) AddTemplate ¶
func (cli *SubscribeMessage) AddTemplate(req *AddTemplateRequest) (*AddTemplateResponse, error)
组合模板并添加至帐号下的个人模板库
func (*SubscribeMessage) DeleteTemplate ¶
func (cli *SubscribeMessage) DeleteTemplate(req *DeleteTemplateRequest) (*request.CommonError, error)
删除帐号下的某个模板
func (*SubscribeMessage) GetCategory ¶
func (cli *SubscribeMessage) GetCategory() (*GetCategoryResponse, error)
删除帐号下的某个模板
func (*SubscribeMessage) GetPubTemplateKeyWordsById ¶
func (cli *SubscribeMessage) GetPubTemplateKeyWordsById(req *GetPubTemplateKeyWordsByIdRequest) (*GetPubTemplateKeyWordsByIdResponse, error)
获取模板标题下的关键词列表
func (*SubscribeMessage) GetPubTemplateTitleList ¶
func (cli *SubscribeMessage) GetPubTemplateTitleList(req *GetPubTemplateTitleListRequest) (*GetPubTemplateTitleListResponse, error)
获取帐号所属类目下的公共模板标题
func (*SubscribeMessage) GetTemplateList ¶
func (cli *SubscribeMessage) GetTemplateList() (*GetTemplateListResponse, error)
获取帐号下已存在的模板列表
func (*SubscribeMessage) Send ¶
func (cli *SubscribeMessage) Send(msg *SendRequest) (*request.CommonError, error)
发送订阅消息
Click to show internal directories.
Click to hide internal directories.