fix
This commit is contained in:
@@ -45,6 +45,13 @@ type OAuthRepo interface {
|
||||
RevokeConsent(ctx context.Context, userID, clientID uuid.UUID, revokedBy *uuid.UUID) error
|
||||
}
|
||||
|
||||
type PositionRepo interface {
|
||||
GetUserPositions(ctx context.Context, userID uuid.UUID, locale string) ([]models.PositionLocalized, error)
|
||||
GetAllPositions(ctx context.Context, locale string) ([]models.PositionLocalized, error)
|
||||
UpsertPositionForLocale(ctx context.Context, code, locale, name string, description *string) error
|
||||
UserHasPosition(ctx context.Context, userID uuid.UUID, code string) (bool, error)
|
||||
}
|
||||
|
||||
type TokenConfig struct {
|
||||
AccessTTL time.Duration
|
||||
RefreshTTL time.Duration
|
||||
@@ -56,23 +63,26 @@ type ClientAuth struct {
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
users UserRepo
|
||||
oauth OAuthRepo
|
||||
redis *redis.Client
|
||||
tokens TokenConfig
|
||||
users UserRepo
|
||||
oauth OAuthRepo
|
||||
positions PositionRepo
|
||||
redis *redis.Client
|
||||
tokens TokenConfig
|
||||
}
|
||||
|
||||
func New(
|
||||
users UserRepo,
|
||||
oauth OAuthRepo,
|
||||
positions PositionRepo,
|
||||
rdb *redis.Client,
|
||||
tokenCfg TokenConfig,
|
||||
) *Service {
|
||||
return &Service{
|
||||
users: users,
|
||||
oauth: oauth,
|
||||
redis: rdb,
|
||||
tokens: tokenCfg,
|
||||
users: users,
|
||||
oauth: oauth,
|
||||
positions: positions,
|
||||
redis: rdb,
|
||||
tokens: tokenCfg,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user