广告平台(总站长使用)
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

45 líneas
1.5 KiB

  1. package dao
  2. import (
  3. "applet/app/db/model"
  4. "xorm.io/xorm"
  5. )
  6. type AdminDao interface {
  7. CreateAdminId() (admId int, err error)
  8. AdminDeleteBySession(session *xorm.Session, admId interface{}) (int64, error)
  9. GetAdmin(id int) (m *model.Admin, err error)
  10. GetAdminByUserName(userName string) (m *model.Admin, err error)
  11. GetAdminRolePermission(admId int) (list []*AdminRolePermission, total int64, err error)
  12. FindAdmin(username string, state, page, limit int) (list []model.Admin, total int64, err error)
  13. UpdateAdmin(m *model.Admin, columns ...string) (int64, error)
  14. AdminInsert(m *model.Admin) (int64, error)
  15. FindAdminRolePermissionGroup(admId int) (list []*AdminRolePermissionGroup, total int64, err error)
  16. }
  17. type AdminRolePermissionGroup struct {
  18. model.Admin `xorm:"extends"`
  19. model.AdminRole `xorm:"extends"`
  20. model.Role `xorm:"extends"`
  21. model.RolePermissionGroup `xorm:"extends"`
  22. model.PermissionGroup `xorm:"extends"`
  23. }
  24. func (AdminRolePermissionGroup) TableName() string {
  25. return "admin"
  26. }
  27. type AdminRolePermission struct {
  28. model.Admin `xorm:"extends"`
  29. model.AdminRole `xorm:"extends"`
  30. model.Role `xorm:"extends"`
  31. model.RolePermissionGroup `xorm:"extends"`
  32. model.PermissionGroup `xorm:"extends"`
  33. model.PermissionGroupPermission `xorm:"extends"`
  34. model.Permission `xorm:"extends"`
  35. }
  36. func (AdminRolePermission) TableName() string {
  37. return "admin"
  38. }