feat(canvas): 模型选择 - 支持彩色展示标签并优化目录与积分交互

This commit is contained in:
ddCat
2026-09-21 11:11:10 +08:00
parent d5ff22258e
commit b8eefdad70
31 changed files with 410 additions and 63 deletions

View File

@@ -29,6 +29,11 @@ type ModelChannel struct {
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
type ChannelModelTag struct {
Text string `json:"text"`
Color string `json:"color"`
}
type ChannelModel struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
ChannelID string `json:"channelId" gorm:"size:36;index;uniqueIndex:idx_channel_model_key_active,priority:1,where:deleted_at IS NULL"`
@@ -36,6 +41,7 @@ type ChannelModel struct {
ProviderModelKey string `json:"providerModelKey" gorm:"size:120"`
DisplayName string `json:"displayName" gorm:"size:160"`
ChannelLabel string `json:"channelLabel" gorm:"size:80;not null;default:''"`
Tags []ChannelModelTag `json:"tags" gorm:"serializer:json;type:text;not null;default:'[]'"`
Description string `json:"description" gorm:"size:500;not null;default:''"`
SortOrder int `json:"sortOrder" gorm:"not null;default:0"`
Icon string `json:"icon" gorm:"size:80"`