29 lines
895 B
Go
29 lines
895 B
Go
|
package repository
|
||
|
|
||
|
import (
|
||
|
"backend/pkg/permission/domain/entity"
|
||
|
"context"
|
||
|
)
|
||
|
|
||
|
// UserRoleRepository 用戶角色倉庫介面
|
||
|
type UserRoleRepository interface {
|
||
|
Create(ctx context.Context, userRole *entity.UserRole) error
|
||
|
GetByID(ctx context.Context, id string) (*entity.UserRole, error)
|
||
|
GetByUserAndRole(ctx context.Context, uid, roleUID string) (*entity.UserRole, error)
|
||
|
Update(ctx context.Context, id string, userRole *entity.UserRole) error
|
||
|
Delete(ctx context.Context, id string) error
|
||
|
List(ctx context.Context, filter UserRoleFilter) ([]*entity.UserRole, error)
|
||
|
GetUserRolesByUID(ctx context.Context, uid string) ([]*entity.UserRole, error)
|
||
|
DeleteByUserAndRole(ctx context.Context, uid, roleUID string) error
|
||
|
}
|
||
|
|
||
|
// UserRoleFilter 用戶角色查詢過濾器
|
||
|
type UserRoleFilter struct {
|
||
|
Brand string
|
||
|
UID string
|
||
|
RoleUID string
|
||
|
Status *int
|
||
|
Limit int
|
||
|
Skip int
|
||
|
}
|