wechat

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(addr, corpID, corpSecret string, agentID int) error

func SendMarkdownMessage added in v1.0.28

func SendMarkdownMessage(markdown string, users []string, parties []string) error

发送markdown消息

func SendTextMessage

func SendTextMessage(content string, users []string, parties []string) error

发送文本消息

Types

type Client

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

func (*Client) GetDepartments

func (c *Client) GetDepartments() (GetDepartmentsResponse, error)

func (*Client) GetSimpleUserList

func (c *Client) GetSimpleUserList(department string) (GetSimpleUserListResponse, error)

func (*Client) SendMarkdownMessage added in v1.0.28

func (c *Client) SendMarkdownMessage(markdown string, users []string, parties []string) error

func (*Client) SendTextMessage

func (c *Client) SendTextMessage(content string, users []string, parties []string) error

type GetDepartmentsResponse

type GetDepartmentsResponse struct {
	Errcode    int    `json:"errcode"`
	Errmsg     string `json:"errmsg"`
	Department []struct {
		ID       int    `json:"id"`
		Name     string `json:"name"`
		NameEn   string `json:"name_en"`
		Parentid int    `json:"parentid"`
		Order    int    `json:"order"`
	} `json:"department"`
}

func GetDepartments

func GetDepartments() (GetDepartmentsResponse, error)

获取部门列表

type GetSimpleUserListResponse

type GetSimpleUserListResponse struct {
	Errcode  int    `json:"errcode"`
	Errmsg   string `json:"errmsg"`
	Userlist []struct {
		Userid     string `json:"userid"`
		Name       string `json:"name"`
		Department []int  `json:"department"`
	} `json:"userlist"`
}

func GetSimpleUserList

func GetSimpleUserList(department string) (GetSimpleUserListResponse, error)

获取部门下用户信息

Jump to

Keyboard shortcuts

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