toview.go 953 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package model
  2. import (
  3. "go-common/app/service/main/archive/model/archive"
  4. )
  5. // ArcToView toview video.
  6. type ArcToView struct {
  7. *archive.Archive3
  8. Page *archive.Page3 `json:"page,omitempty"`
  9. Count int `json:"count"`
  10. Cid int64 `json:"cid"`
  11. Progress int64 `json:"progress"`
  12. AddTime int64 `json:"add_at"`
  13. }
  14. // WebArcToView toview video.
  15. type WebArcToView struct {
  16. *archive.View3
  17. BangumiInfo *Bangumi `json:"bangumi,omitempty"`
  18. Cid int64 `json:"cid"`
  19. Progress int64 `json:"progress"`
  20. AddTime int64 `json:"add_at"`
  21. }
  22. // ToView toview.
  23. type ToView struct {
  24. Aid int64 `json:"aid,omitempty"`
  25. Unix int64 `json:"now,omitempty"`
  26. }
  27. // ToViews toview sorted.
  28. type ToViews []*ToView
  29. func (h ToViews) Len() int { return len(h) }
  30. func (h ToViews) Less(i, j int) bool { return h[i].Unix > h[j].Unix }
  31. func (h ToViews) Swap(i, j int) { h[i], h[j] = h[j], h[i] }