From 94b435262ca05cedbf2d0b6962dd7f9b61355c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B8=D0=BD=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA=20?= =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=B8=D1=87?= Date: Tue, 1 Apr 2025 17:20:14 +0300 Subject: [PATCH] MSP-5186 appEnrich -> appEnricher --- service/token.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/service/token.go b/service/token.go index b43db48..29d78e3 100644 --- a/service/token.go +++ b/service/token.go @@ -13,7 +13,7 @@ type ApplicationTokenCreator interface { CreateApplicationToken() (string, error) } -type TokenAppEnricher interface { +type AppEnricher interface { EnrichWithTokens(ctx context.Context, apps []entity.Application) ([]*domain.ApplicationWithTokens, error) } @@ -32,7 +32,7 @@ type TokenTxRunner interface { type Token struct { jwt ApplicationTokenCreator - appEnrich TokenAppEnricher + appEnricher AppEnricher tx TokenTxRunner appRepo ApplicationRepo domainRepo DomainRepo @@ -42,7 +42,7 @@ type Token struct { func NewToken( jwtGenerate ApplicationTokenCreator, - appEnrich TokenAppEnricher, + appEnricher AppEnricher, tx TokenTxRunner, appRepo ApplicationRepo, domainRepo DomainRepo, @@ -50,7 +50,7 @@ func NewToken( tokenRepo TokenRepo, ) Token { return Token{ - appEnrich: appEnrich, + appEnricher: appEnricher, jwt: jwtGenerate, tx: tx, appRepo: appRepo, @@ -107,7 +107,7 @@ func (s Token) Create(ctx context.Context, req domain.TokenCreateRequest) (*doma return nil, errors.WithMessage(err, "token create transaction") } - arr, err := s.appEnrich.EnrichWithTokens(ctx, []entity.Application{*applicationEntity}) + arr, err := s.appEnricher.EnrichWithTokens(ctx, []entity.Application{*applicationEntity}) if err != nil { return nil, errors.WithMessage(err, "application enrich with tokens") } @@ -126,7 +126,7 @@ func (s Token) Revoke(ctx context.Context, req domain.TokenRevokeRequest) (*doma return nil, errors.WithMessage(err, "reboke tokens") } - res, err := s.appEnrich.EnrichWithTokens(ctx, []entity.Application{*app}) + res, err := s.appEnricher.EnrichWithTokens(ctx, []entity.Application{*app}) if err != nil { return nil, errors.WithMessage(err, "application enrich") }