client.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package client
  2. import "git.andreafazzi.eu/andrea/probo/models"
  3. type Question struct {
  4. Text string `json:"text"`
  5. }
  6. type Answer struct {
  7. Text string `json:"text"`
  8. Correct bool `json:"correct"`
  9. }
  10. type Quiz struct {
  11. Question *Question `json:"question"`
  12. Answers []*Answer `json:"answers"`
  13. }
  14. type Collection struct {
  15. Name string `json:"name"`
  16. Query string `json:"query"`
  17. }
  18. type Participant struct {
  19. Firstname string `json:"firstname"`
  20. Lastname string `json:"lastname"`
  21. Token uint `json:"token"`
  22. Attributes map[string]string `json:"attributes"`
  23. }
  24. type Exam struct {
  25. Name string `json:"name"`
  26. Description string `json:"description"`
  27. ParticipantID string `json:"participant_id"`
  28. CollectionID string `json:"collection_id"`
  29. }
  30. type BaseResponse struct {
  31. Status string `json:"status"`
  32. Message string `json:"message"`
  33. }
  34. type ReadAllQuizResponse struct {
  35. BaseResponse
  36. Content []*models.Quiz `json:"content"`
  37. }
  38. type CreateQuizResponse struct {
  39. BaseResponse
  40. Content *models.Quiz `json:"content"`
  41. }
  42. type UpdateQuizResponse struct {
  43. BaseResponse
  44. Content *models.Quiz `json:"content"`
  45. }
  46. type CreateQuestionRequest struct {
  47. *Question
  48. }
  49. type CreateAnswerRequest struct {
  50. *Answer
  51. }
  52. type CreateUpdateQuizRequest struct {
  53. *Quiz
  54. *models.Meta
  55. }
  56. type DeleteQuizRequest struct {
  57. ID string
  58. }
  59. type CreateUpdateCollectionRequest struct {
  60. *Collection
  61. }
  62. type DeleteCollectionRequest struct {
  63. ID string
  64. }
  65. type CreateUpdateExamRequest struct {
  66. *Exam
  67. }
  68. type DeleteExamRequest struct {
  69. ID string
  70. }
  71. type ReadExamByIDRequest struct {
  72. ID string
  73. }
  74. type CreateUpdateParticipantRequest struct {
  75. *Participant
  76. }
  77. type DeleteParticipantRequest struct {
  78. ID string
  79. }
  80. type ReadParticipantByIDRequest struct {
  81. ID string
  82. }