2020-03-28 15:29:17 +01:00
|
|
|
package form
|
|
|
|
|
2022-10-15 21:54:11 +02:00
|
|
|
// SearchServices represents search form fields for "/api/v1/services".
|
|
|
|
type SearchServices 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
|
|
|
}
|
|
|
|
|
2022-10-15 21:54:11 +02:00
|
|
|
func (f *SearchServices) GetQuery() string {
|
2020-03-28 15:29:17 +01:00
|
|
|
return f.Query
|
|
|
|
}
|
|
|
|
|
2022-10-15 21:54:11 +02:00
|
|
|
func (f *SearchServices) SetQuery(q string) {
|
2020-03-28 15:29:17 +01:00
|
|
|
f.Query = q
|
|
|
|
}
|
|
|
|
|
2022-10-15 21:54:11 +02:00
|
|
|
func (f *SearchServices) ParseQueryString() error {
|
2020-03-28 15:29:17 +01:00
|
|
|
return ParseQueryString(f)
|
|
|
|
}
|
|
|
|
|
2022-10-15 21:54:11 +02:00
|
|
|
func NewSearchServices(query string) SearchServices {
|
|
|
|
return SearchServices{Query: query}
|
2020-03-28 15:29:17 +01:00
|
|
|
}
|