2021-09-18 15:32:39 +02:00
|
|
|
package form
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
// SearchFaces represents search form fields for "/api/v1/faces".
|
|
|
|
type SearchFaces struct {
|
2021-09-18 15:32:39 +02:00
|
|
|
Query string `form:"q"`
|
2021-12-16 11:42:57 +01:00
|
|
|
UID string `form:"uid"`
|
2021-09-18 15:32:39 +02:00
|
|
|
Subject string `form:"subject"`
|
2021-09-18 20:41:30 +02:00
|
|
|
Unknown string `form:"unknown"`
|
|
|
|
Hidden string `form:"hidden"`
|
2021-09-18 15:32:39 +02:00
|
|
|
Markers bool `form:"markers"`
|
|
|
|
Count int `form:"count" binding:"required" serialize:"-"`
|
|
|
|
Offset int `form:"offset" serialize:"-"`
|
|
|
|
Order string `form:"order" serialize:"-"`
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFaces) GetQuery() string {
|
2021-09-18 15:32:39 +02:00
|
|
|
return f.Query
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFaces) SetQuery(q string) {
|
2021-09-18 15:32:39 +02:00
|
|
|
f.Query = q
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
func (f *SearchFaces) ParseQueryString() error {
|
2021-09-18 15:32:39 +02:00
|
|
|
return ParseQueryString(f)
|
|
|
|
}
|
|
|
|
|
2021-11-26 14:28:50 +01:00
|
|
|
func NewFaceSearch(query string) SearchFaces {
|
|
|
|
return SearchFaces{Query: query}
|
2021-09-18 15:32:39 +02:00
|
|
|
}
|