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
8d54f862
authored
Aug 10, 2025
by
t0ng7u
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🤓
chore: format code file
parent
0bcd7388
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
model/model_meta.go
+11
-11
No files found.
model/model_meta.go
View file @
8d54f862
...
@@ -141,17 +141,17 @@ func GetBoundChannels(modelName string) ([]BoundChannel, error) {
...
@@ -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 根据模型名称和匹配规则查找模型元数据,优先级:精确 > 前缀 > 后缀 > 包含
...
...
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