template_message

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 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 Industry

type Industry struct {
	PrimaryIndustry   IndustryItem `json:"primary_industry"`
	SecondaryIndustry IndustryItem `json:"secondary_industry"`
}

Industry 所属行业

type IndustryItem

type IndustryItem struct {
	FirstClass  string `json:"first_class"`
	SecondClass string `json:"second_class"`
}

type Message

type Message struct {
	ToUser      string                       `json:"touser"`
	TemplateId  string                       `json:"template_id"`
	TopColor    string                       `json:"topcolor"`
	Url         string                       `json:"url"`
	MiniProgram *MiniProgram                 `json:"miniprogram,omitempty"`
	Data        map[string]*MessageDataValue `json:"data,omitempty"`
}

Message 消息体

type MessageDataValue

type MessageDataValue struct {
	Value string `json:"value,omitempty"`
	Color string `json:"color,omitempty"`
}

MessageDataValue 消息数据值

type MiniProgram

type MiniProgram struct {
	AppID    string `json:"appid,omitempty"`
	PagePath string `json:"pagepath,omitempty"`
}

MiniProgram 跳转小程序

type Template

type Template struct {
	TemplateId      string `json:"template_id"`
	Title           string `json:"title"`
	PrimaryIndustry string `json:"primary_industry"`
	DeputyIndustry  string `json:"deputy_industry"`
	Content         string `json:"content"`
	Example         string `json:"example"`
}

Template 模板信息

type TemplateList

type TemplateList struct {
	TemplateList []Template `json:"template_list"`
}

type TemplateMessage

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

TemplateMessage 模板消息

func New

func (*TemplateMessage) AddTemplate

func (tm *TemplateMessage) AddTemplate(templateIdShort string) (string, error)

AddTemplate 添加模板

func (*TemplateMessage) DeletePrivateTemplate

func (tm *TemplateMessage) DeletePrivateTemplate(templateId string) error

DeletePrivateTemplate 删除模板

func (*TemplateMessage) GetIndustry

func (tm *TemplateMessage) GetIndustry() (*Industry, error)

GetIndustry 获取设置的行业信息

func (*TemplateMessage) GetPrivateTemplates

func (tm *TemplateMessage) GetPrivateTemplates() (*TemplateList, error)

GetPrivateTemplates 获取所有模板列表

func (*TemplateMessage) Send

func (tm *TemplateMessage) Send(message Message) (int, error)

Send 模板消息发送

func (*TemplateMessage) SetIndustry

func (tm *TemplateMessage) SetIndustry(industryOne, industryTwo string) error

SetIndustry 设置所属行业

Jump to

Keyboard shortcuts

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