user package

This commit is contained in:
nquidox 2026-03-02 17:29:43 +03:00
parent f962cd8cd9
commit f159014374
4 changed files with 84 additions and 0 deletions

26
internal/user/service.go Normal file
View 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)
}