models.go 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package search
  2. type HitType string
  3. const (
  4. DashHitDB HitType = "dash-db"
  5. DashHitHome HitType = "dash-home"
  6. DashHitJson HitType = "dash-json"
  7. DashHitScripted HitType = "dash-scripted"
  8. )
  9. type Hit struct {
  10. Id int64 `json:"id"`
  11. Title string `json:"title"`
  12. Uri string `json:"uri"`
  13. Type HitType `json:"type"`
  14. Tags []string `json:"tags"`
  15. IsStarred bool `json:"isStarred"`
  16. }
  17. type HitList []*Hit
  18. func (s HitList) Len() int { return len(s) }
  19. func (s HitList) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
  20. func (s HitList) Less(i, j int) bool { return s[i].Title < s[j].Title }
  21. type Query struct {
  22. Title string
  23. Tags []string
  24. OrgId int64
  25. UserId int64
  26. Limit int
  27. IsStarred bool
  28. DashboardIds []int
  29. Result HitList
  30. }
  31. type FindPersistedDashboardsQuery struct {
  32. Title string
  33. OrgId int64
  34. UserId int64
  35. IsStarred bool
  36. DashboardIds []int
  37. Result HitList
  38. }