{"openapi":"3.0.0","servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/appdevhocmai/247_HOCMAI/1.0.0"},{"description":"Mô tả API cho dịch vụ hỏi đáp 247","url":"http://dev.hocmai.com.vn:3341/discuss247-api/api/app/v1"}],"info":{"description":"Mô tả API cho hỏi đáp 247.  Giao diện 7 - 8.11 trên figma","version":"1.0.0","title":"API chức năng hỏi đáp 247","contact":{"email":"you@your-company.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"user247","description":"API cho tính năng hỏi đáp 247"}],"paths":{"/lesson":{"get":{"tags":["user247"],"summary":"lấy danh bài giảng của khoá","description":"lấy danh bài giảng của khoá","operationId":"lessonList","parameters":[{"name":"course_id","in":"query","description":"mã khoá học","required":true,"style":"form","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"trả về danh sách bài giảng của khoá","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LessonItem"}}}}}}}},"/video":{"get":{"tags":["user247"],"summary":"lấy danh sách video của 1 bài giảng","description":"lấy danh sách video 1 của bài giảng","operationId":"videoList","parameters":[{"name":"lesson_id","in":"query","description":"mã bài giảng","required":true,"style":"form","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"trả về danh sách video của bài giảng","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VideoItem"}}}}}}}},"/post-question":{"post":{"tags":["user247"],"summary":"Đặt câu hỏi","description":"Đặt câu hỏi","operationId":"postQuestion","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_question"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/questionDetailItem"}}}},"400":{"description":"bad input parameter"}}}},"/questList":{"get":{"tags":["user247"],"summary":"lấy danh sách các câu hỏi 'câu hỏi lý thuyêt' của người dùng trong khoá","description":"lấy danh sách các câu hỏi 'câu hỏi lý thuyêt' của người dùng trong khoá","operationId":"questList","parameters":[{"name":"course_id","in":"query","description":"mã khoá học","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"số trang (mặc định 1)","required":false,"style":"form","explode":true,"schema":{"type":"integer"}},{"name":"limit","in":"query","description":"số câu hỏi trả về (mặc định 20 - tối đa 100)","required":false,"style":"form","explode":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"trả về danh sách 'câu hỏi lý thuyêt' của người dùng trong khoá","content":{"application/json":{"schema":{"$ref":"#/components/schemas/questItemList"}}}},"400":{"description":"bad API"}}}},"/quest-detail":{"get":{"tags":["user247"],"summary":"lấy chi tiết của 1 câu hỏi","description":"lấy chi tiết của 1 câu hỏi </br> thời gian trả lời/câu hỏi ở dạng unix timestamp </br> trạng thái đóng/mở trả lời dạng boolean","operationId":"quest-detail","parameters":[{"name":"course_id","in":"query","description":"id khóa học","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"question_id","in":"query","description":"id  câu hỏi của người dùng","required":true,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"số trang (mặc định 1)","required":false,"style":"form","explode":true,"schema":{"type":"integer"}},{"name":"limit","in":"query","description":"số reply trả về (mặc định 20 - tối đa 100)","required":false,"style":"form","explode":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"trả về chi tiết câu hỏi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/questionDetailItem"}}}}}}},"/post-reply":{"post":{"tags":["user247"],"summary":"Viết câu trả lời","description":"Viết câu trả lời","operationId":"postReply","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_reply"}}}},"responses":{"200":{"description":"Success"},"400":{"description":"bad input parameter"}}}},"/post-image":{"post":{"tags":["user247"],"summary":"Up lên ảnh","description":"Upload lên ảnh dạng base64 để sử dụng cho câu hỏi/reply","operationId":"postImage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_image"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_image_result"}}}},"400":{"description":"bad input parameter"}}}}},"components":{"schemas":{"LessonItem":{"required":["idLesson","name"],"type":"object","properties":{"idLesson":{"type":"integer","example":2},"name":{"type":"string","example":"Bài học về số tự nhiên chia hết cho 2"}}},"VideoItem":{"required":["idVideo","name"],"type":"object","properties":{"idVideo":{"type":"integer","example":2},"name":{"type":"string","example":"Bài học thứ nhất - lý thuyết suông"}}},"body_question":{"required":["user_id","course_id","lesson_id","video_id","content"],"type":"object","properties":{"user_id":{"type":"string","example":"4471566"},"course_id":{"type":"string","example":"2234"},"lesson_id":{"type":"string","example":"1234"},"video_id":{"type":"string","example":"4321"},"content":{"type":"string","example":"Favdjkasf jkdjfk sjkjo -fdjskf djsklfjklds fjkdslj"},"image":{"$ref":"#/components/schemas/body_image_result"}}},"postImageItem":{"type":"string","example":["logo_b_1200x630.png","logo_b_1200x960.png"]},"getImageItem":{"type":"string","example":["http://hocmai.vn/avt/logo_b_1200x630.png","http://hocmai.vn/avt/logo_b_1200x960.png"]},"questItemList":{"required":["questItem"],"type":"object","properties":{"questItem":{"type":"array","items":{"$ref":"#/components/schemas/questItem"}}}},"questItem":{"required":["quest_id","id_lesson","id_videos","avatar","fullname","time_ask","lessonName","videoName","content","numberReply","status_open","image"],"type":"object","properties":{"quest_id":{"type":"string","example":"1234"},"id_lesson":{"type":"string","example":"4321"},"id_video":{"type":"string","example":"2312"},"avatar":{"type":"string","example":"http://hocmai.vn/avatar/img1.jpg"},"fullname":{"type":"string","example":"Lê Hữu Hoàng"},"time_ask":{"type":"string","format":"date-time","example":"9/3/2020"},"lessonName":{"type":"string","example":"Bài giảng về sự tinh tú"},"videoName":{"type":"string","example":"Video của bài giảng về sự tinh tú"},"content":{"type":"string","example":"Bài này thật sự là quá khó! thầy cho em hỏi làm sao cái bánh to như cái xo0ng"},"numberReply":{"type":"integer","example":12},"image":{"$ref":"#/components/schemas/getImageItem"},"status_open":{"type":"boolean","example":true,"description":"true là mở cho tiếp tục comment"}}},"questionDetailItem":{"required":["question_info","reply"],"type":"object","properties":{"question_info":{"$ref":"#/components/schemas/questItem"},"reply":{"type":"array","items":{"$ref":"#/components/schemas/replyItem"}}}},"replyItem":{"required":["reply_id","id_lesson","avatar","fullname","time_reply","content"],"type":"object","properties":{"reply_id":{"type":"string","example":"1234"},"course_id":{"type":"string","example":"2213"},"id_lesson":{"type":"string","example":"4321"},"avatar":{"type":"string","example":"http://hocmai.vn/avatar/img1.jpg"},"fullname":{"type":"string","example":"Lê Hữu Hoàng"},"time_reply":{"type":"string","format":"date-time","example":"9/3/2020"},"content":{"type":"string","example":"Bài này thật sự là quá khó! thầy cho em hỏi là sao cái bánh to như cái xong"},"image":{"$ref":"#/components/schemas/getImageItem"}}},"body_reply":{"required":["quest_id","content"],"type":"object","properties":{"quest_id":{"type":"string","example":"1234"},"content":{"type":"string","example":"Favdjkasf jkdjfk sjkjo -fdjskf djsklfjklds fjkdslj"},"image":{"$ref":"#/components/schemas/body_image_result"}}},"body_image":{"type":"string","example":["logo_b_1200x630.png","logo_b_1200x960.png"]},"body_image_result":{"type":"string","example":["http://dev.hocmai.com.vn:3341/uploads/2652020/avatar23.png","http://dev.hocmai.com.vn:3341/uploads/2652020/avatar23.png"]}}}}