2020-03-28 15:29:17 +01:00
|
|
|
package form
|
|
|
|
|
|
|
|
// AccountSearch represents search form fields for "/api/v1/accounts".
|
|
|
|
type AccountSearch struct {
|
2020-03-28 17:17:41 +01:00
|
|
|
Query string `form:"q"`
|
2020-03-31 17:26:25 +02:00
|
|
|
Share bool `form:"share"`
|
|
|
|
Sync bool `form:"sync"`
|
2020-04-04 17:19:34 +02:00
|
|
|
Status string `form:"status"`
|
2020-05-23 20:58:58 +02:00
|
|
|
Count int `form:"count" binding:"required" serialize:"-"`
|
|
|
|
Offset int `form:"offset" serialize:"-"`
|
|
|
|
Order string `form:"order" serialize:"-"`
|
2020-03-28 15:29:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (f *AccountSearch) GetQuery() string {
|
|
|
|
return f.Query
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *AccountSearch) SetQuery(q string) {
|
|
|
|
f.Query = q
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *AccountSearch) ParseQueryString() error {
|
|
|
|
return ParseQueryString(f)
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewAccountSearch(query string) AccountSearch {
|
|
|
|
return AccountSearch{Query: query}
|
|
|
|
}
|