27 lines
810 B
Go
27 lines
810 B
Go
package handlers
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type BookshelfHandler struct {
|
|
ArticleHandler *ArticleHandler
|
|
BookshelfPublisherHandler *BookshelfPublisherHandler
|
|
BookHandler *BookHandler
|
|
AuthorHandler *AuthorHandler
|
|
ArticleAuthorHandler *ArticleAuthorHandler
|
|
BookAuthorHandler *BookAuthorHandler
|
|
}
|
|
|
|
func NewBookshelfHandler(db *gorm.DB) *BookshelfHandler {
|
|
bookshelfHandler := &BookshelfHandler{
|
|
ArticleHandler: NewArticleHandler(db),
|
|
BookshelfPublisherHandler: NewBookshelfPublisherHandler(db),
|
|
BookHandler: NewBookHandler(db),
|
|
AuthorHandler: NewAuthorHandler(db),
|
|
ArticleAuthorHandler: NewArticleAuthorHandler(db),
|
|
BookAuthorHandler: NewBookAuthorHandler(db),
|
|
}
|
|
return bookshelfHandler
|
|
}
|