security

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: 6 Imported by: 0

Documentation

Overview

Package security 内容安全

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImgSecCheck

func ImgSecCheck(ctx *miniprogram.Miniprogram, media string) (resp []byte, err error)

校验一张图片是否含有违法违规内容。

See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/sec-check/security.imgSecCheck.html

POST(@media) https://api.weixin.qq.com/wxa/img_sec_check?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/minigame/apis/security"
)

func main() {
	var ctx *miniprogram.Miniprogram

	media := ""
	resp, err := security.ImgSecCheck(ctx, media)

	fmt.Println(resp, err)
}
Output:

func MediaCheckAsync

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

异步校验图片/音频是否含有违法违规内容。

See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/sec-check/security.mediaCheckAsync.html

POST https://api.weixin.qq.com/wxa/media_check_async?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/minigame/apis/security"
)

func main() {
	var ctx *miniprogram.Miniprogram

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

	fmt.Println(resp, err)
}
Output:

func MsgSecCheck

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

检查一段文本是否含有违法违规内容。

See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/sec-check/security.msgSecCheck.html

POST https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/miniprogram"
	"github.com/fastwego/miniprogram/minigame/apis/security"
)

func main() {
	var ctx *miniprogram.Miniprogram

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