Add hurl test and logseq plugin
This commit is contained in:
parent
db9a907d06
commit
8fa1b803b0
4 changed files with 39 additions and 0 deletions
27
client/client.go
Normal file
27
client/client.go
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package client
|
||||||
|
|
||||||
|
import "git.andreafazzi.eu/andrea/testhub/models"
|
||||||
|
|
||||||
|
type Response struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
Content interface{} `json:"content"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type QuizReadAllResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
Content []*models.Quiz `json:"content"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateQuestionRequest struct {
|
||||||
|
Text string `json:"text"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateAnswerRequest struct {
|
||||||
|
Text string
|
||||||
|
Correct bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateQuizRequest struct {
|
||||||
|
Question *CreateQuestionRequest `json:"question"`
|
||||||
|
Answers []*CreateAnswerRequest `json:"answers"`
|
||||||
|
}
|
1
misc/logseq
Submodule
1
misc/logseq
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit c4d136df36ed12f61766d587a749117b8d7b8093
|
10
tests/hurl/create_new_quiz.hurl
Normal file
10
tests/hurl/create_new_quiz.hurl
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
POST http://localhost:3000/quizzes
|
||||||
|
{
|
||||||
|
"question": {"text": "Text of Question 1"},
|
||||||
|
"answers": [
|
||||||
|
{"text": "Text of the answer 1", "correct": true},
|
||||||
|
{"text": "Text of the answer 2"},
|
||||||
|
{"text": "Text of the answer 3"},
|
||||||
|
{"text": "Text of the answer 4"}
|
||||||
|
]
|
||||||
|
}
|
1
tests/hurl/read_all_quiz.hurl
Normal file
1
tests/hurl/read_all_quiz.hurl
Normal file
|
@ -0,0 +1 @@
|
||||||
|
GET http://localhost:3000/quizzes
|
Loading…
Reference in a new issue