@cfygaoyang
2018-02-24T06:08:30.000000Z
字数 8918
阅读 448
未分类
POST /api/access_token
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| phone | 字符串 | 是 | 手机号 |
| password | 字符串 | 是 | 密码 |
或
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| phone | 字符串 | 是 | 手机号 |
| code | 字符串 | 是 | 验证码 |
{"code": 0,"status": "success","message": {"access_token": "884ffcc9d7af0b9a9abb2d1696a4a9db0a80b2bba2dc79fa4b05d10ebdd9","expires_in": 604800,"expires_at": "2018-02-05 15:14:23","refresh_token": "f28f213ca3e202c4feca66b1eec863c68adf7aa570e4a6cf4d270382bf95"}}
POST /api/refresh_token
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| refresh_token | 字符串 | 是 | 刷新Token |
{"code": 0,"status": "success","message": ""}
POST /api/destroy_token
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| refresh_token | 字符串 | 是 | 刷新Token |
{"code": 0,"status": "success","message": ""}
POST /api/send_code
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| phone | 字符串 | 是 | 密码 |
{"code": 0,"status": "success","message": ""}
POST /api/reset_password
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| password | 字符串 | 是 | 密码 |
{"code": 0,"status": "success","message": ""}
GET /api/user/info
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{"code": 0,"status": "success","message": {"id": 1,"access_key": 0,"created_at": "2018-01-08 15:55:03","updated_at": "2018-01-08 15:55:03","avatar": "","birthday": "","sex": 2,"city": "","address": "","user": 1,"username": "18888888889","phone": "18888888889","email": ""}}
PUT /api/user/info
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| avatar | 字符串 | 可选 | 头像 |
| birthday | 字符串 | 可选 | 生日 |
| sex | 整型 | 可选 | 性别 (0:女 1:男 2:保密) |
| city | 字符串 | 可选 | 城市 |
| address | 字符串 | 可选 | 住址 |
| username | 字符串 | 可选 | 昵称 |
| phone | 字符串 | 可选 | 手机 |
| 字符串 | 可选 | 邮箱 |
{"code": 0,"status": "success","message": {"id": 1,"access_key": 0,"created_at": "2018-01-08 15:55:03","updated_at": "2018-01-08 15:55:03","avatar": "","birthday": "","sex": 2,"city": "","address": "","user": 1,"username": "18888888889","phone": "18888888889","email": ""}}
GET /api/topic
{"code": 0,"status": "success","message": {"total": 1,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 2,"created_at": "2018-01-18 17:24:38","updated_at": "2018-01-18 17:24:38","topic_name": "人工智能","topic_description": "","topic_thumbnail": ""}]}}
GET /api/topic/{pk}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 话题主键ID(url) |
{"code": 0,"status": "success","message": {"id": 2,"created_at": "2018-01-18 17:24:38","updated_at": "2018-01-18 17:24:38","topic_name": "人工智能","topic_description": "","topic_thumbnail": ""}}
POST /api/card
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| card_title | 字符串 | 是 | 标题 |
| card_content | 字符串 | 是 | 内容 |
| topic | 整型 | 是 | 所属话题 |
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{"code": 0,"status": "success","message": {"id": 1,"created_at": "2018-01-23 10:35:15","updated_at": "2018-01-23 10:35:15","card_title": "标题","card_content": "内容","see_num": 0,"topic": 2,"user": 1}}
GET /api/card
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| topic | 整型 | 可选 | 主题ID,根据主题筛选帖子列表 |
| user | 整型 | 可选 | 发帖人ID,根据用户筛选帖子列表 |
{"code": 0,"status": "success","message": {"total": 1,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 3,"created_at": "2018-01-29T15:15:48.004617","updated_at": "2018-01-29T15:15:48.004617","card_title": "标题","card_content": "内容","see_num": 0,"topic_id": 2,"user_id": 1,"avatar": "","username": "18656660930","comment_num": 1,"collection_num": 0,"liked_num": 1}]}}
GET /api/card/{pk}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 帖子主键ID(url) |
{"code": 0,"status": "success","message": {"id": 3,"created_at": "2018-01-29T15:15:48.004617","updated_at": "2018-01-29T15:15:48.004617","card_title": "标题","card_content": "内容","see_num": 0,"topic_id": 2,"user_id": 1,"avatar": "","username": "18656660930","comment_num": 1,"collection_num": 0,"liked_num": 1}}
PUT /api/card/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 帖子主键ID(url) |
| card_title | 字符串 | 是 | 标题 |
| card_content | 字符串 | 是 | 内容 |
| topic | 整型 | 是 | 所属话题 |
{"code": 0,"status": "success","message": {"id": 1,"created_at": "2018-01-23 10:35:15","updated_at": "2018-01-23 10:59:59","card_title": "标题2","card_content": "内容","see_num": 0,"topic": 2,"user": 1}}
DELETE /api/card/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 帖子主键ID(url) |
{"code": 0,"status": "success","message": ""}
GET /api/card_liked/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 帖子主键ID(url) |
{"code": 0,"status": "success","message": {"id": 2,"created_at": "2018-01-29 15:38:14","updated_at": "2018-01-29 15:38:14","is_read": false,"card": 3,"user": 1}}
POST /api/card_liked
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| card | 整型 | 是 | 帖子主键ID |
{"code": 0,"status": "success","message": {"id": 2,"created_at": "2018-01-29 15:38:14","updated_at": "2018-01-29 15:38:14","is_read": false,"card": 3,"user": 1}}
DELETE /api/card_liked/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 帖子主键ID(url) |
{"code": 0,"status": "success","message": ""}
GET /api/comment
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| card | 整型 | 是 | 帖子主键ID |
| page | 整型 | 可选 | 分页页数 |
{"code": 0,"status": "success","message": {"total": 1,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 1,"created_at": "2018-01-29T15:54:53.524999","updated_at": "2018-01-29T15:54:53.524999","comment_content": "明天必涨","card_id": 3,"user_id": 1,"avatar": "","username": "18656660930","num": null}]}}
POST /api/comment
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| comment_content | 字符串 | 是 | 评论内容 |
| card | 整型 | 是 | 帖子主键ID |
DELETE /api/comment/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 评论主键ID(url) |
GET /api/comment_liked/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 评论主键ID |
{"code": 0,"status": "success","message": {"id": 1,"created_at": "2018-01-29 17:14:42","updated_at": "2018-01-29 17:14:42","is_read": false,"comment": 1,"user": 1}}
POST /api/comment_liked
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| comment | 整型 | 是 | 评论主键ID(url) |
{"code": 0,"status": "success","message": {"id": 1,"created_at": "2018-01-29 17:14:42","updated_at": "2018-01-29 17:14:42","is_read": false,"comment": 1,"user": 1}}
DELETE /api/comment_liked/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 评论主键ID(url) |
{"code": 0,"status": "success","message": ""}
GET /api/card_collection/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 帖子主键ID(url) |
{"code": 0,"status": "success","message": ""}
GET /api/card_collection
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{"code": 0,"status": "success","message": {"total": 1,"pages": 1,"current_page": 1,"page_size": 20,"data": [{"id": 3,"created_at": "2018-01-29T15:15:48.004617","updated_at": "2018-01-29T15:15:48.004617","card_title": "标题","card_content": "内容","see_num": 0,"topic_id": 2,"user_id": 1,"username": "18656660930","avatar": ""}]}}
POST /api/card_collection
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| card | 整型 | 是 | 帖子主键ID(url) |
{"code": 0,"status": "success","message": {"id": 1,"created_at": "2018-01-30 10:46:22","updated_at": "2018-01-30 10:46:22","card": 3,"user": 1}}
DELETE /api/card_collection/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| pk | 整型 | 是 | 帖子主键ID(url) |
{"code": 0,"status": "success","message": ""}
GET /api/product
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{}
GET /api/product/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{}
GET /api/template/custom
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{}
POST /api/template/custom
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| template_name | 字符串 | 是 | 模板名称 |
| template_json | 字符串 | 是 | 模板指令Json |
| product | 整型 | 是 | 产品ID |
{}
PUT /api/template/custom/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| template_name | 字符串 | 是 | 模板名称 |
| template_json | 字符串 | 是 | 模板指令Json |
| product | 整型 | 是 | 产品ID |
{}
DELETE /api/template/custom/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{}
GET /api/template/custom/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{}
GET /api/template/common
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{}
GET /api/template/common/{pk}
{"Authorization": " Token c8b1243cc508efc1e0d07e7a4091cee566d9976320edab08ea86886eeb27"}
{}