photoprism/internal/form/search_labels.go
Michael Mayer 650817a9e0 API: Add prefix to the source filename of search request handlers
Finding the right code is easier when the name matches related
functionality in other packages.
2021-11-26 14:28:50 +01:00

30 lines
743 B
Go

package form
// SearchLabels represents search form fields for "/api/v1/labels".
type SearchLabels struct {
Query string `form:"q"`
ID string `form:"id"`
Slug string `form:"slug"`
Name string `form:"name"`
All bool `form:"all"`
Favorite bool `form:"favorite"`
Count int `form:"count" binding:"required" serialize:"-"`
Offset int `form:"offset" serialize:"-"`
Order string `form:"order" serialize:"-"`
}
func (f *SearchLabels) GetQuery() string {
return f.Query
}
func (f *SearchLabels) SetQuery(q string) {
f.Query = q
}
func (f *SearchLabels) ParseQueryString() error {
return ParseQueryString(f)
}
func NewLabelSearch(query string) SearchLabels {
return SearchLabels{Query: query}
}