From 1e5faf9b609fa230d763bccdd8520441c5498a15 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 6 Apr 2025 10:04:22 +0300 Subject: Feat: add mixed exercsises --- internal/database/repos/main.go | 3 +-- internal/handlers/main.go | 2 +- internal/models/models.go | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'internal') diff --git a/internal/database/repos/main.go b/internal/database/repos/main.go index f6835c7..e49d303 100644 --- a/internal/database/repos/main.go +++ b/internal/database/repos/main.go @@ -2,12 +2,11 @@ package repos import ( "github.com/jmoiron/sqlx" - "demoon/internal/models" ) type FullRepo interface { DefaultsRepo - DBGetQuestion(id string) (*models.Question, error) + QuestionsRepo } type Provider struct { diff --git a/internal/handlers/main.go b/internal/handlers/main.go index b6ce093..34f37d9 100644 --- a/internal/handlers/main.go +++ b/internal/handlers/main.go @@ -171,7 +171,7 @@ func (h *Handlers) renderQuestion(w http.ResponseWriter, question *models.Questi *models.Question } - err = tmpl.ExecuteTemplate(w, "main", question) + err = tmpl.ExecuteTemplate(w, "question", question) if err != nil { h.log.Error("failed to render template", "error", err) } diff --git a/internal/models/models.go b/internal/models/models.go index 8e30a6c..7cef85e 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -15,4 +15,10 @@ type ( ExamID uint32 `db:"exam_id"` MixedID uint32 `db:"mixed_id"` } + MixedUbung struct { + ID uint32 `db:"MixedID"` + Name string `db:"MixedName"` + Status int `db:"MixedStatus"` + LevelID uint32 `db:"LevelID"` + } ) -- cgit v1.2.3