photoprism/internal/form/album_search.go
Michael Mayer ca154f3bb3 Replace date picker with day, month & year inputs #274 #358
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-07-06 07:41:33 +02:00

36 lines
934 B
Go

package form
// AlbumSearch represents search form fields for "/api/v1/albums".
type AlbumSearch struct {
Query string `form:"q"`
ID string `form:"id"`
Type string `form:"type"`
Category string `form:"category"`
Slug string `form:"slug"`
Title string `form:"title"`
Country string `json:"country"`
Year int `json:"year"`
Month int `json:"month"`
Day int `json:"day"`
Favorite bool `form:"favorite"`
Private bool `form:"private"`
Count int `form:"count" binding:"required" serialize:"-"`
Offset int `form:"offset" serialize:"-"`
Order string `form:"order" serialize:"-"`
}
func (f *AlbumSearch) GetQuery() string {
return f.Query
}
func (f *AlbumSearch) SetQuery(q string) {
f.Query = q
}
func (f *AlbumSearch) ParseQueryString() error {
return ParseQueryString(f)
}
func NewAlbumSearch(query string) AlbumSearch {
return AlbumSearch{Query: query}
}