initial commit 2
This commit is contained in:
33
domain/service/profile.go
Normal file
33
domain/service/profile.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"bitbucket.org/nemt/nemt-portal-api/domain/entity"
|
||||
)
|
||||
|
||||
// userService is the domain service for user operations
|
||||
type profileService struct {
|
||||
svc *Service
|
||||
}
|
||||
|
||||
// newUserService returns an instance of userService
|
||||
func newProfileService(svc *Service) *profileService {
|
||||
return &profileService{
|
||||
svc: svc,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *profileService) GetAll() ([]entity.Profile, error) {
|
||||
return s.svc.db.Profile().GetAll()
|
||||
}
|
||||
|
||||
func (s *profileService) GetByKey(key string) (entity.Profile, error) {
|
||||
return s.svc.db.Profile().GetByKey(key)
|
||||
}
|
||||
|
||||
func (s *profileService) GetVisibles(visible bool) ([]entity.Profile, error) {
|
||||
return s.svc.db.Profile().GetVisibles(visible)
|
||||
}
|
||||
|
||||
func (s *profileService) GetByOrganizationType(organizationTypeID int64) ([]entity.Profile, error) {
|
||||
return s.svc.db.Profile().GetByOrganizationType(organizationTypeID)
|
||||
}
|
||||
Reference in New Issue
Block a user