wechat

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changes

type Changes struct {
	Adds []*model.ContactInfo
	Upts []*model.ContactInfo
	Dels []*model.ContactInfo
}

Changes changes structure

type Wechat

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

Wechat 企业微信应用

func New

func New(d *dao.Dao) (w *Wechat)

New create an new wechat work

func (*Wechat) AccessToken

func (w *Wechat) AccessToken(c context.Context, app *model.AppConfig) (token string, err error)

AccessToken get access_token from cache first, if not found, get it via wechat api.

func (*Wechat) AnalysisContacts

func (w *Wechat) AnalysisContacts(c context.Context) (err error)

AnalysisContacts analysis the contact difference and save them 从企业微信更新用户列表最新

func (*Wechat) NewTxtNotify

func (w *Wechat) NewTxtNotify(content string) (txtMsg *model.TxtNotification)

NewTxtNotify create wechat format text notification 从配置初始化企业微信TxtNotification

func (*Wechat) PushMsg

func (w *Wechat) PushMsg(c context.Context, userNames []string, content string) (err error)

PushMsg push text message via wechat notification api with access_token.推送企业微信

func (*Wechat) QueryWechatContacts

func (w *Wechat) QueryWechatContacts(c context.Context) (contacts []*model.ContactInfo, err error)

QueryWechatContacts query wechat contacts with access token 获取用户信息列表

func (*Wechat) SyncContacts

func (w *Wechat) SyncContacts(c context.Context) (err error)

SyncContacts sync the contacts from wechat work 更新用户信息列表

func (*Wechat) UpdateVisible

func (w *Wechat) UpdateVisible(c context.Context) (err error)

UpdateVisible update the visible property 更新用户saga信息

func (*Wechat) UserIds

func (w *Wechat) UserIds(userNames []string) (ids string, err error)

UserIds query user ids for user name list 查询员工编号

Jump to

Keyboard shortcuts

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