1 Star 0 Fork 0

网易易盾/yidun-golang-sdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
live_video_solution_submit_demo.go 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
fengyunlong 提交于 2024-01-03 14:06 . 【go语言sdk】第一版v1.0.0
package main
import (
"encoding/json"
"fmt"
"github.com/yidun/yidun-golang-sdk/yidun/service/antispam/livevideosolution"
request2 "github.com/yidun/yidun-golang-sdk/yidun/service/antispam/livevideosolution/submit/v3/request"
"log"
"os"
)
func main() {
// Create a AntispamRequester instance, the parameters need to pass in the secretId, secretKey distributed by Antispam.
// 设置易盾内容安全分配的businessId
YourSecretId := os.Getenv("SECRET_ID")
YourSecretKey := os.Getenv("SECRET_KEY")
request := request2.NewLiveWallSolutionSubmitV3Req()
// 设置查询开始时间和结束时间
request.SetUrl("YourURL")
request.SetDataId("YourDataId")
// 实例化一个 Client,入参需要传入易盾内容安全分配的secretId,secretKey
client := livevideosolution.NewLiveVideoSolutionClientWithAccessKey(YourSecretId, YourSecretKey)
response, err := client.Check(request)
if err != nil {
// 处理错误并打印日志
log.Fatal(err)
}
if response.GetCode() == 200 {
data := response.Result
jsonBytes, err := json.Marshal(data)
if err != nil {
fmt.Println("转换为JSON时出错:", err)
return
}
jsonStr := string(jsonBytes)
fmt.Println(jsonStr)
} else {
fmt.Println("error code: ", response.GetCode())
fmt.Println("error msg: ", response.GetMsg())
}
}
马建仓 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

搜索帮助

Cb406eda 1850385 E526c682 1850385