22 lines
528 B
Go
22 lines
528 B
Go
package handlers
|
|
|
|
import (
|
|
"kontor-api-gin/internal/repository"
|
|
"kontor-api-gin/internal/service"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type WebAppHandler struct {
|
|
AuthHandler *AuthHandler
|
|
ComicHandler *ComicHandler
|
|
}
|
|
|
|
func NewWebAppHandler(db *gorm.DB, secret []byte) *WebAppHandler {
|
|
webapp := &WebAppHandler{
|
|
AuthHandler: &AuthHandler{Service: service.NewAuthService(repository.NewProfileRepository(db), secret)},
|
|
ComicHandler: &ComicHandler{Service: service.NewComicService(repository.NewComicRepository(db))},
|
|
}
|
|
return webapp
|
|
}
|