group.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // Group model is the group view for several challanges
  6. type Group struct {
  7. ID int64 `json:"id" gorm:"column:id"`
  8. Oid int64 `json:"oid" gorm:"column:oid"`
  9. OidStr string `json:"oid_str" gorm:"-"`
  10. Business int8 `json:"business" gorm:"column:business"`
  11. Fid int64 `json:"fid" gorm:"column:fid"`
  12. Rid int8 `json:"rid" gorm:"column:rid"`
  13. Eid int64 `json:"eid" gorm:"eid"`
  14. EidStr string `json:"eid_str" gorm:"-"`
  15. State int8 `json:"state" gorm:"column:state"`
  16. Tid int64 `json:"tid" gorm:"column:tid"`
  17. FirstUserTid int64 `json:"first_user_tid" gorm:"-"`
  18. Note string `json:"note" gorm:"column:note"`
  19. Score int64 `json:"score" gorm:"column:score"`
  20. // Stat fields
  21. // this is a workround solution for calcuating appeals
  22. Count int32 `json:"count" gorm:"column:count"`
  23. Handling int32 `json:"handling" gorm:"column:handling"`
  24. CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
  25. MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
  26. LastTime xtime.Time `json:"last_time" gorm:"column:lasttime"`
  27. LastLog string `json:"last_log" gorm:"-"`
  28. BusinessObject *Business `json:"business_object,omitempty" gorm:"-"`
  29. // Tags related to Group
  30. Tag string `json:"tag" gorm:"-"`
  31. Round int8 `json:"round" gorm:"-"`
  32. ChallengeTags ChallTagSlice `json:"challenge_tags" gorm:"-"`
  33. Meta interface{} `json:"meta" gorm:"-"`
  34. MetaData interface{} `json:"meta_data" gorm:""`
  35. TypeID int64 `json:"type_id" gorm:"-"`
  36. LastProducer *Account `json:"last_producer" gorm:"-"`
  37. Defendant *Account `json:"defendant" gorm:"-"`
  38. }
  39. // GroupListPage is the model for group list result
  40. type GroupListPage struct {
  41. Items []*Group `json:"items"`
  42. Page *Page `json:"page"`
  43. }
  44. // GroupPendingCount .
  45. type GroupPendingCount struct {
  46. Total int `json:"total"`
  47. }
  48. // GroupMeta .
  49. type GroupMeta struct {
  50. Archive *Archive `json:"archive"`
  51. Object *Business `json:"object"`
  52. External interface{} `json:"external"`
  53. }
  54. // TableName is used to identify group table name in gorm
  55. func (Group) TableName() string {
  56. return "workflow_group"
  57. }