work

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: Zlib Imports: 11 Imported by: 0

Documentation

Overview

*

  • 企业微信处理(发消息,服务于报警)

*

  • 企业微信处理(发消息,服务于报警)

Index

Constants

View Source
const ApiPrefixUrl = "https://qyapi.weixin.qq.com"

Variables

This section is empty.

Functions

func AddExContactMsgTemplate

func AddExContactMsgTemplate(corp token.Base, msg *ExMsgTemplate) (string, error)

AddExContactMsgTemplate 添加企业群发消息模板 企业可通过此接口添加企业群发消息的模板并通知客服人员发送给相关客户。(注:企业微信终端需升级到2.7.5版本及以上) 注意:调用该接口并不会直接发送消息给客户,需要相关的客服人员操作以后才会实际发送(客服人员的企业微信需要升级到2.7.5及以上版本) 同一个企业对一个客户一个自然周内(周一至周日)至多只能发送一条消息,超过限制的用户将会被忽略。

func GCreate

func GCreate(corp token.Base, group *Group) (string, error)

GCreate 创建群聊会话

func GetAccessToken

func GetAccessToken(tk token.Token, d data.D) (access.Token, error)

func GetDepartment

func GetDepartment(corp token.Base, id string) (string, error)

func GetExContact

func GetExContact(corp token.Base) (string, error)

GetExContact 获取配置了客户联系功能的成员列表,有哪些企业成员,可以获取客户

func GetExContactWithExUserId

func GetExContactWithExUserId(corp token.Base, externalUserid string) (string, error)

GetExContactWithExUserId 获取外部联系人详情

func GetExContactWithUserId

func GetExContactWithUserId(corp token.Base, userid string) (string, error)

GetExContactWithUserId 获取外部联系人列表 企业可通过此接口获取指定成员添加的客户列表。客户是指配置了客户联系功能的成员所添加的外部联系人。

func IsTokenExpired

func IsTokenExpired(code int32) bool

func NewToken

func NewToken(app app.App) token.Token

func SendMessage added in v0.3.2

func SendMessage(corp token.Base, msg Message) (string, error)

SendMessage 发送应用消息,群聊消息,客户欢迎语

Types

type AccessToken

type AccessToken struct {
	Token    string `json:"access_token"`
	ExpireIn int64  `json:"expires_in"`
}

func (AccessToken) GetAccessToken

func (a AccessToken) GetAccessToken() access.Value

func (AccessToken) GetRefAccessToken

func (a AccessToken) GetRefAccessToken() access.Value

type Articles

type Articles struct {
	Title  string `json:"title"`
	Desc   string `json:"description"`
	Url    string `json:"url"`
	Picurl string `json:"picurl"`
}

type Content

type Content struct {
	Content string `json:"content"`
}
type ExLink struct {
	Title  string `json:"title"`
	Picurl string `json:"picurl"`
	Desc   string `json:"desc"`
	Url    string `json:"url"`
}

type ExMsgTemplate

type ExMsgTemplate struct {
	ExUseIds []string   `json:"external_userid"`
	Sender   string     `json:"sender"`
	Text     *Content   `json:"text,omitempty"`
	Image    *Image     `json:"image,omitempty"`
	Link     *ExLink    `json:"link,omitempty"`
	Program  *ExProgram `json:"miniprogram,omitempty"`
}

type ExProgram

type ExProgram struct {
	Title   string `json:"title"`        //"title": "消息标题",
	MediaId string `json:"pic_media_id"` //"pic_media_id": "MEDIA_ID",
	AppId   string `json:"appid"`        //"appid": "wx8bd80126147df384",
	Page    string `json:"page"`         //"page": "/path/index"
}

type ExWelcomeMsg

type ExWelcomeMsg struct {
	Text        *Content   `json:"text,omitempty"`
	Image       *Image     `json:"image,omitempty"`
	Link        *ExLink    `json:"link,omitempty"`
	Miniprogram *ExProgram `json:"miniprogram,omitempty"`
	Code        int64      `json:"welcome_code"`
}

func (*ExWelcomeMsg) IsAgent

func (h *ExWelcomeMsg) IsAgent() bool

func (*ExWelcomeMsg) IsGroup

func (h *ExWelcomeMsg) IsGroup() bool

func (*ExWelcomeMsg) IsWelcome

func (h *ExWelcomeMsg) IsWelcome() bool

type Group

type Group struct {
	Id    string   `json:"chatid"`
	Name  string   `json:"name"`
	Owner string   `json:"owner"`
	Users []string `json:"userlist"`
}

群组

type Image

type Image struct {
	MediaId string `json:"media_id"`
}

type Message

type Message interface {
	IsGroup() bool
	IsAgent() bool
	IsWelcome() bool
}

func NewMessage

func NewMessage(toWho ToWho, msgType string, msg interface{}) Message

type News

type News struct {
	Articles []Articles `json:"articles"`
}

"news" : { "articles" : [ { "title" : "中秋节礼品领取", "description" : "今年中秋节公司有豪礼相送", "url" : "URL", "picurl" : "http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png" }

type TextCard

type TextCard struct {
	Title  string `json:"title"`
	Desc   string `json:"description"`
	Url    string `json:"url"`
	BtnTxt string `json:"btntxt"`
}

"textcard" : { "title" : "领奖通知", "description" : "<div class=\"gray\">2016年9月26日</div> <div class=\"normal\">恭喜你抽中iPhone 7一台,领奖码:xxxx</div><div class=\"highlight\">请于2016年10月10日前联系行政同事领取</div>", "url" : "URL", "btntxt":"更多" }

type ToAgent

type ToAgent struct {
	AgentId int64  `json:"agentid,omitempty"` //应用id
	ToUser  string `json:"touser,omitempty"`  //企业号中的用户帐号
	ToTag   string `json:"totag,omitempty"`   //企业号中的标签id,群发使用(推荐)
	ToParty string `json:"toparty,omitempty"` //企业号中的部门id,群发时使用。
}

func (*ToAgent) IsAgent

func (to *ToAgent) IsAgent() (bool, *ToAgent)

func (*ToAgent) IsGroup

func (to *ToAgent) IsGroup() (bool, *ToGroup)

func (*ToAgent) IsRoot added in v0.3.2

func (to *ToAgent) IsRoot() (bool, *ToRoot)

type ToGroup

type ToGroup struct {
	ChatId string `json:"chatid,omitempty"`
}

func (*ToGroup) IsAgent

func (to *ToGroup) IsAgent() (bool, *ToAgent)

func (*ToGroup) IsGroup

func (to *ToGroup) IsGroup() (bool, *ToGroup)

type ToRoot added in v0.3.2

type ToRoot struct {
}

func (*ToRoot) IsAgent added in v0.3.2

func (to *ToRoot) IsAgent() (bool, *ToAgent)

func (*ToRoot) IsGroup added in v0.3.2

func (to *ToRoot) IsGroup() (bool, *ToGroup)

func (*ToRoot) IsRoot added in v0.3.2

func (to *ToRoot) IsRoot() (bool, *ToRoot)

type ToWho

type ToWho interface {
	IsGroup() (bool, *ToGroup)
	IsAgent() (bool, *ToAgent)
}

type Video

type Video struct {
	MediaId string `json:"media_id"`
	Title   string `json:"title"`
	Desc    string `json:"description"`
}

type Voice

type Voice struct {
	MediaId string `json:"media_id"`
}

Jump to

Keyboard shortcuts

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