app-cloudep-permission-server/pkg/domain/repository/role.go

42 lines
1.1 KiB
Go
Raw Normal View History

2025-02-24 01:04:06 +00:00
package repository
import (
2025-02-26 15:29:00 +00:00
"context"
2025-02-24 01:04:06 +00:00
"code.30cm.net/digimon/app-cloudep-permission-server/pkg/domain/entity"
"code.30cm.net/digimon/app-cloudep-permission-server/pkg/domain/permission"
"go.mongodb.org/mongo-driver/mongo"
2025-02-24 01:04:06 +00:00
)
type RoleRepository interface {
List(ctx context.Context, param ListQuery) ([]*entity.Role, int64, error)
GetByID(ctx context.Context, id string) (*entity.Role, error)
GetByUID(ctx context.Context, uid string) (*entity.Role, error)
All(ctx context.Context, clientID *string) ([]*entity.Role, error)
Create(ctx context.Context, role *entity.Role) error
Update(ctx context.Context, data UpdateReq) error
Delete(ctx context.Context, id string) error
RoleIndex
2025-02-24 01:04:06 +00:00
}
type RoleIndex interface {
Index20250224UP(ctx context.Context) (*mongo.Cursor, error)
2025-02-24 01:04:06 +00:00
}
type ListQuery struct {
PageSize int64 // 必填
PageIndex int64 // 必填
ClientID *string
UID *string
Name *string
Status *permission.Status
2025-02-24 01:04:06 +00:00
}
type UpdateReq struct {
ID string
Name *string
UID *string
ClientID *string
Status *permission.Status
2025-02-24 01:04:06 +00:00
}