admin: Use gin-gonic as router
This commit is contained in:
parent
83468ad723
commit
8b3fbdb64a
32 changed files with 2748 additions and 1598 deletions
|
|
@ -46,6 +46,17 @@ func GetHint(id int64) (*EHint, error) {
|
|||
return h, nil
|
||||
}
|
||||
|
||||
// GetHint retrieves the hint with the given id.
|
||||
func (e *Exercice) GetHint(id int64) (*EHint, error) {
|
||||
h := &EHint{}
|
||||
if err := DBQueryRow("SELECT id_hint, id_exercice, title, content, cost FROM exercice_hints WHERE id_hint = ? AND id_exercice = ?", id, e.Id).Scan(&h.Id, &h.IdExercice, &h.Title, &h.Content, &h.Cost); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
treatHintContent(h)
|
||||
|
||||
return h, nil
|
||||
}
|
||||
|
||||
// GetHintByTitle retrieves the hint with the given id.
|
||||
func (e *Exercice) GetHintByTitle(id int64) (*EHint, error) {
|
||||
h := &EHint{}
|
||||
|
|
|
|||
Reference in a new issue