package dao import ( "applet/app/db/model" "xorm.io/xorm" ) type AdminDao interface { CreateAdminId() (admId int, err error) AdminDeleteBySession(session *xorm.Session, admId interface{}) (int64, error) GetAdmin(id int) (m *model.Admin, err error) GetAdminByUserName(userName string) (m *model.Admin, err error) GetAdminRolePermission(admId int) (list []*AdminRolePermission, total int64, err error) FindAdmin(username string, state, page, limit int) (list []model.Admin, total int64, err error) UpdateAdmin(m *model.Admin, columns ...string) (int64, error) AdminInsert(m *model.Admin) (int64, error) FindAdminRolePermissionGroup(admId int) (list []*AdminRolePermissionGroup, total int64, err error) } type AdminRolePermissionGroup struct { model.Admin `xorm:"extends"` model.AdminRole `xorm:"extends"` model.Role `xorm:"extends"` model.RolePermissionGroup `xorm:"extends"` model.PermissionGroup `xorm:"extends"` } func (AdminRolePermissionGroup) TableName() string { return "admin" } type AdminRolePermission struct { model.Admin `xorm:"extends"` model.AdminRole `xorm:"extends"` model.Role `xorm:"extends"` model.RolePermissionGroup `xorm:"extends"` model.PermissionGroup `xorm:"extends"` model.PermissionGroupPermission `xorm:"extends"` model.Permission `xorm:"extends"` } func (AdminRolePermission) TableName() string { return "admin" }