fix(node): NodeId filter to FilterNodeParams and update cache clearing logic

This commit is contained in:
Chang lue Tsen
2025-09-29 10:22:11 +09:00
parent 25c7eb3927
commit d6fcff1fee
2 changed files with 8 additions and 4 deletions
+4
View File
@@ -32,6 +32,7 @@ type FilterParams struct {
type FilterNodeParams struct {
Page int // Page Number
Size int // Page Size
NodeId []int64 // Node IDs
ServerId []int64 // Server IDs
Tag []string // Tags
Search string // Search Address or Name
@@ -77,6 +78,9 @@ func (m *customServerModel) FilterNodeList(ctx context.Context, params *FilterNo
s := "%" + params.Search + "%"
query = query.Where("`name` LIKE ? OR `address` LIKE ? OR `tags` LIKE ? OR `port` LIKE ? ", s, s, s, s)
}
if len(params.NodeId) > 0 {
query = query.Where("id IN ?", params.NodeId)
}
if len(params.ServerId) > 0 {
query = query.Where("server_id IN ?", params.ServerId)
}