app

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 app 应用管理

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentGet

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

获取指定的应用详情

See: https://work.weixin.qq.com/api/doc/90000/90135/90227

GET https://qyapi.weixin.qq.com/cgi-bin/agent/get?access_token=ACCESS_TOKEN&agentid=AGENTID参数说明

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

	params := url.Values{}
	resp, err := app.AgentGet(ctx, params)

	fmt.Println(resp, err)
}
Output:

func AgentList

func AgentList(ctx *corporation.App) (resp []byte, err error)

获取access_token对应的应用列表

See: https://work.weixin.qq.com/api/doc/90000/90135/90227

GET https://qyapi.weixin.qq.com/cgi-bin/agent/list?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

	resp, err := app.AgentList(ctx)

	fmt.Println(resp, err)
}
Output:

func AgentSet

func AgentSet(ctx *corporation.App, payload []byte) (resp []byte, err error)

设置应用

See: https://work.weixin.qq.com/api/doc/90000/90135/90228

POST https://qyapi.weixin.qq.com/cgi-bin/agent/set?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

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

	fmt.Println(resp, err)
}
Output:

func GetWorkbenchTemplate

func GetWorkbenchTemplate(ctx *corporation.App, payload []byte) (resp []byte, err error)

获取应用在工作台展示的模版

See: https://work.weixin.qq.com/api/doc/90000/90135/92535

POST https://qyapi.weixin.qq.com/cgi-bin/agent/get_workbench_template?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

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

	fmt.Println(resp, err)
}
Output:

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

创建菜单

See: https://work.weixin.qq.com/api/doc/90000/90135/90231

POST https://qyapi.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN&agentid=AGENTID

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

	payload := []byte("{}")
	params := url.Values{}
	resp, err := app.MenuCreate(ctx, payload, params)

	fmt.Println(resp, err)
}
Output:

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

删除菜单

See: https://work.weixin.qq.com/api/doc/90000/90135/90233

GET https://qyapi.weixin.qq.com/cgi-bin/menu/delete?access_token=ACCESS_TOKEN&agentid=AGENTID

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

	params := url.Values{}
	resp, err := app.MenuDelete(ctx, params)

	fmt.Println(resp, err)
}
Output:

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

获取菜单

See: https://work.weixin.qq.com/api/doc/90000/90135/90232

GET https://qyapi.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN&agentid=AGENTID

Example
package main

import (
	"fmt"
	"net/url"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

	params := url.Values{}
	resp, err := app.MenuGet(ctx, params)

	fmt.Println(resp, err)
}
Output:

func SetWorkbenchData

func SetWorkbenchData(ctx *corporation.App, payload []byte) (resp []byte, err error)

设置应用在用户工作台展示的数据

See: https://work.weixin.qq.com/api/doc/90000/90135/92535

POST https://qyapi.weixin.qq.com/cgi-bin/agent/set_workbench_data?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

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

	fmt.Println(resp, err)
}
Output:

func SetWorkbenchTemplate

func SetWorkbenchTemplate(ctx *corporation.App, payload []byte) (resp []byte, err error)

设置应用在工作台展示的模版

See: https://work.weixin.qq.com/api/doc/90000/90135/92535

POST https://qyapi.weixin.qq.com/cgi-bin/agent/set_workbench_template?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/arkii/wxwork/corporation"
	"github.com/arkii/wxwork/corporation/apis/app"
)

func main() {
	var ctx *corporation.App

	payload := []byte("{}")
	resp, err := app.SetWorkbenchTemplate(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