 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- type Category
- type DataItem
- type GetCategoryResponse
- type GetPubTemplateKeywordsByIDResponse
- type GetPubTemplateTitleListRequest
- type GetPubTemplateTitleListResponse
- type GetUserNotifyRequest
- type GetUserNotifyResponse
- type KeywordEnumValue
- type Message
- type NotifyInfo
- type PubTemplateKeywords
- type PubTemplateTitle
- type SetUserNotifyExtRequest
- type SetUserNotifyRequest
- type Subscribe
- func (s *Subscribe) Add(ShortID string, kidList []int, sceneDesc string) (templateID string, err error)
- func (s *Subscribe) Delete(templateID string) (err error)
- func (s *Subscribe) GetCategory() ([]Category, error)
- func (s *Subscribe) GetPubTemplateKeywordsByID(tid string) (*GetPubTemplateKeywordsByIDResponse, error)
- func (s *Subscribe) GetPubTemplateTitleList(req *GetPubTemplateTitleListRequest) (*GetPubTemplateTitleListResponse, error)
- func (s *Subscribe) GetUserNotify(req *GetUserNotifyRequest) (*GetUserNotifyResponse, error)
- func (s *Subscribe) ListTemplates() (*TemplateList, error)
- func (s *Subscribe) Send(msg *Message) (err error)
- func (s *Subscribe) SendGetMsgID(msg *Message) (msgID int64, err error)
- func (s *Subscribe) SetUserNotify(req *SetUserNotifyRequest) error
- func (s *Subscribe) SetUserNotifyExt(req *SetUserNotifyExtRequest) error
- func (s *Subscribe) UniformSend(msg *UniformMessage) (err error)
 
- type TemplateItem
- type TemplateList
- type UniformMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataItem ¶
type DataItem struct {
	Value interface{} `json:"value"`
	Color string      `json:"color"`
}
    DataItem 模版内某个 .DATA 的值
type GetCategoryResponse ¶
type GetCategoryResponse struct {
	util.CommonError
	Data []Category `json:"data"`
}
    GetCategoryResponse 获取类目响应
type GetPubTemplateKeywordsByIDResponse ¶
type GetPubTemplateKeywordsByIDResponse struct {
	util.CommonError
	Count int64                 `json:"count"`
	Data  []PubTemplateKeywords `json:"data"`
}
    GetPubTemplateKeywordsByIDResponse 获取关键词列表响应
type GetPubTemplateTitleListRequest ¶
GetPubTemplateTitleListRequest 获取所属类目下的公共模板请求
type GetPubTemplateTitleListResponse ¶
type GetPubTemplateTitleListResponse struct {
	util.CommonError
	Count int64              `json:"count"`
	Data  []PubTemplateTitle `json:"data"`
}
    GetPubTemplateTitleListResponse 获取所属类目下的公共模板响应
type GetUserNotifyRequest ¶
type GetUserNotifyRequest struct {
	OpenID     string `json:"openid"`
	NotifyType int64  `json:"notify_type"`
	NotifyCode string `json:"notify_code"`
}
    GetUserNotifyRequest 查询服务卡片状态请求
type GetUserNotifyResponse ¶
type GetUserNotifyResponse struct {
	util.CommonError
	NotifyInfo NotifyInfo `json:"notify_info"`
}
    GetUserNotifyResponse 查询服务卡片状态响应
type KeywordEnumValue ¶
type KeywordEnumValue struct {
	EnumValueList []string `json:"enumValueList"`
	KeywordCode   string   `json:"keywordCode"`
}
    KeywordEnumValue 枚举参数值范围
type Message ¶
type Message struct {
	ToUser           string               `json:"touser"`            // 必选,接收者(用户)的 openid
	TemplateID       string               `json:"template_id"`       // 必选,所需下发的订阅模板id
	Page             string               `json:"page"`              // 可选,点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。
	Data             map[string]*DataItem `json:"data"`              // 必选, 模板内容
	MiniprogramState string               `json:"miniprogram_state"` // 可选,跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
	Lang             string               `json:"lang"`              // 入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN
}
    Message 订阅消息请求参数
type NotifyInfo ¶
type NotifyInfo struct {
	NotifyType     int64  `json:"notify_type"`
	ContentJSON    string `json:"content_json"`
	CodeState      int64  `json:"code_state"`
	CodeExpireTime int64  `json:"code_expire_time"`
}
    NotifyInfo 卡片状态
type PubTemplateKeywords ¶
type PubTemplateKeywords struct {
	KID     int64  `json:"kid"`
	Name    string `json:"name"`
	Example string `json:"example"`
	Rule    string `json:"rule"`
}
    PubTemplateKeywords 关键词
type PubTemplateTitle ¶
type PubTemplateTitle struct {
	Type       int64  `json:"type"`
	TID        string `json:"tid"`
	Title      string `json:"title"`
	CategoryID string `json:"categoryId"`
}
    PubTemplateTitle 模板标题
type SetUserNotifyExtRequest ¶
type SetUserNotifyExtRequest struct {
	OpenID     string `json:"openid"`
	NotifyType int64  `json:"notify_type"`
	NotifyCode string `json:"notify_code"`
	ExtJSON    string `json:"ext_json"`
}
    SetUserNotifyExtRequest 更新服务卡片扩展信息请求
type SetUserNotifyRequest ¶
type SetUserNotifyRequest struct {
	OpenID      string `json:"openid"`
	NotifyType  int64  `json:"notify_type"`
	NotifyCode  string `json:"notify_code"`
	ContentJSON string `json:"content_json"`
	CheckJSON   string `json:"check_json,omitempty"`
}
    SetUserNotifyRequest 激活与更新服务卡片请求
type Subscribe ¶
Subscribe 订阅消息
func (*Subscribe) Add ¶
func (s *Subscribe) Add(ShortID string, kidList []int, sceneDesc string) (templateID string, err error)
Add 添加订阅消息模板
func (*Subscribe) GetCategory ¶
GetCategory 获取类目 see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/subscribe-message/getCategory.html
func (*Subscribe) GetPubTemplateKeywordsByID ¶
func (s *Subscribe) GetPubTemplateKeywordsByID(tid string) (*GetPubTemplateKeywordsByIDResponse, error)
GetPubTemplateKeywordsByID 获取关键词列表 see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/subscribe-message/getPubTemplateKeyWordsById.html
func (*Subscribe) GetPubTemplateTitleList ¶
func (s *Subscribe) GetPubTemplateTitleList(req *GetPubTemplateTitleListRequest) (*GetPubTemplateTitleListResponse, error)
GetPubTemplateTitleList 获取所属类目下的公共模板 see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/subscribe-message/getPubTemplateTitleList.html
func (*Subscribe) GetUserNotify ¶
func (s *Subscribe) GetUserNotify(req *GetUserNotifyRequest) (*GetUserNotifyResponse, error)
GetUserNotify 查询服务卡片状态 see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/subscribe-message/getUserNotify.html
func (*Subscribe) ListTemplates ¶
func (s *Subscribe) ListTemplates() (*TemplateList, error)
ListTemplates 获取当前帐号下的个人模板列表 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.getTemplateList.html
func (*Subscribe) SendGetMsgID ¶
SendGetMsgID 发送订阅消息返回 msgid
func (*Subscribe) SetUserNotify ¶
func (s *Subscribe) SetUserNotify(req *SetUserNotifyRequest) error
SetUserNotify 激活与更新服务卡片 see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/subscribe-message/setUserNotify.html
func (*Subscribe) SetUserNotifyExt ¶
func (s *Subscribe) SetUserNotifyExt(req *SetUserNotifyExtRequest) error
SetUserNotifyExt 更新服务卡片扩展信息 see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/subscribe-message/setUserNotifyExt.html
func (*Subscribe) UniformSend ¶
func (s *Subscribe) UniformSend(msg *UniformMessage) (err error)
UniformSend 发送统一服务消息
type TemplateItem ¶
type TemplateItem struct {
	PriTmplID            string             `json:"priTmplId"`
	Title                string             `json:"title"`
	Content              string             `json:"content"`
	Example              string             `json:"example"`
	Type                 int64              `json:"type"`
	KeywordEnumValueList []KeywordEnumValue `json:"keywordEnumValueList"`
}
    TemplateItem template item
type TemplateList ¶
type TemplateList struct {
	util.CommonError
	Data []TemplateItem `json:"data"`
}
    TemplateList template list
type UniformMessage ¶
type UniformMessage struct {
	ToUser           string `json:"touser"`
	WeappTemplateMsg struct {
		TemplateID      string               `json:"template_id"`
		Page            string               `json:"page"`
		FormID          string               `json:"form_id"`
		Data            map[string]*DataItem `json:"data"`
		EmphasisKeyword string               `json:"emphasis_keyword"`
	} `json:"weapp_template_msg"`
	MpTemplateMsg struct {
		Appid       string `json:"appid"`
		TemplateID  string `json:"template_id"`
		URL         string `json:"url"`
		Miniprogram struct {
			Appid    string `json:"appid"`
			Pagepath string `json:"pagepath"`
		} `json:"miniprogram"`
		Data map[string]*DataItem `json:"data"`
	} `json:"mp_template_msg"`
}
    UniformMessage 统一服务消息