template

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Zlib Imports: 7 Imported by: 0

Documentation

Overview

*

第一类 模板消息

  • 1 设置所属行业
  • 2 获取设置的行业信息
  • 3 获得模板ID
  • 4 获取模板列表
  • 5 删除模板
  • 6 发送模板消息

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(api *api.Api, tmId string) error

删除模板 POST https://api.weixin.qq.com/cgi-bin/template/del_private_template?access_token=ACCESS_TOKEN { "template_id" : "Dyvp3-Ff0cnail_CDSzk1fIc6-9lOkxsQE7exTJbwUE" }

func GetIndustry

func GetIndustry(api *api.Api) (*structs.IndustryS, error)

获取设置的行业信息 GET https://api.weixin.qq.com/cgi-bin/template/get_industry?access_token=ACCESS_TOKEN Result { "primary_industry":{"first_class":"运输与仓储","second_class":"快递"}, "secondary_industry":{"first_class":"IT科技","second_class":"互联网|电子商务"} }

func SetIndustry

func SetIndustry(api *api.Api, req *structs.IndustryReq) error

设置所属行业,每月可修改行业1次 数据示例如下:

{
   "industry_id1":"1",
   "industry_id2":"4"
}

POST https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token=ACCESS_TOKEN

Types

type Base

type Base struct {
	AppId  string   `json:"-"`
	ToUser string   `json:"touser"`
	Id     string   `json:"template_id"`
	Url    string   `json:"url,omitempty"`
	Mini   *Program `json:"miniprogram,omitempty"`
}

Base 模板消息

func (*Base) GetAppId

func (b *Base) GetAppId() string

func (*Base) GetToUser

func (b *Base) GetToUser() string

Template interface

func (*Base) IsMini

func (b *Base) IsMini() bool

Template interface

func (*Base) SetAppId

func (b *Base) SetAppId(appid string)

Template interface

func (*Base) SetFormId

func (b *Base) SetFormId(formid string)

Template interface

func (*Base) SetId

func (b *Base) SetId(id string)

Template interface

func (*Base) SetToUser

func (b *Base) SetToUser(user string)

Template interface

func (*Base) SetUrl

func (b *Base) SetUrl(url string)

Template interface

type Data

type Data struct {
	First  KeyWord `json:"first"`
	Remark KeyWord `json:"remark"`
}

type KeyWord

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

type Program

type Program struct {
	Appid string `json:"appid"`
	Page  string `json:"pagepath,omitempty"`
}

Program 小程序卡片

type Template

type Template interface {
	IsMini() bool
	SetAppId(appId string)
	GetAppId() string
	SetFormId(formId string)
	SetToUser(user string)
	GetToUser() string
	SetId(id string)
	SetUrl(url string)
	SetKeyWord(key string, word KeyWord)
	Clone() Template
}

Jump to

Keyboard shortcuts

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