photoprism/internal/form/search_accounts.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

29 lines
687 B
Go

package form
// SearchAccounts represents search form fields for "/api/v1/accounts".
type SearchAccounts struct {
Query string `form:"q"`
Share bool `form:"share"`
Sync bool `form:"sync"`
Status string `form:"status"`
Count int `form:"count" binding:"required" serialize:"-"`
Offset int `form:"offset" serialize:"-"`
Order string `form:"order" serialize:"-"`
}
func (f *SearchAccounts) GetQuery() string {
return f.Query
}
func (f *SearchAccounts) SetQuery(q string) {
f.Query = q
}
func (f *SearchAccounts) ParseQueryString() error {
return ParseQueryString(f)
}
func NewAccountSearch(query string) SearchAccounts {
return SearchAccounts{Query: query}
}