Files
mayfly-go/server/internal/sys/domain/repository/role.go
2024-04-28 23:45:57 +08:00

31 lines
803 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package repository
import (
"mayfly-go/internal/sys/domain/entity"
"mayfly-go/pkg/base"
"mayfly-go/pkg/model"
)
type Role interface {
base.Repo[*entity.Role]
GetPageList(condition *entity.RoleQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error)
ListByQuery(condition *entity.RoleQuery) ([]*entity.Role, error)
}
type AccountRole interface {
base.Repo[*entity.AccountRole]
GetPageList(condition *entity.RoleAccountQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error)
}
type RoleResource interface {
base.Repo[*entity.RoleResource]
// 获取角色拥有的资源id数组从role_resource表获取
GetRoleResourceIds(roleId uint64) []uint64
GetRoleResources(roleId uint64, toEntity any)
}