(ctx context.Context, uuids ...string)
| 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) |
| 56 | |
| 57 | if len(uuids) > 0 { |
| 58 | if len(uuids) == 1 { |
| 59 | where = append(where, "uuid = ?") |
| 60 | args = append(args, uuids[0]) |
| 61 | } else { |
| 62 | where = append(where, "uuid in (?)") |
| 63 | args = append(args, uuids) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | list, err := s.store.ListQuery(ctx, strings.Join(where, " and "), args, "name asc") |
| 68 | if err != nil { |
| 69 | return nil, err |
| 70 | } |
| 71 | return utils.SliceToSlice(list, s.toModelHandler), nil |
| 72 | } |
| 73 | func (s *imlServiceGet[T, E]) Search(ctx context.Context, keyword string, condition map[string]interface{}, sortRule ...string) ([]*T, error) { |
| 74 | w := make(map[string]interface{}) |
| 75 | for k, v := range condition { |
nothing calls this directly
no outgoing calls
no test coverage detected