probo/client/client.go

55 lines
904 B
Go
Raw Normal View History

2022-06-23 11:25:35 +02:00
package client
2022-06-24 18:56:06 +02:00
import "git.andreafazzi.eu/andrea/probo/models"
2022-06-23 11:25:35 +02:00
type Response struct {
Status string `json:"status"`
Content interface{} `json:"content"`
}
2022-06-28 13:49:35 +02:00
type Question struct {
Text string `json:"text"`
}
type Answer struct {
Text string
Correct bool
}
type Quiz struct {
Question *Question `json:"question"`
Answers []*Answer `json:"answers"`
}
2022-06-24 18:56:06 +02:00
type ReadAllQuizResponse struct {
2022-06-23 11:25:35 +02:00
Status string `json:"status"`
Content []*models.Quiz `json:"content"`
}
2022-06-24 18:56:06 +02:00
type CreateQuizResponse struct {
Status string `json:"status"`
Content *models.Quiz `json:"content"`
}
2022-06-28 13:49:35 +02:00
type UpdateQuizResponse struct {
Status string `json:"status"`
Content *models.Quiz `json:"content"`
}
2022-06-23 11:25:35 +02:00
type CreateQuestionRequest struct {
2022-06-28 13:49:35 +02:00
*Question
2022-06-23 11:25:35 +02:00
}
type CreateAnswerRequest struct {
2022-06-28 13:49:35 +02:00
*Answer
2022-06-23 11:25:35 +02:00
}
type CreateQuizRequest struct {
2022-06-28 13:49:35 +02:00
*Quiz
}
type UpdateQuizRequest struct {
ID string
*Quiz
2022-06-23 11:25:35 +02:00
}