category

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package category 类目管理

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCategory

func AddCategory(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)

添加类目

调用本接口可以给小程序添加类目,添加的类目需要在所有可设置的类目列表中。使用过程中如遇到问题,可在开放平台服务商专区发帖交流。

See: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/category/addcategory.html

POST https://api.weixin.qq.com/cgi-bin/wxopen/addcategory?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/wxopen/apis/category"
)

func main() {
	var ctx *miniprogram.Miniprogram

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

	fmt.Println(resp, err)
}
Output:

func DeleteCategory

func DeleteCategory(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)

删除类目

调用本接口可以删除小程序的指定类目。使用过程中如遇到问题,可在开放平台服务商专区发帖交流。

See: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/category/deletecategory.html

POST https://api.weixin.qq.com/cgi-bin/wxopen/deletecategory?access_token=TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/wxopen/apis/category"
)

func main() {
	var ctx *miniprogram.Miniprogram

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

	fmt.Println(resp, err)
}
Output:

func GetAllCategories

func GetAllCategories(ctx *miniprogram.Miniprogram) (resp []byte, err error)

获取可以设置的所有类目

本接口可以获取该小程序允许设置的所有类目且仅支持获取一级类目和二级类目,注意不同主体所允许设置的类目不同。使用过程中如遇到问题,可在开放平台服务商专区发帖交流。

See: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/category/getallcategories.html

GET https://api.weixin.qq.com/cgi-bin/wxopen/getallcategories?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/wxopen/apis/category"
)

func main() {
	var ctx *miniprogram.Miniprogram

	resp, err := category.GetAllCategories(ctx)

	fmt.Println(resp, err)
}
Output:

func GetCategory

func GetCategory(ctx *miniprogram.Miniprogram) (resp []byte, err error)

获取已设置的所有类目

使用本接口获取小程序已设置的所有类目。使用过程中如遇到问题,可在开放平台服务商专区发帖交流。

See: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/category/getcategory.html

GET https://api.weixin.qq.com/cgi-bin/wxopen/getcategory?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/wxopen/apis/category"
)

func main() {
	var ctx *miniprogram.Miniprogram

	resp, err := category.GetCategory(ctx)

	fmt.Println(resp, err)
}
Output:

func ModifyCategory

func ModifyCategory(ctx *miniprogram.Miniprogram, payload []byte) (resp []byte, err error)

修改类目资质信息

通过获取已设置的类目列表接口 可以获取当前小程序已设置的类目列表。如果某一下类目审核不通过需要补充或者修改资质信息,可以调用本接口进行处理。使用过程中如遇到问题,可在开放平台服务商专区发帖交流。

See: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/category/modifycategory.html

POST https://api.weixin.qq.com/cgi-bin/wxopen/modifycategory?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/wxopen/apis/category"
)

func main() {
	var ctx *miniprogram.Miniprogram

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

	fmt.Println(resp, err)
}
Output:

func WxaCategory

func WxaCategory(ctx *miniprogram.Miniprogram) (resp []byte, err error)

获取审核时可填写的类目信息

See: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/category/get_category.html

GET https://api.weixin.qq.com/wxa/get_category?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/wxopen/apis/category"
)

func main() {
	var ctx *miniprogram.Miniprogram

	resp, err := category.GetCategory(ctx)

	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