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

Method Search

service/universally/get.go:73–83  ·  view source on GitHub ↗
(ctx context.Context, keyword string, condition map[string]interface{}, sortRule ...string)

Source from the content-addressed store, hash-verified

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 {
76 w[k] = v
77 }
78 ps, err := s.store.Search(ctx, keyword, w, sortRule...)
79 if err != nil {
80 return nil, err
81 }
82 return utils.SliceToSlice(ps, s.toModelHandler), nil
83}
84
85func (s *imlServiceGet[T, E]) SearchByPage(ctx context.Context, keyword string, condition map[string]interface{}, page int, pageSize int, sortRule ...string) ([]*T, int64, error) {
86 w := make(map[string]interface{})

Callers

nothing calls this directly

Calls 1

SearchMethod · 0.65

Tested by

no test coverage detected