2022-08-31 20:49:14 +00:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import "sprechstundentool/models"
|
|
|
|
|
|
|
|
// BaseHandler will hold everything that controller needs
|
|
|
|
type BaseHandler struct {
|
|
|
|
roomRepo models.RoomRepository
|
|
|
|
officeHourRepo models.OfficeHourRepository
|
|
|
|
courseRepo models.CourseRepository
|
|
|
|
tutorRepo models.TutorRepository
|
2022-09-05 15:55:08 +00:00
|
|
|
requestRepo models.RequestRepository
|
2022-08-31 20:49:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewBaseHandler returns a new BaseHandler
|
2022-09-05 15:55:08 +00:00
|
|
|
func NewBaseHandler(roomRepo models.RoomRepository, officeHourRepo models.OfficeHourRepository, courseRepo models.CourseRepository, tutorRepo models.TutorRepository, requestRepo models.RequestRepository) *BaseHandler {
|
|
|
|
return &BaseHandler{roomRepo, officeHourRepo, courseRepo, tutorRepo, requestRepo}
|
2022-08-31 20:49:14 +00:00
|
|
|
}
|