Compare commits

...

3 Commits

Author SHA1 Message Date
32af1ae5c1 Update media.go 2026-02-06 14:56:32 +08:00
a805c9c382 Update test.go 2026-02-06 14:34:53 +08:00
ccb469edda Update test.go 2026-02-06 14:33:14 +08:00
2 changed files with 31 additions and 10 deletions

View File

@ -1,6 +1,7 @@
package cast package cast
import ( import (
"context"
"fmt" "fmt"
"fonchain-fiee/api/cast" "fonchain-fiee/api/cast"
"fonchain-fiee/cmd/config" "fonchain-fiee/cmd/config"
@ -19,7 +20,9 @@ func UserAccounts(ctx *gin.Context) {
} else { } else {
req.ArtistUuid = "1234" req.ArtistUuid = "1234"
} }
go func() {
_, _ = service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: "artistOrderInfo", ArtistUuid: req.ArtistUuid})
}()
if err = ctx.ShouldBind(&req); err != nil { if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err) service.Error(ctx, err)
return return

View File

@ -12,9 +12,9 @@ import (
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/check" "fonchain-fiee/pkg/service/check"
"fonchain-fiee/pkg/utils" "fonchain-fiee/pkg/utils"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/xuri/excelize/v2" "github.com/xuri/excelize/v2"
"time"
) )
func Test(ctx *gin.Context) { func Test(ctx *gin.Context) {
@ -49,16 +49,16 @@ func Test(ctx *gin.Context) {
return return
} }
// 找到"标题"和"脚本"列的索引 // 找到"标题"和"脚本内容"列的索引
header := rows[0] header := rows[0]
titleColIndex := -1 titleColIndex := -1
scriptColIndex := -1 scriptColIndex := -1
for i, cell := range header { for i, cell := range header {
if cell == "标题" { if cell == "标题" {
titleColIndex = i titleColIndex = i
} }
if cell == "脚本" { if cell == "脚本内容" {
scriptColIndex = i scriptColIndex = i
} }
} }
@ -75,9 +75,9 @@ func Test(ctx *gin.Context) {
// 遍历数据行从第2行开始跳过表头 // 遍历数据行从第2行开始跳过表头
for i := 1; i < len(rows); i++ { for i := 1; i < len(rows); i++ {
row := rows[i] row := rows[i]
// 确保行有足够的 // 确保行至少有标题
if len(row) <= titleColIndex || len(row) <= scriptColIndex { if len(row) <= titleColIndex {
continue continue
} }
@ -98,12 +98,12 @@ func Test(ctx *gin.Context) {
Content: []modelQwen.Content{ Content: []modelQwen.Content{
{ {
Type: "text", Type: "text",
Text: fmt.Sprintf("请为以下标题生成一个视频脚本:\n%s", title), Text: fmt.Sprintf("请为以下标题生成一个视频脚本:\n%s字数50-100模板是这样的山水清音心旷神怡。远山如黛近水含烟。笔墨间山水清音尽显自然之美。", title),
}, },
}, },
}, },
}, },
Seed: 0, Seed: time.Now().UnixNano(),
EnableSearch: false, EnableSearch: false,
}) })
@ -239,10 +239,28 @@ func Test(ctx *gin.Context) {
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action}) service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action})
return return
} }
//刷新订单
if action == "artistOrderInfo" { if action == "artistOrderInfo" {
service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action}) service.CastProvider.Tools(context.Background(), &cast.ToolsReq{Action: action})
return return
} }
//刷新审批状态
if action == "refreshApprovalStatus" {
/* resp, err := service.CastProvider.WorkList(context.Background(), &cast.WorkListReq{
Page: 1,
WorkStatus: uint32(cast.WorkActionENUM_APPROVAL),
PageSize: 9999,
})
if err != nil {
return
}
if resp.Data == nil || len(resp.Data) == 0 {
return
}
serverCast.RefreshWorkApproval(nil, resp.Data)
service.Success(ctx, resp.Data)
return*/
}
if action == "SecurityText" { if action == "SecurityText" {
val := ctx.PostForm("val") val := ctx.PostForm("val")
ok, err := check.SecurityFile(val) ok, err := check.SecurityFile(val)