track.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package track
  2. import (
  3. "go-common/app/admin/main/videoup/model/archive"
  4. "go-common/library/time"
  5. )
  6. const ()
  7. var ()
  8. type Archive struct {
  9. // common values
  10. Timestamp time.Time `json:"timestamp"`
  11. // archive stat
  12. State int `json:"state"`
  13. Round int `json:"round"`
  14. // AID int64 `json:"aid,omitempty"`
  15. Remark string `json:"remark,omitempty"`
  16. Attribute int32 `json:"attribute"`
  17. }
  18. type Video struct {
  19. // common values
  20. Timestamp time.Time `json:"timestamp"`
  21. XCodeState int8 `json:"xcode_state"`
  22. // video status
  23. Status int16 `json:"status"`
  24. AID int64 `json:"aid,omitempty"`
  25. Remark string `json:"remark,omitempty"`
  26. Attribute int32 `json:"attribute"`
  27. }
  28. // Archives Archive sorted.
  29. type Archives []*Archive
  30. func (a Archives) Len() int { return len(a) }
  31. func (a Archives) Less(i, j int) bool { return int64(a[i].Timestamp) > int64(a[j].Timestamp) }
  32. func (a Archives) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
  33. //ArcTrackInfo 稿件追踪信息
  34. type ArcTrackInfo struct {
  35. EditHistory []*archive.EditHistory `json:"edit_history"`
  36. Track []*Archive `json:"track"`
  37. Relation [][]int `json:"relation"`
  38. }