27 lines
410 B
Go
27 lines
410 B
Go
|
|
package user
|
||
|
|
|
||
|
|
import (
|
||
|
|
"errors"
|
||
|
|
"merch-api/pkg/utils"
|
||
|
|
)
|
||
|
|
|
||
|
|
type service struct {
|
||
|
|
repo Repository
|
||
|
|
utils utils.Utils
|
||
|
|
}
|
||
|
|
|
||
|
|
func newService(repo Repository, utils utils.Utils) *service {
|
||
|
|
return &service{
|
||
|
|
repo: repo,
|
||
|
|
utils: utils,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *service) GetUserId(userUuid string) (string, error) {
|
||
|
|
if userUuid == "" {
|
||
|
|
return "", errors.New("user uuid is empty")
|
||
|
|
}
|
||
|
|
|
||
|
|
return s.repo.getUserId(userUuid)
|
||
|
|
}
|