es.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package model
  2. import "encoding/json"
  3. // ES .
  4. type ES struct {
  5. Addr string
  6. }
  7. // Page .
  8. type Page struct {
  9. Pn int `json:"num"`
  10. Ps int `json:"size"`
  11. Total int64 `json:"total"`
  12. }
  13. // SearchResult search result.
  14. type SearchResult struct {
  15. Order string `json:"order"`
  16. Sort string `json:"sort"`
  17. Result []json.RawMessage `json:"result"`
  18. Page *Page `json:"page"`
  19. Debug string `json:"debug"`
  20. }
  21. // BasicSearchParams .
  22. type BasicSearchParams struct {
  23. AppID string `form:"appid" params:"appid"`
  24. KW string `form:"kw" params:"kw"`
  25. KwFields []string `form:"kw_fields,split" params:"kw_fields"`
  26. Order []string `form:"order,split" params:"order"`
  27. Sort []string `form:"sort,split" params:"sort" default:"desc"`
  28. Pn int `form:"pn" params:"pn;Range(1,5000)" default:"1"`
  29. Ps int `form:"ps" params:"ps;Range(1,10000)" default:"50"`
  30. Debug bool `form:"debug" params:"debug"`
  31. Source []string
  32. }
  33. // BasicUpdateParams .
  34. type BasicUpdateParams struct {
  35. AppID string
  36. }