media_cache.go 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package ugc
  2. import "go-common/library/time"
  3. // ArcCMS represents the archive data structure in MC
  4. type ArcCMS struct {
  5. // Media Info
  6. Title string
  7. AID int64
  8. Content string
  9. Cover string
  10. TypeID int32
  11. Pubtime time.Time
  12. Videos int
  13. // Auth Info
  14. Valid int
  15. Deleted int
  16. Result int
  17. }
  18. // ArcFull is the plus version of ArcCMS
  19. type ArcFull struct {
  20. ArcCMS
  21. Copyright int32
  22. State int32
  23. MID int64
  24. Duration int64
  25. }
  26. // VideoCMS represents the video data structure in MC
  27. type VideoCMS struct {
  28. // Media Info
  29. CID int
  30. Title string
  31. AID int
  32. IndexOrder int
  33. // Auth Info
  34. Valid int
  35. Deleted int
  36. Result int
  37. }
  38. // ToSimple transforms an arcFull to SimpleArc
  39. func (arc *ArcFull) ToSimple() *SimpleArc {
  40. return &SimpleArc{
  41. AID: arc.AID,
  42. MID: arc.MID,
  43. TypeID: arc.TypeID,
  44. Videos: int64(arc.Videos),
  45. Title: arc.Title,
  46. Cover: arc.Cover,
  47. Content: arc.Content,
  48. Duration: arc.Duration,
  49. Pubtime: arc.Pubtime.Time().Format("2006-01-02"),
  50. }
  51. }