user package
This commit is contained in:
parent
f962cd8cd9
commit
f159014374
4 changed files with 84 additions and 0 deletions
26
internal/user/service.go
Normal file
26
internal/user/service.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue