photoprism/internal/form/album_search.go

30 lines
706 B
Go
Raw Normal View History

package form
2019-06-17 21:45:06 +02:00
// AlbumSearch represents search form fields for "/api/v1/albums".
type AlbumSearch struct {
Query string `form:"q"`
ID string `form:"id"`
Slug string `form:"slug"`
Name string `form:"name"`
Favorite bool `form:"favorite"`
Count int `form:"count" binding:"required" serialize:"-"`
Offset int `form:"offset" serialize:"-"`
Order string `form:"order" serialize:"-"`
2019-06-17 21:45:06 +02:00
}
func (f *AlbumSearch) GetQuery() string {
return f.Query
}
2019-06-17 21:45:06 +02:00
func (f *AlbumSearch) SetQuery(q string) {
f.Query = q
}
2019-06-17 21:45:06 +02:00
func (f *AlbumSearch) ParseQueryString() error {
return ParseQueryString(f)
2019-06-17 21:45:06 +02:00
}
2020-01-27 16:53:09 +01:00
func NewAlbumSearch(query string) AlbumSearch {
return AlbumSearch{Query: query}
}