message

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category added in v0.1.2

type Category struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Category 模板所属类目

type DataValue

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

type Keyword added in v0.1.2

type Keyword struct {
	Tid     string `json:"tid"`
	Name    string `json:"name"`
	Example string `json:"example"`
	Rule    string `json:"rule"`
}

Keyword 模板关键词

type KeywordEnumValue added in v0.1.2

type KeywordEnumValue struct {
	EnumValueList []string `json:"enumValueList"`
	KeywordCode   string   `json:"keywordCode"`
}

type Message

type Message struct {
	ToUser           string                `json:"touser"`
	TemplateId       string                `json:"template_id"`
	Page             string                `json:"page"`
	Data             map[string]*DataValue `json:"data,omitempty"`
	MiniProgramState string                `json:"miniprogram_state"`
	Lang             string                `json:"lang"`
}

Message 消息体

type PrivateTemplate added in v0.1.2

type PrivateTemplate struct {
	PrivateTemplateID    string             `json:"priTmplId"`
	Title                string             `json:"title"`
	Content              string             `json:"content"`
	Example              string             `json:"example"`
	Type                 int                `json:"type"`
	KeywordEnumValueList []KeywordEnumValue `json:"keywordEnumValueList"`
}

PrivateTemplate 个人模板

type PublicTemplate added in v0.1.2

type PublicTemplate struct {
	Tid        string `json:"tid"`
	Title      string `json:"title"`
	Type       int    `json:"type"`
	CategoryId string `json:"categoryId"`
}

PublicTemplate 公共模板

type Subscribe added in v0.1.2

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

Subscribe 小程序订阅消息

func NewSubscribe added in v0.1.2

func NewSubscribe(account contracts.AccountInterface) *Subscribe

func (*Subscribe) AddTemplate added in v0.1.2

func (m *Subscribe) AddTemplate(tid string, kidList []int, sceneDesc string) (string, error)

AddTemplate 添加订阅消息模板

func (*Subscribe) DeleteTemplate added in v0.1.2

func (m *Subscribe) DeleteTemplate(privateTemplateId string) error

DeleteTemplate 删除订阅消息模板

func (*Subscribe) GetCategory added in v0.1.2

func (m *Subscribe) GetCategory() ([]Category, error)

GetCategory 获取类目

func (*Subscribe) GetKeywords added in v0.1.2

func (m *Subscribe) GetKeywords(tid string) ([]Keyword, error)

GetKeywords 获取关键词列表

func (*Subscribe) GetPublicTemplates added in v0.1.2

func (m *Subscribe) GetPublicTemplates(ids string, start, limit int) ([]PublicTemplate, error)

GetPublicTemplates 获取所属类目下的公共模板

func (*Subscribe) GetTemplateList added in v0.1.2

func (m *Subscribe) GetTemplateList() ([]PrivateTemplate, error)

GetTemplateList 获取个人模板列表

func (*Subscribe) Send added in v0.1.2

func (m *Subscribe) Send(message Message) error

Send 发送订阅消息

Jump to

Keyboard shortcuts

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