subscribemessage

package
v3.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTemplateRequest

type AddTemplateRequest struct {
	// 必填	模板标题 id,可通过接口获取,也可登录小程序后台查看获取
	Tid string `json:"tid"`
	// 必填	开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如 [3,5,4] 或 [4,5,3]),最多支持5个,最少2个关键词组合
	KidList []int `json:"kidList"`
	// 非必填	服务场景描述,15个字以内
	SceneDesc string `json:"sceneDesc"`
}

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 GetPubTemplateTitleListRequest

type GetPubTemplateTitleListRequest struct {
	// 必填	类目 id,多个用逗号隔开
	Ids string `query:"ids"`
	// 必填	用于分页,表示从 start 开始。从 0 开始计数。
	Start int `query:"start"`
	// 必填	用于分页,表示拉取 limit 条记录。最大为 30。
	Limit int `query:"limit"`
}

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 MiniprogramState

type MiniprogramState = string

MiniprogramState 跳转小程序类型

const (
	MiniprogramStateDeveloper MiniprogramState = "developer"
	MiniprogramStateTrial     MiniprogramState = "trial"
	MiniprogramStateFormal    MiniprogramState = "formal"
)

developer为开发版;trial为体验版;formal为正式版;默认为正式版

type SendData added in v3.6.1

type SendData map[string]SendValue

模板数据内容

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 SendValue added in v3.6.1

type SendValue struct {
	Value string `json:"value"`
}

模板变量值

type SubscribeMessage

type SubscribeMessage struct {
	// contains filtered or unexported fields
}

func NewSubscribeMessage

func NewSubscribeMessage(request *request.Request, combineURI func(url string, req interface{}, withToken bool) (string, error)) *SubscribeMessage

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 (*SubscribeMessage) GetPubTemplateTitleList

获取帐号所属类目下的公共模板标题

func (*SubscribeMessage) GetTemplateList

func (cli *SubscribeMessage) GetTemplateList() (*GetTemplateListResponse, error)

获取帐号下已存在的模板列表

func (*SubscribeMessage) Send

发送订阅消息

Jump to

Keyboard shortcuts

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