feat:完善项目信息

This commit is contained in:
henry
2022-01-06 22:02:09 +08:00
parent a92801b1ce
commit 657fdc5750
31 changed files with 177 additions and 612 deletions

View File

@ -1,23 +1,23 @@
package role
import (
"SciencesServer/app/api/admin/controller"
auth2 "SciencesServer/app/api/admin/controller/auth"
model3 "SciencesServer/app/api/admin/model"
model2 "SciencesServer/app/common/model"
"SciencesServer/app/service"
"SciencesServer/app/session"
"SciencesServer/serve/orm"
"SciencesServer/utils"
"gorm.io/gorm"
)
type Auth struct{ *controller.Platform }
type Auth struct{ *session.Admin }
type AuthHandle func(session *service.Session) *Auth
type AuthHandle func(session *session.Admin) *Auth
// List 角色权限列表
func (c *Auth) List(roleID uint64) ([]*auth2.TreeChecked, error) {
// Index 角色权限列表
func (c *Auth) Index(roleID uint64) ([]*auth2.TreeChecked, error) {
mSysAuth := model3.NewSysAuth()
out, err := mSysAuth.RoleAuth(c.TenantID, roleID)
@ -81,7 +81,7 @@ func (c *Auth) Bind(roleID uint64, authIDs []uint64) error {
}
func NewAuth() AuthHandle {
return func(session *service.Session) *Auth {
return &Auth{Platform: &controller.Platform{Session: session}}
return func(session *session.Admin) *Auth {
return &Auth{Admin: session}
}
}