53 lines
856 B
Go
53 lines
856 B
Go
package client
|
|
|
|
import "git.andreafazzi.eu/andrea/probo/models"
|
|
|
|
type Question struct {
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
type Answer struct {
|
|
Text string `json:"text"`
|
|
Correct bool `json:"correct"`
|
|
}
|
|
|
|
type Quiz struct {
|
|
Question *Question `json:"question"`
|
|
Answers []*Answer `json:"answers"`
|
|
}
|
|
|
|
type BaseResponse struct {
|
|
Status string `json:"status"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type ReadAllQuizResponse struct {
|
|
BaseResponse
|
|
Content []*models.Quiz `json:"content"`
|
|
}
|
|
|
|
type CreateQuizResponse struct {
|
|
BaseResponse
|
|
Content *models.Quiz `json:"content"`
|
|
}
|
|
|
|
type UpdateQuizResponse struct {
|
|
BaseResponse
|
|
Content *models.Quiz `json:"content"`
|
|
}
|
|
|
|
type CreateQuestionRequest struct {
|
|
*Question
|
|
}
|
|
|
|
type CreateAnswerRequest struct {
|
|
*Answer
|
|
}
|
|
|
|
type CreateUpdateQuizRequest struct {
|
|
*Quiz
|
|
}
|
|
|
|
type DeleteQuizRequest struct {
|
|
ID string
|
|
}
|