diff --git a/internal/user/service.go b/internal/user/service.go index 068f21c..daa9c03 100644 --- a/internal/user/service.go +++ b/internal/user/service.go @@ -6,7 +6,7 @@ type Service struct { store UserCRUD } -func NewService(store UserCRUD) (UserCRUD, error) { +func NewService(store UserCRUD) (*Service, error) { if store == nil { return nil, fmt.Errorf("store is nil") } @@ -19,12 +19,8 @@ func (s *Service) Create(user *User) error { return s.store.Create(user) } -func (s *Service) GetByID(id int64) (*User, error) { - return s.store.GetByID(id) -} - -func (s *Service) GetByUsername(username string) (*User, error) { - return s.store.GetByUsername(username) +func (s *Service) GetBy(by, value string) (*User, error) { + return s.store.GetBy(by, value) } func (s *Service) Update(user *User) error {