fix(node): update FilterNodeParams to use NodeId and adjust query logic for tags
This commit is contained in:
parent
2de76104ad
commit
766e210f06
@ -218,7 +218,7 @@ func (l *SubscribeLogic) getServers(userSub *user.Subscribe) ([]*node.Node, erro
|
||||
_, nodes, err := l.svc.NodeModel.FilterNodeList(l.ctx.Request.Context(), &node.FilterNodeParams{
|
||||
Page: 1,
|
||||
Size: 1000,
|
||||
ServerId: nodeIds,
|
||||
NodeId: nodeIds,
|
||||
Tag: tool.RemoveDuplicateElements(tags...),
|
||||
Preload: true,
|
||||
Enabled: &enable, // Only get enabled nodes
|
||||
|
||||
@ -85,6 +85,7 @@ func (m *customServerModel) FilterNodeList(ctx context.Context, params *FilterNo
|
||||
query = query.Where("server_id IN ?", params.ServerId)
|
||||
}
|
||||
if len(params.Tag) > 0 {
|
||||
query = query.Where("1 = 0")
|
||||
for _, tag := range params.Tag {
|
||||
query = query.Or("FIND_IN_SET(?,tags)", tag)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user