sug.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package search
  2. // SugResponse is the structure of search api response
  3. type SugResponse struct {
  4. Code int `json:"code"`
  5. Cost *Cost `json:"cost"`
  6. Result *Result `json:"result"`
  7. PageCaches *PageCaches `json:"page caches"`
  8. Sengine *Sengine `json:"sengine"`
  9. Stoken string `json:"stoken"`
  10. }
  11. // Cost def.
  12. type Cost struct {
  13. About *About `json:"about"`
  14. }
  15. // About def.
  16. type About struct {
  17. ParamsCheck string `json:"params_check"`
  18. Total string `json:"total"`
  19. MainHandler string `json:"main_handler"`
  20. }
  21. // Result def.
  22. type Result struct {
  23. Tag []*STag `json:"tag"`
  24. }
  25. // STag def.
  26. type STag struct {
  27. Value string `json:"value"`
  28. Ref int `json:"ref"`
  29. Name string `json:"name"`
  30. Spid int `json:"spid"`
  31. Type string `json:"type"`
  32. }
  33. // PageCaches def.
  34. type PageCaches struct {
  35. SaveCache string `json:"save cache"`
  36. }
  37. // Sengine def.
  38. type Sengine struct {
  39. Usage int `json:"usage"`
  40. }
  41. // ReqSug def.
  42. type ReqSug struct {
  43. MobiApp string `form:"mobi_app"`
  44. Build string `form:"build"`
  45. Platform string `form:"platform"`
  46. Term string `form:"term" validate:"required"`
  47. }