Replaced repositories.Bundle with a database interface.
the build was successful

This commit is contained in:
2019-06-16 11:39:33 +02:00
parent 021f67ea4b
commit f6ad0602c2
6 changed files with 73 additions and 35 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
package services
import (
"git.aiterp.net/rpdata/api/repositories"
"git.aiterp.net/rpdata/api/database"
"git.aiterp.net/rpdata/api/services/loaders"
)
@@ -13,16 +13,16 @@ type Bundle struct {
}
// NewBundle creates a new bundle.
func NewBundle(repos *repositories.Bundle) *Bundle {
func NewBundle(db database.Database) *Bundle {
bundle := &Bundle{}
bundle.Changes = &ChangeService{
changes: repos.Changes,
changes: db.Changes(),
}
bundle.Tags = &TagService{tags: repos.Tags}
bundle.Tags = &TagService{tags: db.Tags()}
bundle.Characters = &CharacterService{
characters: repos.Characters,
loader: loaders.CharacterLoaderFromRepository(repos.Characters),
characters: db.Characters(),
loader: loaders.CharacterLoaderFromRepository(db.Characters()),
changeService: bundle.Changes,
}