2023-08-14 09:56:06 +00:00
|
|
|
package initalize
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fusenapi/service/repositories"
|
2023-09-28 09:53:41 +00:00
|
|
|
"fusenapi/utils/queue"
|
2023-08-14 09:56:06 +00:00
|
|
|
|
|
|
|
"github.com/aws/aws-sdk-go/aws/session"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Repositories struct {
|
2023-09-20 07:21:42 +00:00
|
|
|
ImageHandle repositories.ImageHandle
|
|
|
|
NewResource repositories.Resource
|
|
|
|
NewShoppingCart repositories.ShoppingCart
|
2023-09-20 07:28:57 +00:00
|
|
|
NewOrder repositories.Order
|
2023-08-14 09:56:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type NewAllRepositorieData struct {
|
2023-10-10 09:17:28 +00:00
|
|
|
GormDB *gorm.DB
|
|
|
|
BLMServiceUrls []string
|
|
|
|
AwsSession *session.Session
|
|
|
|
DelayQueue *queue.DelayMessage
|
2023-08-14 09:56:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewAllRepositories(newData *NewAllRepositorieData) *Repositories {
|
|
|
|
return &Repositories{
|
2023-10-10 09:17:28 +00:00
|
|
|
ImageHandle: repositories.NewImageHandle(newData.GormDB, newData.BLMServiceUrls, newData.AwsSession),
|
|
|
|
NewShoppingCart: repositories.NewShoppingCart(newData.GormDB, newData.BLMServiceUrls, newData.AwsSession),
|
|
|
|
NewResource: repositories.NewResource(newData.GormDB, newData.BLMServiceUrls, newData.AwsSession),
|
|
|
|
NewOrder: repositories.NewOrder(newData.GormDB, newData.AwsSession, newData.DelayQueue),
|
2023-08-14 09:56:06 +00:00
|
|
|
}
|
|
|
|
}
|