video.go 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package archive
  2. import "go-common/library/time"
  3. const (
  4. // VideoUploadInfo 视频上传完成
  5. VideoUploadInfo = int8(0)
  6. // VideoXcodeSDFail 视频转码失败
  7. VideoXcodeSDFail = int8(1)
  8. // VideoXcodeSDFinish 一转完成
  9. VideoXcodeSDFinish = int8(2)
  10. // VideoXcodeHDFail 二转失败
  11. VideoXcodeHDFail = int8(3)
  12. // VideoXcodeHDFinish 二转完成
  13. VideoXcodeHDFinish = int8(4)
  14. // VideoDispatchRunning 正在分发
  15. VideoDispatchRunning = int8(5)
  16. // VideoDispatchFinish 分发完成
  17. VideoDispatchFinish = int8(6)
  18. // VideoStatusOpen 视频开放浏览
  19. VideoStatusOpen = int16(0)
  20. // VideoStatusAccess 视频会员可见
  21. VideoStatusAccess = int16(10000)
  22. // VideoStatusWait 视频待审
  23. VideoStatusWait = int16(-1)
  24. // VideoStatusRecycle 视频被打回
  25. VideoStatusRecycle = int16(-2)
  26. // VideoStatusLock 视频被锁定
  27. VideoStatusLock = int16(-4)
  28. // VideoStatusXcodeFail 视频转码失败
  29. VideoStatusXcodeFail = int16(-16)
  30. // VideoStatusSubmit 视频创建已提交
  31. VideoStatusSubmit = int16(-30)
  32. // VideoStatusDelete 视频被删除
  33. VideoStatusDelete = int16(-100)
  34. // XcodeFailZero 转码失败
  35. XcodeFailZero = 0
  36. )
  37. //XcodeStateNames xcode name.
  38. var (
  39. XcodeStateNames = map[int8]string{
  40. VideoUploadInfo: "上传成功",
  41. VideoXcodeSDFail: "一转失败",
  42. VideoXcodeSDFinish: "一转成功",
  43. VideoXcodeHDFail: "二转失败",
  44. VideoXcodeHDFinish: "二转成功",
  45. VideoDispatchRunning: "分发中",
  46. VideoDispatchFinish: "分发完成",
  47. }
  48. )
  49. // Video is archive_video model.
  50. type Video struct {
  51. ID int64 `json:"-"`
  52. Aid int64 `json:"aid"`
  53. Title string `json:"title"`
  54. Desc string `json:"desc"`
  55. Filename string `json:"filename"`
  56. SrcType string `json:"-"`
  57. Cid int64 `json:"cid"`
  58. Duration int64 `json:"-"`
  59. Filesize int64 `json:"-"`
  60. Resolutions string `json:"-"`
  61. Index int `json:"index"`
  62. Playurl string `json:"-"`
  63. Status int16 `json:"status"`
  64. StatusDesc string `json:"status_desc"`
  65. FailCode int8 `json:"fail_code"`
  66. FailDesc string `json:"fail_desc"`
  67. XcodeState int8 `json:"xcode"`
  68. Attribute int32 `json:"-"`
  69. RejectReason string `json:"reject_reason"`
  70. WebLink string `json:"weblink"`
  71. CTime time.Time `json:"ctime"`
  72. MTime time.Time `json:"-"`
  73. }
  74. // AttrSet video Attr set
  75. func (v *Video) AttrSet(attr int32, bit uint) {
  76. v.Attribute = v.Attribute&(^(1 << bit)) | (attr << bit)
  77. }