255 lines
6 KiB
HTTP
255 lines
6 KiB
HTTP
POST http://localhost:8000/api/user/register
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"username": "neonxp",
|
||
"email": "i@neonxp.ru",
|
||
"password": "password",
|
||
"password2": "password"
|
||
}
|
||
|
||
###
|
||
|
||
GET http://localhost:8000/api/user
|
||
|
||
###
|
||
|
||
GET http://localhost:8000/api/games
|
||
Content-Type: application/json
|
||
|
||
###
|
||
|
||
POST http://localhost:8000/api/user/login
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"email": "i@neonxp.ru",
|
||
"password": "password"
|
||
}
|
||
|
||
###
|
||
|
||
POST http://localhost:8000/api/games
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"icon": "f343919a-b068-4d72-ade5-bbb84db0bec9",
|
||
"title": "Тестовая игра 7",
|
||
"description": "A paragraph with *emphasis* and **strong importance**.\n\n> A block quote with ~strikethrough~ and a URL: https://reactjs.org.\n\n* Lists\n* [ ] todo\n* [x] done\n\nA table:\n\n\n| a | b |\n| - | - |\n",
|
||
"type": "city",
|
||
"points": 500,
|
||
"tasks": [
|
||
{
|
||
"title": "Задание 1",
|
||
"text": "A paragraph with *emphasis* and **strong importance**.\n\n> A block quote with ~strikethrough~ and a URL: https://reactjs.org.\n\n* Lists\n* [ ] todo\n* [x] done\n\nA table:\n\n\n| a | b |\n| - | - |\n",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq1111"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 2",
|
||
"text": "Текст второго задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq2211"
|
||
},
|
||
{
|
||
"description": "2+",
|
||
"code": "nq2222"
|
||
}
|
||
],
|
||
"solutions": [
|
||
{
|
||
"text": "Помощь 1",
|
||
"after": 30
|
||
},
|
||
{
|
||
"text": "Помощь 2",
|
||
"after": 60
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"title": "Задание 3",
|
||
"text": "Текст третьего задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq3311"
|
||
},
|
||
{
|
||
"description": "2+",
|
||
"code": "nq3322"
|
||
},
|
||
{
|
||
"description": "3+",
|
||
"code": "nq3333"
|
||
}
|
||
],
|
||
"solutions": []
|
||
}
|
||
]
|
||
}
|
||
|
||
###
|
||
|
||
|
||
POST http://localhost:8000/api/games
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"title": "Тестовая игра 3",
|
||
"description": "Описание тестовой игры",
|
||
"type": "city",
|
||
"points": 500,
|
||
"tasks": [
|
||
{
|
||
"title": "Задание 1",
|
||
"text": "Текст первого задания.\n\n*Коды: `nq1111`*",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq1111"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 2",
|
||
"text": "Текст второго задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq2211"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 3",
|
||
"text": "Текст третьего задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq3311"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 4",
|
||
"text": "Текст 4 задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq4411"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 5",
|
||
"text": "Текст 5 задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq5511"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 6",
|
||
"text": "Текст 6 задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq6611"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 7",
|
||
"text": "Текст 7 задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq7711"
|
||
}
|
||
],
|
||
"solutions": []
|
||
},
|
||
{
|
||
"title": "Задание 8",
|
||
"text": "Текст 8 задания",
|
||
"codes": [
|
||
{
|
||
"description": "1+",
|
||
"code": "nq8811"
|
||
}
|
||
],
|
||
"solutions": []
|
||
}
|
||
]
|
||
}
|
||
|
||
###
|
||
|
||
GET http://localhost:8000/api/engine/2
|
||
|
||
###
|
||
|
||
POST http://localhost:8000/api/engine/2/code
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"code": "NQ1111"
|
||
}
|
||
###
|
||
|
||
POST http://localhost:8000/api/engine/2/code
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"code": "NQ2211"
|
||
}
|
||
###
|
||
|
||
POST http://localhost:8000/api/engine/2/code
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"code": "NQ2222"
|
||
}
|
||
###
|
||
|
||
POST http://localhost:8000/api/engine/2/code
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"code": "NQ3333"
|
||
}
|
||
|
||
|
||
###
|
||
|
||
POST http://localhost:8000/api/file/upload
|
||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
|
||
|
||
|
||
------WebKitFormBoundary7MA4YWxkTrZu0gW
|
||
Content-Disposition: form-data; name="file"; filename="icon.jpg"
|
||
Content-Type: image/jpg
|
||
|
||
< /home/neonxp/logo.jpg
|
||
------WebKitFormBoundary7MA4YWxkTrZu0gW--
|
||
|
||
###
|
||
|
||
GET http://localhost:8000/api/file/f343919a-b068-4d72-ade5-bbb84db0bec9
|