task_qa_video.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package model
  2. import (
  3. "encoding/json"
  4. )
  5. //VideoDetail qa video task detail
  6. type VideoDetail struct {
  7. CID int64 `json:"cid" validate:"required,gt=0"`
  8. AID int64 `json:"aid" validate:"required,gt=0"`
  9. TaskID int64 `json:"task_id" validate:"omitempty,gt=0"`
  10. TaskUTime int64 `json:"task_utime"`
  11. Attribute int32 `json:"attribute"`
  12. TagID int64 `json:"tag_id" validate:"omitempty,gt=0"`
  13. ArcTitle string `json:"arc_title"`
  14. ArcTypeID int64 `json:"arc_typeid" validate:"required,gt=0"`
  15. AuditStatus int16 `json:"audit_status" `
  16. AuditSubmit string `json:"audit_submit" validate:"required"`
  17. AuditDetails string `json:"audit_details" validate:"required"`
  18. MID int64 `json:"mid" validate:"required,gt=0"`
  19. UPGroups []int64 `json:"up_groups"`
  20. Fans int64 `json:"fans"`
  21. }
  22. //QATaskVideo qa video
  23. type QATaskVideo struct {
  24. QATask
  25. VideoDetail
  26. AttributeList map[string]int32 `json:"attribute_list"`
  27. }
  28. //VideoTaskInfo info
  29. type VideoTaskInfo struct {
  30. QATaskVideo
  31. UPGroupList []*UPGroup `json:"up_group_list"`
  32. Warnings []interface{} `json:"warnings"`
  33. }
  34. //TaskVideoDetail detail
  35. type TaskVideoDetail struct {
  36. Task *VideoTaskInfo `json:"task"`
  37. Video *Video `json:"review"`
  38. VideoHistory []*VideoOperInfo `json:"video_history"`
  39. }
  40. //GetNote get task submit note
  41. func (qv *QATaskVideo) GetNote() (note string, err error) {
  42. submit := map[string]string{}
  43. if err = json.Unmarshal([]byte(qv.AuditSubmit), &submit); err != nil {
  44. return
  45. }
  46. note = submit["note"]
  47. return
  48. }
  49. //GetAttributeList get task submit attribute
  50. func (qv *QATaskVideo) GetAttributeList() {
  51. qv.AttributeList = AttributeList(qv.Attribute)
  52. }
  53. //GetWarnings get task warnings
  54. func (qv *VideoTaskInfo) GetWarnings() {
  55. qv.Warnings = []interface{}{}
  56. for _, g := range qv.UPGroupList {
  57. qv.Warnings = append(qv.Warnings, g)
  58. }
  59. }