广告平台(站长下代理使用)
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
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. }