mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
8bfa1a083c
* feat: get views and failed events * feat: get views and failed events * feat: get views and failed events * Update internal/view/repository/sequence.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/view/repository/general_query.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> Co-authored-by: Livio Amstutz <livio.a@gmail.com>
54 lines
1.2 KiB
Go
54 lines
1.2 KiB
Go
package repository
|
|
|
|
import (
|
|
global_model "github.com/caos/zitadel/internal/model"
|
|
"github.com/caos/zitadel/internal/view/model"
|
|
)
|
|
|
|
type GeneralSearchRequest model.GeneralSearchRequest
|
|
type GeneralSearchQuery model.GeneralSearchQuery
|
|
type GeneralSearchKey model.GeneralSearchKey
|
|
|
|
func (req GeneralSearchRequest) GetLimit() uint64 {
|
|
return req.Limit
|
|
}
|
|
|
|
func (req GeneralSearchRequest) GetOffset() uint64 {
|
|
return req.Offset
|
|
}
|
|
|
|
func (req GeneralSearchRequest) GetSortingColumn() ColumnKey {
|
|
if req.SortingColumn == model.GeneralSearchKeyUnspecified {
|
|
return nil
|
|
}
|
|
return GeneralSearchKey(req.SortingColumn)
|
|
}
|
|
|
|
func (req GeneralSearchRequest) GetAsc() bool {
|
|
return req.Asc
|
|
}
|
|
|
|
func (req GeneralSearchRequest) GetQueries() []SearchQuery {
|
|
result := make([]SearchQuery, len(req.Queries))
|
|
for i, q := range req.Queries {
|
|
result[i] = GeneralSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method}
|
|
}
|
|
return result
|
|
}
|
|
|
|
func (req GeneralSearchQuery) GetKey() ColumnKey {
|
|
return GeneralSearchKey(req.Key)
|
|
}
|
|
|
|
func (req GeneralSearchQuery) GetMethod() global_model.SearchMethod {
|
|
return req.Method
|
|
}
|
|
|
|
func (req GeneralSearchQuery) GetValue() interface{} {
|
|
return req.Value
|
|
}
|
|
|
|
func (key GeneralSearchKey) ToColumnName() string {
|
|
return ""
|
|
}
|