-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.go
36 lines (29 loc) · 819 Bytes
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package service
import (
"github.com/artem-malko/auth-and-go/infrastructure/database"
"github.com/artem-malko/auth-and-go/services/identity"
"github.com/pkg/errors"
"github.com/artem-malko/auth-and-go/models"
"github.com/google/uuid"
)
type identityService struct {
identityRepository identity.Repository
}
func New(identityRepository identity.Repository) identity.Service {
return &identityService{
identityRepository: identityRepository,
}
}
func (s *identityService) GetIdentitiesByAccountID(
executor database.QueryExecutor,
accountID uuid.UUID,
) ([]*models.Identity, error) {
identities, err := s.identityRepository.GetIdentitiesByAccountID(
executor,
accountID,
)
if err != nil {
return nil, errors.Wrap(err, "identity service: GetIdentitiesByAccountID")
}
return identities, nil
}