From 33351c7bc740f2ecf490971f3bdd1940eec4923f Mon Sep 17 00:00:00 2001 From: shaw Date: Mon, 10 Aug 2026 16:42:51 +0800 Subject: [PATCH] fix(billing): gofmt channel.go and drop the redundant response-model hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - channel.go: 常量块里插入注释后 gofmt 会把 BillingModelSourceResponse 单独成组, 原写法沿用了上一组的对齐空格,CI 的 gofmt 检查因此失败 (internal/service/channel.go:45: File is not properly formatted)。 - 撤掉渠道表单里新加的那条提示:说明本就多余,且"只降不升"只在"相对基线收费" 这个口径下成立,容易被读成"上游返回更贵的模型也不会多收",反而误导。 --- backend/internal/service/channel.go | 2 +- frontend/src/i18n/locales/en/admin/channels.ts | 2 -- frontend/src/i18n/locales/zh/admin/channels.ts | 1 - frontend/src/views/admin/ChannelsView.vue | 3 --- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/backend/internal/service/channel.go b/backend/internal/service/channel.go index 40f3c56530..5ed834eeca 100644 --- a/backend/internal/service/channel.go +++ b/backend/internal/service/channel.go @@ -42,7 +42,7 @@ const ( // BillingModelSourceResponse bills by a trusted model declaration observed // in the successful upstream response. It is deliberately distinct from // "upstream", which means the model sent to the provider. - BillingModelSourceResponse = "response_model" + BillingModelSourceResponse = "response_model" ) // Channel 渠道实体 diff --git a/frontend/src/i18n/locales/en/admin/channels.ts b/frontend/src/i18n/locales/en/admin/channels.ts index 980401316a..6b26e21da9 100644 --- a/frontend/src/i18n/locales/en/admin/channels.ts +++ b/frontend/src/i18n/locales/en/admin/channels.ts @@ -144,8 +144,6 @@ export default { billingModelSourceRequested: 'Bill by requested model', billingModelSourceUpstream: 'Bill by final upstream model', billingModelSourceResponse: 'Bill by upstream response model', - billingModelSourceResponseWarning: - 'Pricing follows the model declared by the upstream response. It can only lower the charge, never raise it — only enable this for upstreams you trust.', billingModelSourceHint: 'Controls which model name is used for pricing lookup', selectedCount: '{count} selected', searchGroups: 'Search groups...', diff --git a/frontend/src/i18n/locales/zh/admin/channels.ts b/frontend/src/i18n/locales/zh/admin/channels.ts index 2b18151ac0..3da00a3120 100644 --- a/frontend/src/i18n/locales/zh/admin/channels.ts +++ b/frontend/src/i18n/locales/zh/admin/channels.ts @@ -144,7 +144,6 @@ export default { billingModelSourceRequested: '以请求模型计费', billingModelSourceUpstream: '以最终模型计费', billingModelSourceResponse: '按上游响应模型计费', - billingModelSourceResponseWarning: '计费基准以上游响应自报的模型为准。该模式只会降低费用、不会抬高,但请仅对可信的上游启用。', billingModelSourceHint: '控制使用哪个模型名称进行定价查找', selectedCount: '已选 {count} 个', searchGroups: '搜索分组...', diff --git a/frontend/src/views/admin/ChannelsView.vue b/frontend/src/views/admin/ChannelsView.vue index 308b2f05b8..9dceb5362a 100644 --- a/frontend/src/views/admin/ChannelsView.vue +++ b/frontend/src/views/admin/ChannelsView.vue @@ -226,9 +226,6 @@

{{ t('admin.channels.form.billingModelSourceHint', 'Controls which model name is used for pricing lookup') }}

-

- {{ t('admin.channels.form.billingModelSourceResponseWarning', 'Pricing follows the model declared by the upstream response. It can only lower the charge, never raise it — only enable this for upstreams you trust.') }} -