department

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 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 *dingding.App, payload []byte) (resp []byte, err error)

创建部门

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

POST https://oapi.dingtalk.com/department/create?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.App

	payload := []byte("{}")
	resp, err := department.Create(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func Delete

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

删除部门

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

GET https://oapi.dingtalk.com/department/delete?access_token=ACCESS_TOKENid=ID

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.App

	params := url.Values{}
	resp, err := department.Delete(ctx, params)

	fmt.Println(resp, err)
}
Output:

func Get

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

获取部门详情

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

GET https://oapi.dingtalk.com/department/get?access_token=ACCESS_TOKENid=123

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.App

	params := url.Values{}
	resp, err := department.Get(ctx, params)

	fmt.Println(resp, err)
}
Output:

func List

func List(ctx *dingding.App) (resp []byte, err error)

获取部门列表

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

GET https://oapi.dingtalk.com/department/list?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.App

	resp, err := department.List(ctx)

	fmt.Println(resp, err)
}
Output:

func ListIds

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

获取子部门ID列表

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

GET https://oapi.dingtalk.com/department/list_ids?access_token=ACCESS_TOKENid=ID

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.App

	params := url.Values{}
	resp, err := department.ListIds(ctx, params)

	fmt.Println(resp, err)
}
Output:

func ListParentDepts

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

查询指定用户的所有上级父部门路径

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

GET https://oapi.dingtalk.com/department/list_parent_depts?access_token=ACCESS_TOKENuserId=USERID

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.App

	params := url.Values{}
	resp, err := department.ListParentDepts(ctx, params)

	fmt.Println(resp, err)
}
Output:

func ListParentDeptsByDept

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

查询部门的所有上级父部门路径

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

GET https://oapi.dingtalk.com/department/list_parent_depts_by_dept?access_token=ACCESS_TOKENid=ID

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.App

	params := url.Values{}
	resp, err := department.ListParentDeptsByDept(ctx, params)

	fmt.Println(resp, err)
}
Output:

func Update

func Update(ctx *dingding.App, payload []byte) (resp []byte, err error)

更新部门

See: https://ding-doc.dingtalk.com/doc#/serverapi2/dubakq

POST https://oapi.dingtalk.com/department/update?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/dingding"
	"github.com/fastwego/dingding/apis/contact/department"
)

func main() {
	var ctx *dingding.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