From 516515bab64fe6b505bac87070368af6e872907b Mon Sep 17 00:00:00 2001 From: fengsilin Date: Tue, 24 Mar 2026 11:14:45 +0800 Subject: [PATCH] feat: add BoundChannelId field to Token model Add BoundChannelId field to support binding a token to a specific channel. When set, the token will always use the bound channel for requests. Co-Authored-By: Claude Opus 4.6 --- model/token.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/token.go b/model/token.go index 773b2d7..5f10ad5 100644 --- a/model/token.go +++ b/model/token.go @@ -27,7 +27,8 @@ type Token struct { AllowIps *string `json:"allow_ips" gorm:"default:''"` UsedQuota int `json:"used_quota" gorm:"default:0"` // used quota Group string `json:"group" gorm:"default:''"` - CrossGroupRetry bool `json:"cross_group_retry"` // 跨分组重试,仅auto分组有效 + CrossGroupRetry bool `json:"cross_group_retry"` // 跨分组重试,仅auto分组有效 + BoundChannelId *int `json:"bound_channel_id" gorm:"index"` // 绑定的渠道ID,nil表示不绑定 DeletedAt gorm.DeletedAt `gorm:"index"` }