department.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package model
  2. import (
  3. "go-common/library/time"
  4. )
  5. // DepartCustom struct info of table user_department
  6. type DepartCustom struct {
  7. ID int64 `json:"id" gorm:"column:id"`
  8. Name string `json:"name" gorm:"column:name"`
  9. Status int `json:"-" gorm:"column:status"`
  10. Ctime time.Time `json:"-" gorm:"-"`
  11. Mtime time.Time `json:"-" gorm:"-"`
  12. }
  13. // RoleCustom .
  14. type RoleCustom struct {
  15. ID int64 `json:"id" gorm:"column:id"`
  16. Name string `json:"name" gorm:"column:name"`
  17. Type int64 `json:"-" gorm:"column:type"`
  18. Description string `json:"-" gorm:"column:description"`
  19. RuleID int64 `json:"-" gorm:"column:rule_id"`
  20. Data string `json:"-" gorm:"column:data"`
  21. Ctime time.Time `json:"-" gorm:"-"`
  22. Mtime time.Time `json:"-" gorm:"-"`
  23. }
  24. // UserCustom .
  25. type UserCustom struct {
  26. ID int64 `json:"id" gorm:"column:id"`
  27. Username string `json:"username" gorm:"column:username"`
  28. Nickname string `json:"nickname" gorm:"column:nickname"`
  29. Email string `json:"-" gorm:"column:email"`
  30. Phone string `json:"-" gorm:"column:phone"`
  31. DepartmentID int `json:"-" gorm:"column:department_id"`
  32. State int `json:"-" gorm:"column:state"`
  33. Ctime time.Time `json:"-" gorm:"-"`
  34. Mtime time.Time `json:"-" gorm:"-"`
  35. }
  36. // Department struct info of table user_department
  37. type Department struct {
  38. ID int64 `json:"id"`
  39. Name string `json:"name"`
  40. Status int `json:"status"`
  41. Ctime time.Time `json:"ctime"`
  42. Mtime time.Time `json:"mtime"`
  43. }
  44. // TableName return table name
  45. func (a Department) TableName() string {
  46. return "user_department"
  47. }