add method GetUsers, and array type Users -> []User

This commit is contained in:
2026-01-08 20:49:28 +02:00
parent 4f2c213bc6
commit 0388df48f5
3 changed files with 17 additions and 0 deletions

View File

@@ -42,6 +42,13 @@ func (s *Service) Create(user *User) error {
return s.store.Create(user)
}
func (s *Service) GetUsers() (Users, error) {
if !s.isInitialized() {
return nil, fmt.Errorf("user service is not initialized")
}
return s.store.GetUsers()
}
func (s *Service) GetBy(by, value string) (*User, error) {
if !s.isInitialized() {
return nil, fmt.Errorf("user service is not initialized")