https://hidden-crag-31172.herokuapp.com/
- 取得某使用者資料
- 修改某使用者資料
- 取得 全部課綱
- 取得 某個課綱
- 新增 課綱
- 修改 某課綱
- 刪除 某課綱
- 取得全部 課程單元
- 新增某 課程單元
- 修改某 課程單元
- 刪除某 課程單元
- 取得 課程單元 留言列表
- 修改 課程單元 留言
- 刪除 課程單元 留言
- 取得 平均分數(簡評)
- 取得 課程單元 評價(抱怨,討論,好評)
- 新增 課程單元 評價(抱怨,討論,好評)
- 取得 個人筆記 所有筆記內容
- 修改 個人筆記 選定筆記內容
- 刪除 個人筆記 選定筆記內容
- 完成的課綱
- 完成課程
- 未完成的課綱
- 未完成的課程
Route | HTTP Verb | Description |
---|---|---|
/auth/signin | POST | 使用者驗證 登入 |
/auth/signup | POST | 使用者 註冊 |
/info | GET | 取得某使用者資料 |
/users/:userId | PUT | 修改某使用者資料 |
/courses | POST | 取得全部課綱 |
/courses/:courseId | GET | 取得 某個課綱 |
/courses/:courseId | PUT | 修改 某個課綱 |
/courses/:courseId | DELETE | 刪除 某課綱 |
/courses/:courseId/lessons | GET | 取得全部 課程單元 |
/courses/:courseId/lessons | POST | 新增某 課程單元 |
/courses/:courseId/lessons/:lessonId | PUT | 修改 某課綱 某一"課程單元"資料 |
/courses/:courseId/lessons/:lessonId | DELETE | 刪除 某課程單元 |
/courses/:courseId/complete | GET | 完成的課綱 |
/courses/:courseId/learning | GET | 學習中的課綱 |
/complete | GET | 取得某使用者完成的課綱 |
/learning | GET | 取得某使用者學習中的課綱 |
{
"_id": (string),
"googleid": (string),
"name": (string),
"username": (string),
"password": (string),
"position": (string),
"gender": (string f, m, o),
"email": (string),
"picaddr":(string),
"education": (string),
"introduction": (string),
"role": (string),
"status": {
complete: {
courseid: [ c_id ],
lessonid: [ cls_id ]
},
learning: {
courseid: [ c_id ],
lessonid: [ cls_id ]
}
},
"timestamp": '2017-06-16T06:25:08+00:00'
}
{
"_id": (string),
"c_name": (string),
"c_img": (string),
"c_video"{
"v_id" : (string),
"v_name" : (string),
"v_url" : (string)
},
"c_brief": (String),
"c_teacher": (string),
"c_college": (string),
"c_department": (string),
"c_classes": [{
"_id": (string),
"cls_name": (string),
"cls_content": (string),
"cls_url": (string),
"cls_img": (string),
"cls_comment": [{
"uid": (string),
"content": (string)
}],
"cls_timestamp": ''
}],
"c_timestamp": '2017-06-16T06:25:08+00:00'
}
{
"_id": 1,
"c_name": Software Engineering,
"c_img": https:XXXXXXX.jpg,
"c_video"{
"v_id" : 1,
"v_name" : 'What is SE',
"v_url" : 'https://youtubeXXXXX.com'
},
"c_brief": 'Software Engineering is the application of engineering to the development of software in a systematic method.',
"c_teacher": 'Jian Hung Chen',
"c_college": 'NCNU',
"c_department": 'Information Management',
"c_classes": [{
"_id": 1,
"cls_number": 1,
"cls_name": 'SE class 1',
"cls_content": 'Introduction of SE',
"cls_url": 'https://youtubeDXXXXXXXX.com',
"cls_img": 'https://WEFWEFEW.jpg'
"cls_timestamp": '2017.156165XXXXXXXX'
},
{
"_id": 2,
"cls_number": 2,
"cls_name": 'SE class 2',
"cls_content": 'Implement of SE',
"cls_url": 'https://youtubeDXXXXXXXX.com',
"cls_img": 'https://WEFWEFEW.jpg',
"cls_timestamp": '2017.156165XXXXXXXX'
}],
"c_timestamp": '2017-06-16T06:25:08+00:00'
}
catalog:note,rating
{
"_id": (string),
"catalog" (string),
"author": (string),
"course": (string),
"lesson": (string),
"content": (string),
"score": (number)
}
POST /auth/signin
{
"username": (string),
"password": (string)
}
200 (ok)
jeson object{message: "signing successfully"}
500 (err)
jeson object{message: "username or password error"}
POST /auth/signup
{
"username": "",
"password": "",
"gender": "",
"email":"",
"picadder": "",
"education": "",
"introduction": ""
}
200 (ok)
jeson object{message: "signup successfully"}
500 (err)
jeson object{message: "username or password error"}
GET /info
none
-
200(OK)
user object{ "uid": (string), "googleid": (string), "name": (string), "username": (string), "password": (string), "position": (string), "gender": (string f, m, o), "email": (string), "picaddr": (string), "education": (string), "introduction": (string), "role": (string), "status": { complete: { courseid: [ c_id ], lessonid: [ cls_id ] }, learning: { courseid: [ c_id ], lessonid: [ cls_id ] } }, "timestamp": '2017-06-16T06:25:08+00:00' }
PUT /users/:useId
{
"name": "Tomato",
"password": "12345678",
"position": (string),
"gender": (string f, m, o),
"email": (string),
"picaddr": (string),
"education": (string),
"introduction": (string)
}
200(OK)
user object500(err)
jeson object{message: "Could not update user with id 'user_id' "}
GET /courses
none
200(OK)
Courses object array500(err)
jeson object{"message" "Some error"}
GET /courses/:courseId
none
200(OK)
Courses object{ "c_id": (string), "c_name": (string), "c_img": (string), "c_video"{ "v_id" : (string), "v_name" : (string), "v_url" : (string) }, "c_brief": (String), "c_teacher": (string), "c_college": (string), "c_department": (string), "c_classes": [{ "cls_id": (string), "cls_name": (string), "cls_content": (string), "cls_url": (string), "cls_img": (string), "cls_comment": [{ "uid": (string), "content": (string) }], "cls_timestamp": '' }], "c_timestamp": '2017-06-16T06:25:08+00:00' }
500(err)
jeson object{"message" "Some error"}
PUT /courses/:courseId
{
"c_name": (string),
"c_img": (string),
"c_video"{
"v_name" : (string),
"v_url" : (string)
},
"c_brief": (String),
"c_teacher": (string),
"c_college": (string),
"c_department": (string)
}
200(OK)
Courses object500(err)
jeson bject{"message":"Could not update course with userId}
DELETE /courses/:courseId
none
-
200(OK)
jeson object{message: "User deleted successfully!"}
-
500(err)
jeson object{"message":"Could not delete course with userId "}
GET /courses/:courseId/lessons
none
-
200(OK)
lessons Array[{ "cls_id": (string), "cls_name": (string), "cls_content": (string), "cls_url": (string), "cls_img": (string), "cls_comment": [{ "uid": (string), "content": (string) }] } ...]
-
500(err)
jeson object{message: "Some error"}
POST /courses/:courseId/lessons
none
-
200(OK)
lessons object{ cls_name : (String), cls_content : (String), cls_url : (String), cls_img : (String) }
-
500(err)
jeson object{message: "Could not creat lesson with courseID" }
PUT /courses/:courseId/lessons/:lessonId
{
cls_name : (String),
cls_content : (String),
cls_url : (String),
cls_img : (String)
}
200(OK)
lesson object500(OK)
jeson object{message: "Could not update lesson with lessonId"}
DELETE /courses/:courseId/lessons/:lessonId
none
200(OK)
jeson object{message: "User deleted successfully!"}
500(OK)
jeson object{message: "Could not update lesson with lessonId"}
GET /courses/:courseId/complete
none
200(OK)
jeson object{message: "completed Course" }
500(OK)
jeson object{message: "Could not save complete course with courseId"}
GET /courses/:courseId/learning
none
200(OK)
jeson object{message: "learning Course" }
500(OK)
jeson object{message: "Could not save learning course with courseId"}
GET complete
none
200(OK)
complete Arraycomplete: [{ "c_id": (string), ... ... ... ... ... }...]
500(err)
jeson object{message: "Can't find complete a Course"}
GET learning
none
200(OK)
complete Arraylearning: [{ "c_id": (string), ... ... ... ... ... }...]
500(err)
jeson object{message: "Can't find learning a Course"}
GET courses/:coursesId/notes
none
200(OK)
note object{ "score": avg_score }
500(err)
jeson object{message: "Can't find Courses note"}
GET /courses/:coursesId/lessons/:lessonsId/notes/goodrating
GET /courses/:coursesId/lessons/:lessonsId/notes/badrating
GET /courses/:coursesId/lessons/:lessonsId/notes/comment
none
200(OK)
goodrating arraybadrating array[{ "_id": (string), "catalog":"goodrating", "author": User_id, "lesson": lesson_id, "content": (string), "score": (0~5) }]
comment array[{ "_id": (string), "catalog": "badrating", "author": User_id, "lesson": lesson_id, "content": (string), "score": (0~5) }]
[{ "_id": (string), "catalog": "comment", "author": User_id, "lesson": lesson_id, "content": (string), }]
500(err)
jeson object{message: "Can't find Courses note"}
POST /courses/:coursesId/lessons/:lessonsId/notes
goodrating object
{
"_id": (string),
"catalog":"goodrating",
"author": User_id,
"course": cuurse_id,
"lesson": lesson_id,
"content": (string),
"score": (0~5)
}
badrating object
{
"_id": (string),
"catalog": "badrating",
"author": User_id,
"course": cuurse_id,
"lesson": lesson_id,
"content": (string),
"score": (0~5)
}
comment object
{
"_id": (string),
"catalog": "comment",
"author": User_id,
"course": cuurse_id,
"lesson": lesson_id,
"content": (string),
}
-
200(OK)
note object -
500(err)
jeson object{message: "Some error"}
DELETE lessons/:lessonsId/notes
none
200(OK)
note object{message: " Deleted successfully!"}
500(err)
jeson object{message: "Could not delete notes with noteId"}