MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / List

Method List

service/universally/get.go:53–72  ·  view source on GitHub ↗
(ctx context.Context, uuids ...string)

Source from the content-addressed store, hash-verified

51 return s.toModelHandler(v), nil
52}
53func (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}
73func (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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected