flow.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package archive
  2. import (
  3. "encoding/json"
  4. "go-common/library/time"
  5. )
  6. // pool .
  7. const (
  8. PoolArc = int8(0)
  9. PoolUp = int8(1)
  10. PoolPorder = int8(2)
  11. PoolArticle = int8(3)
  12. PoolArcForbid = int8(4)
  13. PoolArcPGC = int8(5)
  14. FlowOpen = int8(0)
  15. FlowDelete = int8(1)
  16. FlowLogAdd = int8(1)
  17. FlowLogUpdate = int8(2)
  18. FlowLogDel = int8(3)
  19. FlowGroupNoChannel = int64(23)
  20. FlowGroupNoHot = int64(24)
  21. FlowGroupNoTimeline = int64(25)
  22. FlowGroupNoOtt = int64(26)
  23. FlowGroupNoRecommend = int64(27)
  24. FlowGroupNoRank = int64(28)
  25. )
  26. var (
  27. //FlowAttrMap archive submit with flow attr
  28. FlowAttrMap = map[string]int64{
  29. "nochannel": FlowGroupNoChannel,
  30. "nohot": FlowGroupNoHot,
  31. "notimeline": FlowGroupNoTimeline,
  32. "noott": FlowGroupNoOtt,
  33. "norecommend": FlowGroupNoRecommend,
  34. "norank": FlowGroupNoRank,
  35. }
  36. )
  37. // Flow info
  38. type Flow struct {
  39. ID int64 `json:"id"`
  40. Remark string `json:"remark"`
  41. Rank int64 `json:"rank"`
  42. Type int8 `json:"type"`
  43. Value json.RawMessage `json:"value"`
  44. CTime time.Time `json:"ctime"`
  45. }
  46. //FlowData Flow data
  47. type FlowData struct {
  48. ID int64 `json:"id"`
  49. Pool int8 `json:"pool"`
  50. OID int64 `json:"oid"`
  51. UID int64 `json:"uid"`
  52. Parent int8 `json:"parent"`
  53. State int8 `json:"state"`
  54. GroupID int64 `json:"group_id"`
  55. Remark string `json:"remark"`
  56. GroupValue []byte `json:"group_value"`
  57. CTime time.Time `json:"ctime"`
  58. MTime time.Time `json:"mtime"`
  59. }
  60. //FlowPagerData .
  61. type FlowPagerData struct {
  62. Items []*FlowData `json:"items"`
  63. Pager *Pager `json:"pager,omitempty"`
  64. }
  65. //Pager .
  66. type Pager struct {
  67. Num int64 `json:"num"`
  68. Size int64 `json:"size"`
  69. Total int64 `json:"total"`
  70. }