Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1263c955
authored
Oct 02, 2025
by
feitianbubu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add doubao video add log detail
parent
3c796a11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
controller/task_video.go
+6
-4
No files found.
controller/task_video.go
View file @
1263c955
...
@@ -170,8 +170,9 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
...
@@ -170,8 +170,9 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
task
.
Quota
=
actualQuota
// 更新任务记录的实际扣费额度
task
.
Quota
=
actualQuota
// 更新任务记录的实际扣费额度
// 记录消费日志
// 记录消费日志
logContent
:=
fmt
.
Sprintf
(
"视频任务成功补扣费,模型倍率 %.2f,分组倍率 %.2f,tokens %d"
,
logContent
:=
fmt
.
Sprintf
(
"视频任务成功补扣费,模型倍率 %.2f,分组倍率 %.2f,tokens %d,预扣费 %s,实际扣费 %s,补扣费 %s"
,
modelRatio
,
finalGroupRatio
,
taskResult
.
TotalTokens
)
modelRatio
,
finalGroupRatio
,
taskResult
.
TotalTokens
,
logger
.
LogQuota
(
preConsumedQuota
),
logger
.
LogQuota
(
actualQuota
),
logger
.
LogQuota
(
quotaDelta
))
model
.
RecordLog
(
task
.
UserId
,
model
.
LogTypeSystem
,
logContent
)
model
.
RecordLog
(
task
.
UserId
,
model
.
LogTypeSystem
,
logContent
)
}
}
}
else
if
quotaDelta
<
0
{
}
else
if
quotaDelta
<
0
{
...
@@ -190,8 +191,9 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
...
@@ -190,8 +191,9 @@ func updateVideoSingleTask(ctx context.Context, adaptor channel.TaskAdaptor, cha
task
.
Quota
=
actualQuota
// 更新任务记录的实际扣费额度
task
.
Quota
=
actualQuota
// 更新任务记录的实际扣费额度
// 记录退款日志
// 记录退款日志
logContent
:=
fmt
.
Sprintf
(
"视频任务成功退还多扣费用,模型倍率 %.2f,分组倍率 %.2f,tokens %d,退还 %s"
,
logContent
:=
fmt
.
Sprintf
(
"视频任务成功退还多扣费用,模型倍率 %.2f,分组倍率 %.2f,tokens %d,预扣费 %s,实际扣费 %s,退还 %s"
,
modelRatio
,
finalGroupRatio
,
taskResult
.
TotalTokens
,
logger
.
LogQuota
(
refundQuota
))
modelRatio
,
finalGroupRatio
,
taskResult
.
TotalTokens
,
logger
.
LogQuota
(
preConsumedQuota
),
logger
.
LogQuota
(
actualQuota
),
logger
.
LogQuota
(
refundQuota
))
model
.
RecordLog
(
task
.
UserId
,
model
.
LogTypeSystem
,
logContent
)
model
.
RecordLog
(
task
.
UserId
,
model
.
LogTypeSystem
,
logContent
)
}
}
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment