| 58 | return utils.SliceToSlice(list, s.toModelHandler), nil |
| 59 | } |
| 60 | func (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 { |
| 63 | w[k] = v |
| 64 | } |
| 65 | w[SoftDeleteField] = false |
| 66 | ps, err := s.store.Search(ctx, keyword, w, sortRule...) |
| 67 | if err != nil { |
| 68 | return nil, err |
| 69 | } |
| 70 | return utils.SliceToSlice(ps, s.toModelHandler), nil |
| 71 | } |
| 72 | |
| 73 | func (s *imlServiceGetSoftDelete[T, E]) SearchByPage(ctx context.Context, keyword string, condition map[string]interface{}, page int, pageSize int, sortRule ...string) ([]*T, int64, error) { |
| 74 | w := make(map[string]interface{}) |