testhub/store/store.go

25 lines
470 B
Go
Raw Permalink Normal View History

2022-05-25 12:21:32 +02:00
package store
2022-05-25 18:09:54 +02:00
import (
"git.andreafazzi.eu/andrea/testhub/models"
)
2022-06-16 17:21:04 +02:00
type CreateQuestionRequest struct {
Text string `json:"text"`
}
type CreateAnswerRequest struct {
Text string
Correct bool
}
2022-06-17 16:02:58 +02:00
type CreateQuizRequest struct {
2022-06-16 17:21:04 +02:00
Question *CreateQuestionRequest `json:"question"`
Answers []*CreateAnswerRequest `json:"answers"`
}
2022-06-17 16:02:58 +02:00
type QuizHubCollectorStore interface {
ReadAllQuizzes() ([]*models.Quiz, error)
CreateQuiz(r *CreateQuizRequest) *models.Quiz
2022-05-25 12:21:32 +02:00
}