From 40038b9f9a05a6d0fb5347ac01580622592cef75 Mon Sep 17 00:00:00 2001 From: daiyb <570956418@qq.com> Date: Mon, 24 Nov 2025 16:11:16 +0800 Subject: [PATCH] Update script.go --- pkg/service/cast/script.go | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pkg/service/cast/script.go b/pkg/service/cast/script.go index e679f6f..df8e078 100644 --- a/pkg/service/cast/script.go +++ b/pkg/service/cast/script.go @@ -147,7 +147,25 @@ func ImportBatch(ctx *gin.Context) { if line == 0 { continue } - temp := cast.VideoScriptInfo{} + temp := cast.VideoScriptInfo{ + CreatorUuid: fmt.Sprint(userInfo.ID), + CreatorName: userInfo.Name, + } + if len(row) > 0 { + temp.ArtistName = row[0] + } + if len(row) > 1 { + temp.ArtistPhone = row[1] + } + if len(row) > 2 { + temp.ArtistNum = row[2] + } + if len(row) > 3 { + temp.Title = row[3] + } + if len(row) > 4 { + temp.Content = row[4] + } zap.L().Info("SubNumGetInfo row", zap.Int("line", line), zap.Strings("row", row)) if len(row) < 5 || utils.CleanString(row[2]) == "" || utils.CleanString(row[3]) == "" || utils.CleanString(row[4]) == "" { temp.CreatorUuid = fmt.Sprint(userInfo.ID) @@ -160,15 +178,6 @@ func ImportBatch(ctx *gin.Context) { SubNum: row[2], Domain: "app", }) - temp = cast.VideoScriptInfo{ - Title: row[3], - Content: row[4], - ArtistName: row[0], - ArtistPhone: row[1], - ArtistNum: row[2], - CreatorUuid: fmt.Sprint(userInfo.ID), - CreatorName: userInfo.Name, - } if _err != nil { zap.L().Error("AccountFieeProvider.SubNumGetInfo", zap.Error(_err)) temp.Remark = _err.Error()