26 lines
779 B
Go
26 lines
779 B
Go
package controllers
|
|
|
|
import (
|
|
"officeHours/config"
|
|
"officeHours/models"
|
|
)
|
|
|
|
// BaseHandler will hold everything that controller needs
|
|
type BaseHandler struct {
|
|
roomRepo models.RoomRepository
|
|
officeHourRepo models.OfficeHourRepository
|
|
courseRepo models.CourseRepository
|
|
tutorRepo models.TutorRepository
|
|
requestRepo models.RequestRepository
|
|
config config.Config
|
|
}
|
|
|
|
// NewBaseHandler returns a new BaseHandler
|
|
func NewBaseHandler(roomRepo models.RoomRepository,
|
|
officeHourRepo models.OfficeHourRepository,
|
|
courseRepo models.CourseRepository,
|
|
tutorRepo models.TutorRepository,
|
|
requestRepo models.RequestRepository,
|
|
config config.Config) *BaseHandler {
|
|
return &BaseHandler{roomRepo, officeHourRepo, courseRepo, tutorRepo, requestRepo, config}
|
|
}
|