mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 20:08:02 +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>
66 lines
1.7 KiB
Go
66 lines
1.7 KiB
Go
package model
|
|
|
|
import (
|
|
global_model "github.com/caos/zitadel/internal/model"
|
|
proj_model "github.com/caos/zitadel/internal/project/model"
|
|
"github.com/caos/zitadel/internal/view/repository"
|
|
)
|
|
|
|
type ApplicationSearchRequest proj_model.ApplicationSearchRequest
|
|
type ApplicationSearchQuery proj_model.ApplicationSearchQuery
|
|
type ApplicationSearchKey proj_model.AppSearchKey
|
|
|
|
func (req ApplicationSearchRequest) GetLimit() uint64 {
|
|
return req.Limit
|
|
}
|
|
|
|
func (req ApplicationSearchRequest) GetOffset() uint64 {
|
|
return req.Offset
|
|
}
|
|
|
|
func (req ApplicationSearchRequest) GetSortingColumn() repository.ColumnKey {
|
|
if req.SortingColumn == proj_model.AppSearchKeyUnspecified {
|
|
return nil
|
|
}
|
|
return ApplicationSearchKey(req.SortingColumn)
|
|
}
|
|
|
|
func (req ApplicationSearchRequest) GetAsc() bool {
|
|
return req.Asc
|
|
}
|
|
|
|
func (req ApplicationSearchRequest) GetQueries() []repository.SearchQuery {
|
|
result := make([]repository.SearchQuery, len(req.Queries))
|
|
for i, q := range req.Queries {
|
|
result[i] = ApplicationSearchQuery{Key: q.Key, Value: q.Value, Method: q.Method}
|
|
}
|
|
return result
|
|
}
|
|
|
|
func (req ApplicationSearchQuery) GetKey() repository.ColumnKey {
|
|
return ApplicationSearchKey(req.Key)
|
|
}
|
|
|
|
func (req ApplicationSearchQuery) GetMethod() global_model.SearchMethod {
|
|
return req.Method
|
|
}
|
|
|
|
func (req ApplicationSearchQuery) GetValue() interface{} {
|
|
return req.Value
|
|
}
|
|
|
|
func (key ApplicationSearchKey) ToColumnName() string {
|
|
switch proj_model.AppSearchKey(key) {
|
|
case proj_model.AppSearchKeyAppID:
|
|
return ApplicationKeyID
|
|
case proj_model.AppSearchKeyName:
|
|
return ApplicationKeyName
|
|
case proj_model.AppSearchKeyProjectID:
|
|
return ApplicationKeyProjectID
|
|
case proj_model.AppSearchKeyOIDCClientID:
|
|
return ApplicationKeyOIDCClientID
|
|
default:
|
|
return ""
|
|
}
|
|
}
|