task.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package archive
  2. import (
  3. "sync"
  4. "time"
  5. )
  6. var (
  7. // TookTypeMinute video task took time in 1 minute
  8. TookTypeMinute = int8(1)
  9. // TookTypeHalfHour video task took time in 10 minutes
  10. TookTypeHalfHour = int8(2)
  11. // TaskStateUnclaimed video task belongs to nobody
  12. TaskStateUnclaimed = int8(0)
  13. // TaskStateUntreated video task not submit
  14. TaskStateUntreated = int8(1)
  15. // TaskStateCompleted video task completed
  16. TaskStateCompleted = int8(2)
  17. // TaskStateDelayed video task delayed
  18. TaskStateDelayed = int8(3)
  19. // TaskStateClosed video task closed
  20. TaskStateClosed = int8(4)
  21. )
  22. // TaskCache store task video
  23. type TaskCache struct {
  24. Task map[int64]*Task
  25. Took []*TaskTook
  26. Sort []int
  27. Mtime time.Time
  28. sync.Mutex
  29. }
  30. // Task video task entity
  31. type Task struct {
  32. ID int64 `json:"id"`
  33. Subject int8 `json:"subject"`
  34. Adminid int64 `json:"adminid"`
  35. Pool int8 `json:"pool"`
  36. Aid int64 `json:"aid"`
  37. Cid int64 `json:"cid"`
  38. State int8 `json:"state"`
  39. Ctime time.Time `json:"ctime"`
  40. Mtime time.Time `json:"-"`
  41. }
  42. // TaskTook video task take time
  43. type TaskTook struct {
  44. ID int64 `json:"id"`
  45. M90 int `json:"m90"`
  46. M80 int `json:"m80"`
  47. M60 int `json:"m60"`
  48. M50 int `json:"m50"`
  49. TypeID int8 `json:"type"`
  50. Ctime time.Time `json:"ctime"`
  51. Mtime time.Time `json:"-"`
  52. }