department

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package department 通讯录管理/部门管理

Index

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

func Delete(ctx *corporation.App, params url.Values) (resp []byte, err error)

删除部门

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

func List(ctx *corporation.App, params url.Values) (resp []byte, err error)

获取部门列表

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.

Jump to

Keyboard shortcuts

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