Tree steht
This commit is contained in:
@@ -23,7 +23,41 @@ func (s *PropertyTypeService) GetRootPropertyTypesGroups() ([]*models.Property_T
|
||||
var rootGroups []*models.Property_Types_Group
|
||||
var err error
|
||||
|
||||
rootGroups, err = s.property_Types_Groups_Repository.GetRootPropertyTypesGroups()
|
||||
rootGroupsTemp, err := s.property_Types_Groups_Repository.GetRootPropertyTypesGroups()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for i := range rootGroupsTemp {
|
||||
rootGroups = append(rootGroups, rootGroupsTemp[i])
|
||||
}
|
||||
log.Printf("Service Loaded %d root property types groups", len(rootGroups))
|
||||
return rootGroups, err
|
||||
return rootGroups, nil
|
||||
}
|
||||
|
||||
func (s *PropertyTypeService) GetPropertyTypesGroupWithDirectChildsById(id int) (*models.Property_Types_Group, error) {
|
||||
propertyTypesGroup, err := s.property_Types_Groups_Repository.GetPropertyTypesGroupWithDirectChildsById(id)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Printf("Service Loaded property types group with ID %d", propertyTypesGroup.Id)
|
||||
return propertyTypesGroup, nil
|
||||
}
|
||||
|
||||
func (s *PropertyTypeService) GetPropertyTypesGroupDirectChildGroupsById(id int) ([]*models.Property_Types_Group, error) {
|
||||
childGroups, err := s.property_Types_Groups_Repository.GetPropertyTypesGroupDirectChildGroupsById(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Printf("Service Loaded %d direct child property types groups for property types group with ID %d", len(childGroups), id)
|
||||
return childGroups, nil
|
||||
}
|
||||
|
||||
func (s *PropertyTypeService) GetPropertyTypesGroupPropertyTypesById(id int) ([]*models.Property_Type, error) {
|
||||
propertyTypes, err := s.property_Types_Groups_Repository.GetPropertyTypesGroupPropertyTypesById(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Printf("Service Loaded %d property types for property types group with ID %d", len(propertyTypes), id)
|
||||
return propertyTypes, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user