1.0.2 • Published 7 years ago

quiz-chatbot-server v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

QA backend

查詢問題

如果提供 id,返回對應題號問題。 如果提供 user,則隨機回傳該使用者沒答過的問題。

GET /question?id=42
GET /question?user=root
{
    "time": "2017/7/16 下午 7:10:41",
    "author": "HexRabbit",
    "category": "常識",
    "question": "Google 於 1998 年使用的第一隻網頁爬蟲是用什麼語言寫出來的?",
    "answer": "A",
    "hint": "Python 很猛",
    "option": ["Python", "Java", "Ruby", "C"]
}

查詢使用者資訊

GET /user?user=root
{
  "user": "root",
  "questionStatus": [
    1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
	"point": 7
}

新增使用者

如果新使用者成功建立,會回傳和上面查詢一樣的結果, 否則回傳錯誤碼

POST /user
{"user": "root"}

回答問題

post 一份 json 到位置 /answer , user 是使用者名稱,id 是題號, answer 是答案。

POST /answer

{
  "user": "root",
  "id": 12,
  "answer": 0
}
1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago