2021-06-07 17:22:07 +08:00
|
|
|
|
package repository
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
2022-06-02 17:41:11 +08:00
|
|
|
|
"mayfly-go/internal/sys/domain/entity"
|
|
|
|
|
|
"mayfly-go/pkg/model"
|
2021-06-07 17:22:07 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type Role interface {
|
2023-06-01 12:31:32 +08:00
|
|
|
|
GetPageList(condition *entity.Role, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult
|
2021-06-07 17:22:07 +08:00
|
|
|
|
|
|
|
|
|
|
Delete(id uint64)
|
|
|
|
|
|
|
|
|
|
|
|
// 获取角色拥有的资源id数组,从role_resource表获取
|
|
|
|
|
|
GetRoleResourceIds(roleId uint64) []uint64
|
|
|
|
|
|
|
2023-06-01 12:31:32 +08:00
|
|
|
|
GetRoleResources(roleId uint64, toEntity any)
|
2021-06-07 17:22:07 +08:00
|
|
|
|
|
|
|
|
|
|
SaveRoleResource(rr *entity.RoleResource)
|
|
|
|
|
|
|
|
|
|
|
|
DeleteRoleResource(roleId uint64, resourceId uint64)
|
|
|
|
|
|
|
|
|
|
|
|
// 获取账号拥有的角色id数组,从account_role表获取
|
|
|
|
|
|
GetAccountRoleIds(accountId uint64) []uint64
|
|
|
|
|
|
|
|
|
|
|
|
SaveAccountRole(ar *entity.AccountRole)
|
|
|
|
|
|
|
|
|
|
|
|
DeleteAccountRole(accountId, roleId uint64)
|
|
|
|
|
|
|
|
|
|
|
|
// 获取账号角色信息列表
|
2023-06-01 12:31:32 +08:00
|
|
|
|
GetAccountRoles(accountId uint64, toEntity any)
|
2021-06-07 17:22:07 +08:00
|
|
|
|
}
|