admin.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package models
  2. import (
  3. "eta_gn/eta_task/global"
  4. )
  5. type Admin struct {
  6. AdminId int
  7. AdminName string `description:"系统用户名称"`
  8. RealName string `description:"系统用户姓名"`
  9. Password string `description:"密码"`
  10. Mobile string `description:"手机号"`
  11. RoleId int `description:"角色id"`
  12. RoleName string `description:"角色名称"`
  13. RoleTypeCode string `description:"角色编码"`
  14. DepartmentId int `description:"部门id"`
  15. GroupId int `description:"分组id"`
  16. Authority int `description:"管理权限,0:无,1:部门负责人,2:小组负责人"`
  17. Position string `description:"职位"`
  18. OpenId string `description:"弘则部门公众号的openid"`
  19. }
  20. func GetAdminByAdminId(adminId int) (item *Admin, err error) {
  21. sql := `SELECT * FROM admin WHERE admin_id=? `
  22. err = global.DmSQL["eta"].Raw(sql, adminId).Find(&item).Error
  23. return
  24. }
  25. type AdminView struct {
  26. AdminId int
  27. AdminName string `description:"系统用户名称"`
  28. RealName string `description:"系统用户姓名"`
  29. Password string `description:"密码"`
  30. Mobile string `description:"手机号"`
  31. RoleId int `description:"角色id"`
  32. RoleName string `description:"角色名称"`
  33. RoleTypeCode string `description:"角色编码"`
  34. DepartmentId int `description:"部门id"`
  35. GroupId int `description:"分组id"`
  36. GroupName string `description:"分组名称"`
  37. Authority int `description:"管理权限,0:无,1:部门负责人,2:小组负责人"`
  38. Position string `description:"职位"`
  39. }