dept.go 968 B

12345678910111213141516171819202122232425262728
  1. package model
  2. import "dy-admin/internal/pcmserver/common"
  3. type Dept struct {
  4. DeptID int `json:"deptId" gorm:"primaryKey;autoIncrement;comment:部门编码"`
  5. ParentId int `json:"parentId" gorm:"comment:上级部门"`
  6. DeptPath string `json:"deptPath" gorm:"size:255;comment:部门路径"`
  7. DeptName string `json:"deptName" gorm:"size:128;comment:部门名称"`
  8. Sort int `json:"sort" gorm:"size:4;comment:排序"`
  9. Leader string `json:"leader" gorm:"size:128;comment:负责人"`
  10. Phone string `json:"phone" gorm:"size:11comment:手机;"`
  11. Email string `json:"email" gorm:"size:64;comment:邮箱"`
  12. Status int `json:"status" gorm:"size:4;comment:状态"`
  13. Children []Dept `json:"children" gorm:"-"`
  14. common.ControlBy
  15. common.ModelTime
  16. }
  17. func (Dept) TableName() string {
  18. return "sys_dept"
  19. }
  20. func (Dept) AllowOrderField() map[string]struct{} {
  21. orderMap := make(map[string]struct{}, 6)
  22. orderMap["sort"] = struct{}{}
  23. return orderMap
  24. }