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
live_video_solution_feedback_demo.go 1.42 KB
Copy Edit Raw Blame History
fengyunlong authored 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/feedback/v1/request"
"log"
"os"
)
func main() {
// Create a AntispamRequester instance, the parameters need to pass in the secretId, secretKey distributed by Antispam.
YourSecretId := os.Getenv("SECRET_ID")
YourSecretKey := os.Getenv("SECRET_KEY")
request := request2.NewLiveWallSolutionFeedbackV1Req()
// 设置查询开始时间和结束时间
feedbacks := make([]*request2.LiveWallSolutionFeedback, 1)
feedback := &request2.LiveWallSolutionFeedback{}
feedback.SetTaskId("YourTaskId")
feedback.SetViewCount(100)
feedbacks[0] = feedback
request.SetFeedbacks(feedbacks)
// 实例化一个 Client,入参需要传入易盾内容安全分配的secretId,secretKey
client := livevideosolution.NewLiveVideoSolutionClientWithAccessKey(YourSecretId, YourSecretKey)
response, err := client.Feedback(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

Search

0d507c66 1850385 C8b1a773 1850385