backend/pkg/permission/domain/repository/role.go

29 lines
931 B
Go

package repository
import (
"backend/pkg/permission/domain/entity"
"context"
mongodriver "go.mongodb.org/mongo-driver/v2/mongo"
)
// RoleRepository 角色倉庫介面
type RoleRepository interface {
Create(ctx context.Context, role *entity.Role) error
GetByID(ctx context.Context, id string) (*entity.Role, error)
GetByUID(ctx context.Context, uid string) (*entity.Role, error)
GetByClientAndName(ctx context.Context, clientID, name string) (*entity.Role, error)
Update(ctx context.Context, id string, role *entity.Role) error
Delete(ctx context.Context, id string) error
List(ctx context.Context, filter RoleFilter) ([]*entity.Role, error)
GetRolesByClientID(ctx context.Context, clientID string) ([]*entity.Role, error)
Index20241226001UP(ctx context.Context) (*mongodriver.Cursor, error)
}
// RoleFilter 角色查詢過濾器
type RoleFilter struct {
ClientID string
Status *int
Limit int
Skip int
}