Skip to content

Latest commit

 

History

History
356 lines (285 loc) · 7.35 KB

README.md

File metadata and controls

356 lines (285 loc) · 7.35 KB

Milk Tea Mooc v0.1.0

The API Document of MilkTea online learning website

This Document is generated automatically by ApiDoc and ApiDoc-Markdown tool.


User

Sign up a new user by Unique Phone Number

Back to top

POST api/v1/pri/user/register

Parameters - Parameter

Name Type Description
userInfo json

the User's Information

Parameters examples

json - Request Example:

{
"phone": "123456",
"name": "testMilkTea",
"pwd": "123456"
}

Success response example

Success response example - Success-Response:

{
"code": 0,
"data": null,
"msg": null
}

Error response example

Error response example - Error-Response:

{
"code": -1,
"data": null,
"msg": "The phone has already registered"
}

User Login Interface

Back to top

POST api/v1/pri/user/login

Parameters - Parameter

Name Type Description
userInfo json

Login Phone and Password.

Parameters examples

json - Request Example:

{
"phone": "123456",
"pwd": "123456"
}

Success response example

Success response example - Success-Response:

{
"code": 0,
"data": "Token String",
"msg": null
}

Error response example

Error response example - Error-Response:

{
"code": -1,
"data": null,
"msg": "Login Failed, Wrong User Information"
}

Video

List all the Videos

Back to top

GET /api/v1/pub/video/list

Parameters - Parameter

Name Type Description
null

null

Success response example

Success response example - Success-Response:

{
"code": 0,
"data": [
{
"id": 30,
"title": "title",
"summary": "https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/video/2019_backend/jvm_detail.jpeg",
"coverImg": "https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/video/2019_backend/jvm.jpeg",
"price": 3980,
"createTime": "2019-06-24 14:14:00",
"point": 9.1,
"chapterList": null
},
{
"id": 31,
"title": "title",
"summary": "https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/video/2019_backend/shiro_detail.jpeg",
"coverImg": "https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/video/2019_backend/shiro.jpeg",
"price": 2980,
"createTime": "2019-06-24 14:14:00",
"point": 8.9,
"chapterList": null
}
],
"msg": null
}

List the Carousel List

Back to top

GET api/v1/pub/video/list_banner

Parameters - Parameter

Name Type Description
null

null

Success response example

Success response example - Success-Response:

{
"code": 0,
"data": [
{
"id": 1,
"url": "https://m.xdclass.net/#/coursedetail?video_id=49",
"img": "https://file.xdclass.net/video/2020/%E9%9D%A2%E8%AF%95%E4%B8%93%E9%A2%98/%E9%9D%A2%E8%AF%95%E4%B8%93%E9%A2%98%E7%AC%AC%E4%B8%80%E5%AD%A3banner.png",
"createTime": null,
"weight": 1
},
{
"id": 2,
"url": "https://m.xdclass.net/#/member",
"img": "https://file.xdclass.net/video/%E5%AE%98%E7%BD%91%E8%BD%AE%E6%92%AD%E5%9B%BE/%E8%BD%AE%E6%92%AD%E5%9B%BE-VIP.png",
"createTime": null,
"weight": 2
}
],
"msg": null
}

Query video details, including chapter and episode info

Back to top

GET api/v1/pub/video/find_detail_by_id?video_id=id

Parameters - Parameter

Name Type Description
videoId Number

The specified Video ID (required, send as a parameter).

Success response example

Success response example - Success-Response:

{
"code": 0,
"data": {
"id": 44,
"title": "title",
"summary": "https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/video/jdk8/jdk8_detail.png",
"coverImg": "https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/video/jdk8/jdk8.png",
"price": 3980,
"createTime": "2019-10-10 14:14:00",
"point": 9.3,
"chapterList": [
{
"id": 510,
"videoId": null,
"title": "chapterTitle",
"ordered": 1,
"createTime": null,
"episodeList": [
{
"id": 12101,
"title": "chapterTitle",
"num": 1,
"ordered": 1,
"playUrl": "xdclass.net/aaa.mp4",
"chapterId": null,
"free": 0,
"videoId": null,
"createTime": null
},
{
"id": 12102,
"title": "chapterTitle",
"num": 2,
"ordered": 2,
"playUrl": "xdclass.net/aaa.mp4",
"chapterId": null,
"free": 0,
"videoId": null,
"createTime": null
}
]
}
]
},
"msg": null
}

VideoOrder

List All Order Records of a specific User

Back to top

GET api/v1/pri/order/list

Parameters - Parameter

Name Type Description
token header

The Login Token.

Success response example

Success response example - Success-Response:

{
"code": 0,
"data": [
{
"id": 14,
"outTradeNo": "1765cc94-caf6-4eb3-9127-26310c32ae35",
"state": 1,
"createTime": "2020-09-07 22:08:19",
"totalFee": 5980,
"videoId": 42,
"videoTitle": "videoTitle",
"videoImg": "https://xd-video-pc-img.oss-cn-beijing.aliyuncs.com/xdclass_pro/video/2019_frontend/element/elementui.png",
"userId": 11
}
],
"msg": null
}

Save the User's purchase record

Back to top

POST api/v1/pri/order/save

Parameters - Parameter

Name Type Description
token header

The Login Token.

videoOrderRequest json

The Video Order Info.

Parameters examples

json - Request Example:

{
"video_id" : 34
}

Success response example

Success response example - Success-Response:

{
"code": 0,
"data": null,
"msg": null
}

Error response example

Error response example - Error-Response:

{
"code": -1,
"data": null,
"msg": "Oops! Purchase Failed"
}