防止没有数据

This commit is contained in:
戴育兵 2025-12-17 14:08:07 +08:00
parent e1b0c62f28
commit 2e15c23aeb

View File

@ -52,16 +52,18 @@ func MediaUserList(ctx *gin.Context) {
service.Error(ctx, errors.New("查询艺人数据错误"))
return
}
if statResp != nil && len(statResp.Items) > 0 {
info := statResp.Items[0]
// "pendingVideoCount": 10, // 待上传视频数 "uploadedVideoCount": 25, // 已上传视频数 "releasedVideoTotal": 35, // 已释放视频总数
//"pendingPostCount": 14, // 待上传图文数 "uploadedPostCount": 21, // 已上传图文数 "releasedPostTotal": 35, // 已释放图文总数
v.PendingVideoCount = info.PendingVideoCount
v.UploadedVideoCount = info.UploadedVideoCount
v.ReleasedVideoTotal = info.ReleasedVideoTotal
v.PendingPostCount = info.PendingPostCount
v.UploadedPostCount = info.UploadedPostCount
v.ReleasedPostTotal = info.ReleasedPostTotal
}
info := statResp.Items[0]
// "pendingVideoCount": 10, // 待上传视频数 "uploadedVideoCount": 25, // 已上传视频数 "releasedVideoTotal": 35, // 已释放视频总数
//"pendingPostCount": 14, // 待上传图文数 "uploadedPostCount": 21, // 已上传图文数 "releasedPostTotal": 35, // 已释放图文总数
v.PendingVideoCount = info.PendingVideoCount
v.UploadedVideoCount = info.UploadedVideoCount
v.ReleasedVideoTotal = info.ReleasedVideoTotal
v.PendingPostCount = info.PendingPostCount
v.UploadedPostCount = info.UploadedPostCount
v.ReleasedPostTotal = info.ReleasedPostTotal
}
go func() {
for _, v := range resp.Data {