🤓 chore: format code file

This commit is contained in:
t0ng7u
2025-08-10 23:17:04 +08:00
parent 195be56c46
commit dd9d2a150d

View File

@@ -141,17 +141,17 @@ func GetBoundChannels(modelName string) ([]BoundChannel, error) {
// GetBoundChannelsForModels 批量查询多模型的绑定渠道并去重返回 // GetBoundChannelsForModels 批量查询多模型的绑定渠道并去重返回
func GetBoundChannelsForModels(modelNames []string) ([]BoundChannel, error) { func GetBoundChannelsForModels(modelNames []string) ([]BoundChannel, error) {
if len(modelNames) == 0 { if len(modelNames) == 0 {
return make([]BoundChannel, 0), nil return make([]BoundChannel, 0), nil
} }
var channels []BoundChannel var channels []BoundChannel
err := DB.Table("channels"). err := DB.Table("channels").
Select("channels.name, channels.type"). Select("channels.name, channels.type").
Joins("join abilities on abilities.channel_id = channels.id"). Joins("join abilities on abilities.channel_id = channels.id").
Where("abilities.model IN ? AND abilities.enabled = ?", modelNames, true). Where("abilities.model IN ? AND abilities.enabled = ?", modelNames, true).
Group("channels.id"). Group("channels.id").
Scan(&channels).Error Scan(&channels).Error
return channels, err return channels, err
} }
// FindModelByNameWithRule 根据模型名称和匹配规则查找模型元数据,优先级:精确 > 前缀 > 后缀 > 包含 // FindModelByNameWithRule 根据模型名称和匹配规则查找模型元数据,优先级:精确 > 前缀 > 后缀 > 包含