Documentation ¶
Overview ¶
Package department 通讯录管理/部门管理
Index ¶
- func Create(ctx *corporation.App, payload []byte) (resp []byte, err error)
- func Delete(ctx *corporation.App, params url.Values) (resp []byte, err error)
- func List(ctx *corporation.App, params url.Values) (resp []byte, err error)
- func Update(ctx *corporation.App, payload []byte) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx *corporation.App, payload []byte) (resp []byte, err error)
创建部门
See: https://work.weixin.qq.com/api/doc/90000/90135/90205
POST https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/arkii/wxwork/corporation" "github.com/arkii/wxwork/corporation/apis/contact/department" ) func main() { var ctx *corporation.App payload := []byte("{}") resp, err := department.Create(ctx, payload) fmt.Println(resp, err) }
Output:
func Delete ¶
删除部门
See: https://work.weixin.qq.com/api/doc/90000/90135/90207
GET https://qyapi.weixin.qq.com/cgi-bin/department/delete?access_token=ACCESS_TOKEN&id=ID
Example ¶
package main import ( "fmt" "net/url" "github.com/arkii/wxwork/corporation" "github.com/arkii/wxwork/corporation/apis/contact/department" ) func main() { var ctx *corporation.App params := url.Values{} resp, err := department.Delete(ctx, params) fmt.Println(resp, err) }
Output:
func List ¶
获取部门列表
See: https://work.weixin.qq.com/api/doc/90000/90135/90208
GET https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=ACCESS_TOKEN&id=ID
Example ¶
package main import ( "fmt" "net/url" "github.com/arkii/wxwork/corporation" "github.com/arkii/wxwork/corporation/apis/contact/department" ) func main() { var ctx *corporation.App params := url.Values{} resp, err := department.List(ctx, params) fmt.Println(resp, err) }
Output:
func Update ¶
func Update(ctx *corporation.App, payload []byte) (resp []byte, err error)
更新部门
See: https://work.weixin.qq.com/api/doc/90000/90135/90206
POST https://qyapi.weixin.qq.com/cgi-bin/department/update?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/arkii/wxwork/corporation" "github.com/arkii/wxwork/corporation/apis/contact/department" ) func main() { var ctx *corporation.App payload := []byte("{}") resp, err := department.Update(ctx, payload) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.