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

Method List

service/universally/get-softdelete.go:38–59  ·  view source on GitHub ↗
(ctx context.Context, uuids ...string)

Source from the content-addressed store, hash-verified

36 return s.toModelHandler(v), nil
37}
38func (s *imlServiceGetSoftDelete[T, E]) List(ctx context.Context, uuids ...string) ([]*T, error) {
39 where := make([]string, 0, 2)
40 args := make([]interface{}, 0, 2)
41
42 where = append(where, SoftDeleteWhere)
43
44 if len(uuids) > 0 {
45 if len(uuids) == 1 {
46 where = append(where, "uuid = ?")
47 args = append(args, uuids[0])
48 } else {
49 where = append(where, "uuid in (?)")
50 args = append(args, uuids)
51 }
52 }
53
54 list, err := s.store.ListQuery(ctx, strings.Join(where, " and "), args, "name asc")
55 if err != nil {
56 return nil, err
57 }
58 return utils.SliceToSlice(list, s.toModelHandler), nil
59}
60func (s *imlServiceGetSoftDelete[T, E]) Search(ctx context.Context, keyword string, condition map[string]interface{}, sortRule ...string) ([]*T, error) {
61 w := make(map[string]interface{})
62 for k, v := range condition {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected