probo/client/client.go

54 lines
856 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
2022-06-28 13:49:35 +02:00
type Question struct {
Text string `json:"text"`
}
type Answer struct {
2023-07-12 09:27:50 +02:00
Text string `json:"text"`
Correct bool `json:"correct"`
2022-06-28 13:49:35 +02:00
}
type Quiz struct {
Question *Question `json:"question"`
Answers []*Answer `json:"answers"`
}
2022-06-29 16:08:55 +02:00
type BaseResponse struct {
Status string `json:"status"`
Message string `json:"message"`
}
2022-06-24 18:56:06 +02:00
type ReadAllQuizResponse struct {
2022-06-29 16:08:55 +02:00
BaseResponse
2022-06-23 11:25:35 +02:00
Content []*models.Quiz `json:"content"`
}
2022-06-24 18:56:06 +02:00
type CreateQuizResponse struct {
2022-06-29 16:08:55 +02:00
BaseResponse
2022-06-24 18:56:06 +02:00
Content *models.Quiz `json:"content"`
}
2022-06-28 13:49:35 +02:00
type UpdateQuizResponse struct {
2022-06-29 16:08:55 +02:00
BaseResponse
2022-06-28 13:49:35 +02:00
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
}
2022-06-29 16:08:55 +02:00
type CreateUpdateQuizRequest struct {
2022-06-28 13:49:35 +02:00
*Quiz
2022-06-23 11:25:35 +02:00
}
2023-09-01 11:48:09 +02:00
type DeleteQuizRequest struct {
ID string
}