1 Star 0 Fork 0

网易易盾/yidun-golang-sdk

Create your Gitee Account
Explore and code with more than 13.5 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
video_solution_callback_demo.go 1.07 KB
Copy Edit Raw Blame History
fengyunlong authored 2024-01-03 14:06 +08:00 . 【go语言sdk】第一版v1.0.0
package main
import (
"encoding/json"
"fmt"
"github.com/yidun/yidun-golang-sdk/yidun/service/antispam/videosolution"
request3 "github.com/yidun/yidun-golang-sdk/yidun/service/antispam/videosolution/callback/v2/request"
"log"
"os"
)
// 点播音视频解决方案回调接口
func main() {
// 设置易盾内容安全分配的businessId
YourSecretId := os.Getenv("VS_SECRET_ID")
YourSecretKey := os.Getenv("VS_SECRET_KEY")
request := request3.NewVideoSolutionCallbackV2Request()
// 实例化一个 Client,入参需要传入易盾内容安全分配的secretId,secretKey
client := videosolution.NewVideoSolutionClientWithAccessKey(YourSecretId, YourSecretKey)
request.SetYidunRequestId("xxx")
response, err := client.Callback(request)
if err != nil {
// 处理错误并打印日志
log.Fatal(err)
}
if response.GetCode() == 200 {
result := response.Result
resultString, _ := json.Marshal(result)
fmt.Println("callback result: ", string(resultString))
} else {
fmt.Println("error code: ", response.GetCode())
fmt.Println("error msg: ", response.GetMsg())
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
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