| 420 | return utils.SliceToSlice(list, FromEntity), nil |
| 421 | } |
| 422 | func (s *imlClusterService) List(ctx context.Context, clusterIds ...string) ([]*Cluster, error) { |
| 423 | if len(clusterIds) == 0 { |
| 424 | list, err := s.store.List(ctx, make(map[string]interface{})) |
| 425 | if err != nil { |
| 426 | return nil, err |
| 427 | } |
| 428 | return utils.SliceToSlice(list, FromEntity), nil |
| 429 | } |
| 430 | list, err := s.store.ListQuery(ctx, "`uuid` in (?)", []interface{}{clusterIds}, "update_at desc") |
| 431 | if err != nil { |
| 432 | return nil, err |
| 433 | } |
| 434 | return utils.SliceToSlice(list, FromEntity), nil |
| 435 | |
| 436 | } |
| 437 | |
| 438 | func init() { |
| 439 | autowire.Auto[IClusterService](func() reflect.Value { |