(ctx context.Context, providerId string, priority int)
| 69 | } |
| 70 | |
| 71 | func (i *imlAIKeyService) KeysAfterPriority(ctx context.Context, providerId string, priority int) ([]*Key, error) { |
| 72 | list, err := i.store.ListQuery(ctx, "sort > ? and provider = ?", []interface{}{priority, providerId}, "sort asc") |
| 73 | if err != nil { |
| 74 | return nil, err |
| 75 | } |
| 76 | var result []*Key |
| 77 | for _, item := range list { |
| 78 | result = append(result, FromEntity(item)) |
| 79 | } |
| 80 | return result, nil |
| 81 | } |
| 82 | |
| 83 | func (i *imlAIKeyService) MaxPriority(ctx context.Context, providerId string) (int, error) { |
| 84 | info, err := i.store.First(ctx, map[string]interface{}{"provider": providerId}, "sort desc") |
nothing calls this directly
no test coverage detected