common/structs/storage/storage.go

26 lines
388 B
Go

package storage
import "gorm.io/gorm"
type Storage struct {
articleApi ArticleApi
providerApi ProviderApi
}
func NewStorage(db *gorm.DB) *Storage {
return &Storage{
articleApi: &articleApi{
db: db,
},
providerApi: NewProviderApi(db),
}
}
func (s *Storage) Article() ArticleApi {
return s.articleApi
}
func (s *Storage) Provider() ProviderApi {
return s.providerApi
}