1 Star 0 Fork 0

网易易盾 / yidun-golang-sdk

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
image_callback_demo.go 958 Bytes
Copy Edit Raw Blame History
fengyunlong authored 2024-01-03 14:06 . 【go语言sdk】第一版v1.0.0
package main
import (
"fmt"
"log"
image "github.com/yidun/yidun-golang-sdk/yidun/service/antispam/image/v5"
"github.com/yidun/yidun-golang-sdk/yidun/service/antispam/image/v5/callback"
)
/**
* 图片检测结果获取(轮询模式)demo
*/
func main() {
// 设置易盾内容安全分配的businessId
request := callback.NewImageCallbackRequest("YOUR_BUSINESS_ID")
// 实例化一个imageClient,入参需要传入易盾内容安全分配的secretId,secretKey
imageCheckClient := image.NewImageClientWithAccessKey("YOUR_SECRET_ID", "YOUR_SECRET_KEY")
response, err := imageCheckClient.ImageCallback(request)
if err != nil {
// 处理错误并打印日志
log.Fatal(err)
}
if response.GetCode() == 200 {
for _, result := range *response.Result {
fmt.Printf("Antispam taskId:%s \n", *result.Antispam.TaskId)
}
} else {
fmt.Println("error code: ", response.GetCode())
fmt.Println("error msg: ", response.GetMsg())
}
}
Go
1
https://gitee.com/netease_yidun/yidun-golang-sdk.git
git@gitee.com:netease_yidun/yidun-golang-sdk.git
netease_yidun
yidun-golang-sdk
yidun-golang-sdk
main

Search

53164aa7 5694891 3bd8fe86 5694891