add method GetUsers, and array type Users -> []User
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user