(ctx context.Context, uuid string)
| 36 | } |
| 37 | |
| 38 | func (s *imlServiceGet[T, E]) Get(ctx context.Context, uuid string) (*T, error) { |
| 39 | where := map[string]interface{}{ |
| 40 | "uuid": uuid, |
| 41 | } |
| 42 | |
| 43 | v, err := s.store.First(ctx, where) |
| 44 | if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { |
| 45 | return nil, err |
| 46 | } |
| 47 | if v == nil || errors.Is(err, gorm.ErrRecordNotFound) { |
| 48 | return nil, gorm.ErrRecordNotFound |
| 49 | } |
| 50 | |
| 51 | return s.toModelHandler(v), nil |
| 52 | } |
| 53 | func (s *imlServiceGet[T, E]) List(ctx context.Context, uuids ...string) ([]*T, error) { |
| 54 | where := make([]string, 0, 2) |
| 55 | args := make([]interface{}, 0, 2) |
nothing calls this directly
no outgoing calls
no test coverage detected