occupation.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. package academy
  2. //TableName get table name
  3. func (o *Occupation) TableName() string {
  4. return "academy_occupation"
  5. }
  6. //TableName get table name
  7. func (s *Skill) TableName() string {
  8. return "academy_skill"
  9. }
  10. //TableName get table name
  11. func (s *Software) TableName() string {
  12. return "academy_software"
  13. }
  14. //TableName get table name
  15. func (s *ArcSkill) TableName() string {
  16. return "academy_arc_skill"
  17. }
  18. //TableName get table name
  19. func (s *TagLink) TableName() string {
  20. return "academy_tag_link"
  21. }
  22. //Occupation for academy occupation.
  23. type Occupation struct {
  24. ID int64 `gorm:"column:id" form:"id" json:"id"`
  25. Rank int64 `gorm:"column:rank" form:"rank" json:"rank"`
  26. State int `gorm:"column:state" form:"state" json:"state"`
  27. Name string `gorm:"column:name" form:"name" json:"name"`
  28. Desc string `gorm:"column:desc" form:"desc" json:"desc"`
  29. Logo string `gorm:"column:logo" form:"logo" json:"logo"`
  30. MainStep string `gorm:"column:main_step" form:"main_step" json:"main_step"`
  31. MainSoftware string `gorm:"column:main_software" form:"main_software" json:"main_software"`
  32. CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
  33. MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
  34. Skill []*Skill `gorm:"-" form:"-" json:"skill"`
  35. Count int `gorm:"-" form:"-" json:"count"`
  36. }
  37. //Skill for academy skill.
  38. type Skill struct {
  39. ID int64 `gorm:"column:id" form:"id" json:"id"`
  40. OID int64 `gorm:"column:oid" form:"oid" json:"oid"`
  41. State int `gorm:"column:state" form:"state" json:"state"`
  42. Name string `gorm:"column:name" form:"name" json:"name"`
  43. Desc string `gorm:"column:desc" form:"desc" json:"desc"`
  44. CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
  45. MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
  46. Software []*Software `gorm:"-" form:"-" json:"software"`
  47. Count int `gorm:"-" form:"-" json:"count"`
  48. }
  49. //Software for academy software.
  50. type Software struct {
  51. ID int64 `gorm:"column:id" form:"id" json:"id"`
  52. SkID int64 `gorm:"column:skid" form:"skid" json:"skid"`
  53. State int `gorm:"column:state" form:"state" json:"state"`
  54. Name string `gorm:"column:name" form:"name" json:"name"`
  55. Desc string `gorm:"column:desc" form:"desc" json:"desc"`
  56. CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
  57. MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
  58. Count int `gorm:"-" form:"-" json:"count"`
  59. }
  60. //ArcSkill for academy archive relation to occupation & skill & software.
  61. type ArcSkill struct {
  62. ID int64 `gorm:"column:id" form:"id" json:"id"`
  63. AID int64 `gorm:"column:aid" form:"aid" json:"aid"`
  64. PID int64 `gorm:"column:pid" form:"pid" json:"pid"`
  65. SkID int64 `gorm:"column:skid" form:"skid" json:"skid"`
  66. SID int64 `gorm:"column:sid" form:"sid" json:"sid"`
  67. Type int `gorm:"column:type" form:"type" json:"type"`
  68. State int `gorm:"column:state" form:"state" json:"state"`
  69. CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
  70. MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
  71. Title string `gorm:"-" form:"title" json:"title"`
  72. Pic string `gorm:"-" form:"pic" json:"pic"`
  73. Pn int `gorm:"-" form:"pn" json:"-"`
  74. Ps int `gorm:"-" form:"ps" json:"-"`
  75. }
  76. //ArcSkills for archive skill list
  77. type ArcSkills struct {
  78. Pager *Pager `json:"pager"`
  79. Items []*ArcSkill `json:"items"`
  80. }
  81. //TagLink for academy h5 tag relation to web tags.
  82. type TagLink struct {
  83. ID int64 `gorm:"column:id" form:"id" json:"id"`
  84. TID int64 `gorm:"column:tid" form:"tid" json:"tid"`
  85. LinkID int64 `gorm:"column:link_id" form:"link_id" json:"link_id"`
  86. CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
  87. MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
  88. }
  89. //TableName get table name
  90. func (sk *SearchKeywords) TableName() string {
  91. return "academy_search_keywords"
  92. }
  93. //SearchKeywords for academy h5 search keywords.
  94. type SearchKeywords struct {
  95. ID int64 `gorm:"column:id" form:"id" json:"id"`
  96. Rank int64 `gorm:"column:rank" form:"rank" json:"rank"`
  97. ParentID int64 `gorm:"column:parent_id" form:"parent_id" json:"parent_id"`
  98. State int8 `gorm:"column:state" form:"state" json:"state"`
  99. Name string `gorm:"column:name" form:"name" json:"name"`
  100. Comment string `gorm:"column:comment" form:"comment" json:"comment"`
  101. CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
  102. MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
  103. Count int `gorm:"-" form:"-" json:"count,omitempty"`
  104. Children []*SearchKeywords `json:"children,omitempty"`
  105. }