package handlers import ( "git.godopu.com/lab/landing_page/backend/internal/httpx" "git.godopu.com/lab/landing_page/backend/internal/repository" "github.com/gin-gonic/gin" ) type LecturesHandler struct { repo *repository.LecturesRepository } func NewLecturesHandler(repo *repository.LecturesRepository) *LecturesHandler { return &LecturesHandler{repo: repo} } func (h *LecturesHandler) GetSemesters(c *gin.Context) { semesters, err := h.repo.GetSemestersWithCourses(c.Request.Context()) if err != nil { httpx.InternalServerError(c, "Failed to retrieve semesters: "+err.Error()) return } httpx.OK(c, semesters) }