This commit is contained in:
parent
c7c67a641e
commit
081267a662
3 changed files with 57 additions and 8 deletions
|
|
@ -3,18 +3,21 @@ package user
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"merch-api/internal/common"
|
||||
"merch-api/pkg/utils"
|
||||
)
|
||||
|
||||
type service struct {
|
||||
repo Repository
|
||||
utils utils.Utils
|
||||
repo Repository
|
||||
utils utils.Utils
|
||||
authDP common.AuthDataProvider
|
||||
}
|
||||
|
||||
func newService(repo Repository, utils utils.Utils) *service {
|
||||
func newService(repo Repository, utils utils.Utils, adp common.AuthDataProvider) *service {
|
||||
return &service{
|
||||
repo: repo,
|
||||
utils: utils,
|
||||
repo: repo,
|
||||
utils: utils,
|
||||
authDP: adp,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -48,3 +51,11 @@ func (s *service) getUser(ctx context.Context, userUuid string) (*MeDTO, error)
|
|||
|
||||
return s.repo.getUser(ctx, userUuid)
|
||||
}
|
||||
|
||||
func (s *service) getPersonalData(ctx context.Context, userUuid string) (*common.PersonalDTO, error) {
|
||||
if userUuid == "" {
|
||||
return nil, errors.New("user uuid is empty")
|
||||
}
|
||||
|
||||
return s.authDP.GetPersonalData(ctx, userUuid)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue