(ctx context.Context, subset []int)
| 53 | } |
| 54 | |
| 55 | func (c *nodeClient) ListActiveNodes(ctx context.Context, subset []int) ([]*ent.Node, error) { |
| 56 | stm := c.client.Node.Query().Where(node.StatusEQ(node.StatusActive)) |
| 57 | if len(subset) > 0 { |
| 58 | stm = stm.Where(node.IDIn(subset...)) |
| 59 | } |
| 60 | return stm.All(ctx) |
| 61 | } |
| 62 | |
| 63 | func (c *nodeClient) GetNodeByIds(ctx context.Context, ids []int) ([]*ent.Node, error) { |
| 64 | return withNodeEagerLoading(ctx, c.client.Node.Query().Where(node.IDIn(ids...))).All(ctx) |