2021-09-02 16:12:31 +02:00
|
|
|
package form
|
|
|
|
|
|
|
|
// SubjectSearch represents search form fields for "/api/v1/subjects".
|
|
|
|
type SubjectSearch struct {
|
|
|
|
Query string `form:"q"`
|
|
|
|
ID string `form:"id"`
|
|
|
|
Type string `form:"type"`
|
|
|
|
Name string `form:"name"`
|
2021-10-06 15:27:17 +02:00
|
|
|
All bool `form:"all"`
|
|
|
|
Hidden string `form:"hidden"`
|
|
|
|
Favorite string `form:"favorite"`
|
|
|
|
Private string `form:"private"`
|
|
|
|
Excluded string `form:"excluded"`
|
2021-09-17 18:51:24 +02:00
|
|
|
Files int `form:"files"`
|
2021-10-01 16:34:29 +02:00
|
|
|
Photos int `form:"photos"`
|
2021-09-02 16:12:31 +02:00
|
|
|
Count int `form:"count" binding:"required" serialize:"-"`
|
|
|
|
Offset int `form:"offset" serialize:"-"`
|
|
|
|
Order string `form:"order" serialize:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *SubjectSearch) GetQuery() string {
|
|
|
|
return f.Query
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *SubjectSearch) SetQuery(q string) {
|
|
|
|
f.Query = q
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *SubjectSearch) ParseQueryString() error {
|
|
|
|
return ParseQueryString(f)
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewSubjectSearch(query string) SubjectSearch {
|
|
|
|
return SubjectSearch{Query: query}
|
|
|
|
}
|