fix(node): NodeId filter to FilterNodeParams and update cache clearing logic
This commit is contained in:
parent
25c7eb3927
commit
d6fcff1fee
@ -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)
|
||||
}
|
||||
|
||||
@ -470,10 +470,10 @@ func (l *ActivateOrderLogic) clearServerCache(ctx context.Context, sub *subscrib
|
||||
tags := strings.Split(sub.NodeTags, ",")
|
||||
|
||||
err := l.svc.NodeModel.ClearNodeCache(ctx, &node.FilterNodeParams{
|
||||
Page: 1,
|
||||
Size: 1000,
|
||||
ServerId: nodeIds,
|
||||
Tag: tags,
|
||||
Page: 1,
|
||||
Size: 1000,
|
||||
NodeId: nodeIds,
|
||||
Tag: tags,
|
||||
})
|
||||
if err != nil {
|
||||
logger.WithContext(ctx).Error("[Order Queue] Clear node cache failed", logger.Field("error", err.Error()))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user