31 lines
950 B
Go
31 lines
950 B
Go
package initalize
|
|
|
|
import (
|
|
"fusenapi/service/repositories"
|
|
|
|
"github.com/aws/aws-sdk-go/aws/session"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Repositories struct {
|
|
ImageHandle repositories.ImageHandle
|
|
NewResource repositories.Resource
|
|
NewShoppingCart repositories.ShoppingCart
|
|
NewOrder repositories.Order
|
|
}
|
|
|
|
type NewAllRepositorieData struct {
|
|
GormDB *gorm.DB
|
|
BLMServiceUrl *string
|
|
AwsSession *session.Session
|
|
}
|
|
|
|
func NewAllRepositories(newData *NewAllRepositorieData) *Repositories {
|
|
return &Repositories{
|
|
ImageHandle: repositories.NewImageHandle(newData.GormDB, newData.BLMServiceUrl, newData.AwsSession),
|
|
NewShoppingCart: repositories.NewShoppingCart(newData.GormDB, newData.BLMServiceUrl, newData.AwsSession),
|
|
NewResource: repositories.NewResource(newData.GormDB, newData.BLMServiceUrl, newData.AwsSession),
|
|
NewOrder: repositories.NewOrder(newData.GormDB, newData.BLMServiceUrl, newData.AwsSession),
|
|
}
|
|
}
|