content

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TextSceneError

func TextSceneError(scene int) string

TextSceneError 获取违规内容错误信息

Types

type Detail

type Detail struct {
	Strategy string `json:"strategy"`
	ErrCode  int    `json:"errcode"`
	Suggest  string `json:"suggest"`
	Label    int    `json:"label"`
	Level    int    `json:"level"`
	Prob     int    `json:"prob"`
	Keyword  string `json:"keyword"`
}

type MediaType

type MediaType uint8

MediaType 媒体类型

const (
	Audio MediaType = 1
	Image MediaType = 2
)

type Result

type Result struct {
	Suggest string `json:"suggest"`
	Label   int    `json:"label"`
}

type Scene

type Scene int

Scene 审核场景

const (
	Material  Scene = 1 // 资料
	Comment   Scene = 2 // 评论
	Forum     Scene = 3 // 论坛
	SocialLog Scene = 4 // 社交日志
)

type Security

type Security struct {
	// contains filtered or unexported fields
}

Security 内容安全

func NewSecurity added in v0.1.2

func NewSecurity(account contracts.AccountInterface) *Security

func (*Security) AsyncCheckMedia

func (c *Security) AsyncCheckMedia(openid, mediaUrl string, mediaType MediaType, scene Scene) (string, error)

AsyncCheckMedia 异步校验图片/音频是否合规

func (*Security) CheckText

func (c *Security) CheckText(openid, content string, scene Scene) (TextResult, error)

CheckText 文本内容审核

type TextResult

type TextResult struct {
	TraceId string   `json:"trace_id"`
	Result  Result   `json:"result"`
	Detail  []Detail `json:"detail"`
}

TextResult 文字审查结果

Jump to

Keyboard shortcuts

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