forked from mirrors/homebox
refactor: repositories (#28)
* cleanup unnecessary mocks * refactor document storage location * remove unused function * move ownership to document types to repo package * move types and mappers to repo package * refactor sets to own package
This commit is contained in:
parent
2e82398e5c
commit
343290a55a
79 changed files with 3169 additions and 3160 deletions
|
@ -4,29 +4,23 @@ import "github.com/hay-kot/homebox/backend/internal/repo"
|
|||
|
||||
type AllServices struct {
|
||||
User *UserService
|
||||
Admin *AdminService
|
||||
Location *LocationService
|
||||
Labels *LabelService
|
||||
Items *ItemService
|
||||
}
|
||||
|
||||
func NewServices(repos *repo.AllRepos, root string) *AllServices {
|
||||
func NewServices(repos *repo.AllRepos) *AllServices {
|
||||
if repos == nil {
|
||||
panic("repos cannot be nil")
|
||||
}
|
||||
if root == "" {
|
||||
panic("root cannot be empty")
|
||||
}
|
||||
|
||||
return &AllServices{
|
||||
User: &UserService{repos},
|
||||
Admin: &AdminService{repos},
|
||||
Location: &LocationService{repos},
|
||||
Labels: &LabelService{repos},
|
||||
Items: &ItemService{
|
||||
repo: repos,
|
||||
filepath: root,
|
||||
at: attachmentTokens{},
|
||||
repo: repos,
|
||||
at: attachmentTokens{},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue