[关闭]
@cfygaoyang 2019-09-09T08:24:34.000000Z 字数 16063 阅读 921

飞燕通版WEB接口文档

未分类


API接口请求规则

  1. {
  2. "Content-Type": "application/json",
  3. "Authorization": "Token 1234567890"
  4. }
  5. 备注: 1234567890 access_token 的值

账号体系

获取Token

POST /admin/auth/access_token/

参数 类型 必填 说明
area string 手机区号
account string 手机或邮箱
password string 密码
参数 类型 必有 说明
access_token string 用于请求Header中的Token值
refresh_token string 用于刷新Token信息
expires_at string access_token有效截止时间
expires_in string access_token有效时间,单位:秒
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "access_token": "lRnCFDxpK6PhpT44YaaLMwHmvI97GCIQvxazlNSQC4XxjDBCAV",
  6. "refresh_token": "aQ4XO33CSez6aSXEaiptgD10NzbWMu42xh3Wvb3YI2pgpD1raD",
  7. "expires_at": "2019-05-29 18:22:30",
  8. "expires_in": 604800
  9. }
  10. }

刷新Token

POST /admin/auth/refresh_token/

参数 类型 必填 说明
refresh_token string 刷新Token
参数 类型 必有 说明
access_token string 用于请求Header中的Token值
refresh_token string 用于刷新Token信息
expires_at string access_token有效截止时间
expires_in string access_token有效时间,单位:秒
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "access_token": "lRnCFDxpK6PhpT44YaaLMwHmvI97GCIQvxazlNSQC4XxjDBCAV",
  6. "refresh_token": "aQ4XO33CSez6aSXEaiptgD10NzbWMu42xh3Wvb3YI2pgpD1raD",
  7. "expires_at": "2019-05-29 18:22:30",
  8. "expires_in": 604800
  9. }
  10. }

销毁Token

POST /admin/auth/destroy_token/

  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {}
  5. }

获取个人信息

GET /admin/personal/info/

参数 类型 必有 说明
id int 用户ID
area string 手机区号
phone string 手机号
email string 邮箱
role int 用户角色,0:普通用户
username string 用户名
is_active bool 是否已激活
created_at string 创建时间
updated_at string 更新时间
nickname string 昵称
avatar string 头像地址
gender int 性别,0:女,1:男,2:保密
birthday string 生日日期,如:2019-02-22
address string 地址
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 8,
  6. "area": "86",
  7. "phone": "18656660930",
  8. "email": "",
  9. "open_id": "HuTfdXc8mENtNULFPBVt233cN2gzZ9lKqAcoUKed",
  10. "role": 0,
  11. "username": "18656660930",
  12. "is_active": true,
  13. "app_id": "",
  14. "created_at": "2019-05-22 18:20:45",
  15. "updated_at": "2019-05-22 18:20:45",
  16. "nickname": "",
  17. "avatar": "",
  18. "gender": 2,
  19. "birthday": "",
  20. "address": ""
  21. }
  22. }

编辑个人信息

PUT /admin/personal/info/

参数 类型 必填 说明
nickname string 昵称
avatar string 头像地址
gender int 性别:0女,1男,2保密
birthday string 生日: 格式要求示例(1991-03-08)
address string 住址
参数 类型 必有 说明
id int 用户ID
area string 手机区号
phone string 手机号
email string 邮箱
role int 用户角色,0:普通用户
username string 用户名
is_active bool 是否已激活
created_at string 创建时间
updated_at string 更新时间
nickname string 昵称
avatar string 头像地址
gender int 性别,0:女,1:男,2:保密
birthday string 生日日期,如:2019-02-22
address string 地址
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 8,
  6. "area": "86",
  7. "phone": "18656660930",
  8. "email": "",
  9. "open_id": "HuTfdXc8mENtNULFPBVt233cN2gzZ9lKqAcoUKed",
  10. "role": 0,
  11. "username": "18656660930",
  12. "is_active": true,
  13. "app_id": "",
  14. "created_at": "2019-05-22 18:20:45",
  15. "updated_at": "2019-05-22 18:20:45",
  16. "nickname": "",
  17. "avatar": "",
  18. "gender": 2,
  19. "birthday": "",
  20. "address": ""
  21. }
  22. }

FAQ服务

添加FAQ

POST /admin/faq/

参数 类型 必填 说明
title string 标题
content string 内容
category string 类型
external_link string 外链
参数 类型 必有 说明
id int faq信息id
title string 标题
content string 内容
category string 类型
external_link string 外链
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 2,
  6. "app_id": "",
  7. "created_at": "2019-05-23 18:17:16",
  8. "updated_at": "2019-05-23 18:17:16",
  9. "title": "标题",
  10. "content": "内容",
  11. "category": "",
  12. "external_link": ""
  13. }
  14. }

编辑FAQ

PUT /admin/faq/{id}/

参数 类型 必填 说明
id int faq信息id
title string 标题
content string 内容
category string 类型
external_link string 外链
参数 类型 必有 说明
id int faq信息id
title string 标题
content string 内容
category string 类型
external_link string 外链
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 2,
  6. "app_id": "",
  7. "created_at": "2019-05-23 18:17:16",
  8. "updated_at": "2019-05-23 18:17:16",
  9. "title": "标题",
  10. "content": "内容",
  11. "category": "",
  12. "external_link": ""
  13. }
  14. }

删除FAQ

DELETE /admin/faq/{id}/

参数 类型 必填 说明
id int faq信息id
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {}
  5. }

获取FAQ详情

GET /admin/faq/{id}/

参数 类型 必填 说明
id int faq信息id
参数 类型 必有 说明
id int faq信息id
title string 标题
content string 内容
category string 类型
external_link string 外链
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 2,
  6. "app_id": "",
  7. "created_at": "2019-05-23 18:17:16",
  8. "updated_at": "2019-05-23 18:17:16",
  9. "title": "标题",
  10. "content": "内容",
  11. "category": "",
  12. "external_link": ""
  13. }
  14. }

获取FAQ列表

GET /admin/faq/

参数 类型 必有 说明
id int faq信息id
title string 标题
content string 内容
category string 类型
external_link string 外链
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "total": 1,
  6. "pages": 1,
  7. "current_page": 1,
  8. "page_size": 20,
  9. "data": [
  10. {
  11. "id": 2,
  12. "app_id": "",
  13. "created_at": "2019-05-23 18:17:16",
  14. "updated_at": "2019-05-23 18:17:16",
  15. "title": "标题",
  16. "content": "内容",
  17. "category": "",
  18. "external_link": ""
  19. }
  20. ]
  21. }
  22. }

意见反馈

添加反馈类型

POST /admin/feedback_category/

参数 类型 必填 说明
name string 名称
description string 描述
参数 类型 必有 说明
id int 反馈类型id
name string 反馈类型名称
description string 反馈类型描述
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 2,
  6. "app_id": "",
  7. "created_at": "2019-05-24 11:28:43",
  8. "updated_at": "2019-05-24 11:28:43",
  9. "name": "设备",
  10. "description": "其他"
  11. }
  12. }

编辑反馈类型

PUT /admin/feedback_category/{id}/

参数 类型 必填 说明
id int 反馈类型id
name string 名称
description string 描述
参数 类型 必有 说明
id int 反馈类型id
name string 反馈类型名称
description string 反馈类型描述
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 2,
  6. "app_id": "",
  7. "created_at": "2019-05-24 11:28:43",
  8. "updated_at": "2019-05-24 11:28:43",
  9. "name": "设备",
  10. "description": "其他"
  11. }
  12. }

删除反馈类型

DELETE /admin/feedback_category/{id}/

参数 类型 必填 说明
id int 反馈类型id
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {}
  5. }

获取反馈类型详情

GET /admin/feedback_category/{id}/

参数 类型 必填 说明
id int 反馈类型id
参数 类型 必有 说明
id int 反馈类型id
name string 反馈类型名称
description string 反馈类型描述
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 2,
  6. "app_id": "",
  7. "created_at": "2019-05-24 11:28:43",
  8. "updated_at": "2019-05-24 11:28:43",
  9. "name": "设备",
  10. "description": "其他"
  11. }
  12. }

获取反馈类型列表

GET /admin/feedback_category/

  1. {
  2. "Content-Type": "application/json; charset=utf-8",
  3. "Authorization": "Token xxxxxx"
  4. }
参数 类型 必填 说明
page_no int 分页数:默认1
page_size int 数据量:默认20
参数 类型 必有 说明
id int 反馈类型id
name string 反馈类型名称
description string 反馈类型描述
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "total": 1,
  6. "pages": 1,
  7. "current_page": 1,
  8. "page_size": 20,
  9. "data": [
  10. {
  11. "id": 1,
  12. "app_id": "",
  13. "created_at": "2019-05-24 11:28:08",
  14. "updated_at": "2019-05-24 11:30:57",
  15. "name": "app",
  16. "description": "app"
  17. }
  18. ]
  19. }
  20. }

获取意见反馈列表

GET /admin/feedback/

参数 类型 必填 说明
page_no int 分页数:默认1
page_size int 数据量:默认20
start_time int 起始时间戳
end_time int 结束时间戳
username string 用户名
参数 类型 必有 说明
id int 反馈类型id
name string 反馈类型名称
description string 反馈类型描述
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "total": 2,
  6. "pages": 1,
  7. "current_page": 1,
  8. "page_size": 20,
  9. "data": [
  10. {
  11. "id": 3,
  12. "app_id": "",
  13. "created_at": "2019-05-24 11:48:47",
  14. "updated_at": "2019-05-24 11:48:47",
  15. "feedback_content": "反馈内容",
  16. "feedback_status": 0,
  17. "feedback_category_id": 1,
  18. "contact_phone": "18656660930",
  19. "user_id": 2,
  20. "username": "admin"
  21. },
  22. {
  23. "id": 2,
  24. "app_id": "",
  25. "created_at": "2019-05-24 11:47:43",
  26. "updated_at": "2019-05-24 11:47:43",
  27. "feedback_content": "反馈内容",
  28. "feedback_status": 1,
  29. "feedback_category_id": 1,
  30. "contact_phone": "18656660930",
  31. "user_id": 2,
  32. "username": "admin"
  33. }
  34. ]
  35. }
  36. }

删除意见反馈

DELETE /admin/feedback/{id}/

参数 类型 必填 说明
id int 反馈意见id
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {}
  5. }

获取意见反馈回复内容

GET /admin/feedback/reply/{feedback_id}/

参数 类型 必填 说明
feedback_id int 反馈意见id
参数 类型 必有 说明
id string 反馈类型id
reply_content string 回复内容
is_read bool 是否已读
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 2,
  6. "app_id": "",
  7. "created_at": "2019-05-24 14:02:44",
  8. "updated_at": "2019-05-24 14:02:44",
  9. "reply_content": "回复内容",
  10. "manager_id": 2,
  11. "feedback_id": 3,
  12. "is_read": false
  13. }
  14. }

在线文档

创建在线文档

POST /admin/document/

参数 类型 必填 说明
doc_name string 文档名称
doc_content string 文档内容
path_name string 路径名称
参数 类型 必有 说明
id int 文档id
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
doc_name string 文档名称
doc_content string 文档内容
doc_url string 文档地址
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 1,
  6. "path_name": "1",
  7. "app_id": "",
  8. "created_at": "2019-08-27 16:14:46",
  9. "updated_at": "2019-08-27 16:14:46",
  10. "doc_name": "使用说明书",
  11. "doc_content": "**************",
  12. "doc_url": "http://39.105.60.207:8101/document/1"
  13. }
  14. }

获取文档列表

GET /admin/document/

参数 类型 必填 说明
page_no int 分页数:默认1
page_size int 数据量:默认20
参数 类型 必有 说明
id int 文档id
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
doc_name string 文档名称
doc_content string 文档内容
doc_url string 文档地址
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "total": 1,
  6. "pages": 1,
  7. "current_page": 1,
  8. "page_size": 20,
  9. "data": [
  10. {
  11. "id": 1,
  12. "path_name": "1",
  13. "app_id": "",
  14. "created_at": "2019-08-27 16:14:46",
  15. "updated_at": "2019-08-27 16:14:46",
  16. "doc_name": "使用说明书",
  17. "doc_content": "**************",
  18. "doc_url": "http://39.105.60.207:8101/document/1"
  19. }
  20. ]
  21. }
  22. }

编辑在线文档

PUT /admin/document/[id]/

参数 类型 必填 说明
id int 文档id
doc_name string 文档名称
doc_content string 文档内容
path_name string 路径名称
参数 类型 必有 说明
id int 文档id
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
doc_name string 文档名称
doc_content string 文档内容
doc_url string 文档地址
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 1,
  6. "path_name": "1",
  7. "app_id": "",
  8. "created_at": "2019-08-27 16:14:46",
  9. "updated_at": "2019-08-27 16:14:46",
  10. "doc_name": "使用说明书",
  11. "doc_content": "**************",
  12. "doc_url": "http://39.105.60.207:8101/document/1"
  13. }
  14. }

编辑在线文档

DELETE /admin/document/[id]/

参数 类型 必填 说明
id int 文档id
参数 类型 必有 说明
id int 文档id
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
doc_name string 文档名称
doc_content string 文档内容
doc_url string 文档地址
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {}
  5. }

在线文档详情

GET /admin/document/[id]/

参数 类型 必填 说明
id int 文档id
参数 类型 必有 说明
id int 文档id
created_at string 创建时间
updated_at string 更新时间
app_id string 厂商标识
doc_name string 文档名称
doc_content string 文档内容
doc_url string 文档地址
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 1,
  6. "path_name": "1",
  7. "app_id": "",
  8. "created_at": "2019-08-27 16:14:46",
  9. "updated_at": "2019-08-27 16:14:46",
  10. "doc_name": "使用说明书",
  11. "doc_content": "**************",
  12. "doc_url": "http://39.105.60.207:8101/document/1"
  13. }
  14. }

角色管理

获取角色配置清单

GET /admin/config/roles/

参数 类型 必有 说明
title string 菜单名称
key string 菜单唯一标识
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "roles": [
  6. {
  7. "title": "系统管理",
  8. "key": "1",
  9. "children": [
  10. {
  11. "title": "账号管理",
  12. "key": "1-1"
  13. },
  14. {
  15. "title": "角色管理",
  16. "key": "1-2"
  17. },
  18. {
  19. "title": "日志管理",
  20. "key": "1-3"
  21. }
  22. ]
  23. },
  24. {
  25. "title": "配置管理",
  26. "key": "2",
  27. "children": [
  28. {
  29. "title": "在线文档",
  30. "key": "2-1"
  31. },
  32. {
  33. "title": "FAQ",
  34. "key": "1-2"
  35. }
  36. ]
  37. },
  38. {
  39. "title": "MQTT服务",
  40. "key": "3",
  41. "children": [
  42. {
  43. "title": "产品管理",
  44. "key": "3-1"
  45. },
  46. {
  47. "title": "设备管理",
  48. "key": "3-2"
  49. }
  50. ]
  51. }
  52. ]
  53. }
  54. }

获取角色列表

GET /admin/role/

参数 类型 必填 说明
page_no int 分页数:默认1
page_size int 数据量:默认20
参数 类型 必有 说明
id string 数据id
created_at string 创建时间
updated_at string 设备名称
role_name string 角色名称
role_permissions list 角色权限
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 1,
  6. "role_permissions": [
  7. "1-1",
  8. "2-2"
  9. ],
  10. "app_id": "",
  11. "created_at": "2019-09-01 14:28:56",
  12. "updated_at": "2019-09-01 15:04:22",
  13. "role_name": "技术人员"
  14. }
  15. }

创建角色

POST /admin/role/

参数 类型 必填 说明
role_name string 角色名称
role_permissions list 角色权限, 参考角色配置清单,选中的children中的key列表
参数 类型 必有 说明
id string 数据id
created_at string 创建时间
updated_at string 设备名称
role_name string 角色名称
role_permissions list 角色权限
  1. {
  2. "role_name": "技术人员",
  3. "role_permissions": ['1-1', '2-2']
  4. }
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 1,
  6. "role_permissions": [
  7. "1-1",
  8. "2-2"
  9. ],
  10. "app_id": "",
  11. "created_at": "2019-09-01 14:28:56",
  12. "updated_at": "2019-09-01 14:28:56",
  13. "role_name": "技术人员"
  14. }
  15. }

获取角色详情

GET /admin/role/[id]/

参数 类型 必有 说明
id string 数据id
created_at string 创建时间
updated_at string 设备名称
role_name string 角色名称
role_permissions list 角色权限
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 1,
  6. "role_permissions": [
  7. "1-1",
  8. "2-2"
  9. ],
  10. "app_id": "",
  11. "created_at": "2019-09-01 14:28:56",
  12. "updated_at": "2019-09-01 14:28:56",
  13. "role_name": "技术人员"
  14. }
  15. }

编辑角色

PUT /admin/role/[id]/

参数 类型 必填 说明
role_name string 角色名称
role_permissions list 角色权限, 参考角色配置清单,选中的children中的key列表
参数 类型 必有 说明
id string 数据id
created_at string 创建时间
updated_at string 设备名称
role_name string 角色名称
role_permissions list 角色权限
  1. {
  2. "role_name": "技术人员",
  3. "role_permissions": ['1-1', '2-2']
  4. }
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 1,
  6. "role_permissions": [
  7. "1-1",
  8. "2-2"
  9. ],
  10. "app_id": "",
  11. "created_at": "2019-09-01 14:28:56",
  12. "updated_at": "2019-09-01 14:28:56",
  13. "role_name": "技术人员"
  14. }
  15. }

删除角色

DELETE /admin/role/[id]/

参数 类型 必填 说明
id string 角色id
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {}
  5. }

公司管理

添加公司

POST /admin/app/

参数 类型 必填 说明
company string 公司名称
address string 公司地址
contact_name string 联系人
phone string 电话
email string 邮箱
参数 类型 必有 说明
id int 公司信息id
company string 公司名称
address string 公司地址
contact_name string 联系人
phone string 电话
email string 邮箱
app_id string 公司信息标识符
created_at string 创建时间
updated_at string 更新时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 3,
  6. "app_id": "5d73209e228c90634547aaf5",
  7. "created_at": "2019-09-07 11:14:38",
  8. "updated_at": "2019-09-07 11:14:38",
  9. "company": "上海xxxx科技有限公司",
  10. "contact_name": "xxx",
  11. "address": "",
  12. "phone": "18656660932",
  13. "email": ""
  14. }
  15. }

获取公司列表

GET /admin/app/

参数 类型 必填 说明
page_no int 分页数:默认1
page_size int 数据量:默认20
参数 类型 必有 说明
id int 公司信息id
company string 公司名称
address string 公司地址
contact_name string 联系人
phone string 电话
email string 邮箱
app_id string 公司信息标识符
created_at string 创建时间
updated_at string 更新时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "total": 2,
  6. "pages": 1,
  7. "current_page": 1,
  8. "page_size": 20,
  9. "data": [
  10. {
  11. "id": 3,
  12. "app_id": "5d73209e228c90634547aaf5",
  13. "created_at": "2019-09-07 11:14:38",
  14. "updated_at": "2019-09-07 11:14:38",
  15. "company": "上海xxx",
  16. "contact_name": "xxx",
  17. "address": "",
  18. "phone": "1865666xxxx",
  19. "email": ""
  20. },
  21. {
  22. "id": 2,
  23. "app_id": "5d73205d228c90634547aaf4",
  24. "created_at": "2019-09-07 11:13:33",
  25. "updated_at": "2019-09-07 11:13:33",
  26. "company": "上海xxxx科技有限公司",
  27. "contact_name": "xxx",
  28. "address": "",
  29. "phone": "18656660931",
  30. "email": ""
  31. }
  32. ]
  33. }
  34. }

编辑公司

PUT /admin/app/[id]/

参数 类型 必填 说明
company string 公司名称
contact_name string 联系人
phone string 电话
email string 邮箱
参数 类型 必有 说明
id int 公司信息id
company string 公司名称
address string 公司地址
contact_name string 联系人
phone string 电话
email string 邮箱
app_id string 公司信息标识符
created_at string 创建时间
updated_at string 更新时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 3,
  6. "app_id": "5d73209e228c90634547aaf5",
  7. "created_at": "2019-09-07 11:14:38",
  8. "updated_at": "2019-09-07 11:14:38",
  9. "company": "上海xxxx科技有限公司",
  10. "contact_name": "高杨",
  11. "address": "",
  12. "phone": "18656660932",
  13. "email": ""
  14. }
  15. }

获取公司详情

GET /admin/app/[id]/

参数 类型 必有 说明
id int 公司信息id
company string 公司名称
address string 公司地址
contact_name string 联系人
phone string 电话
email string 邮箱
app_id string 公司信息标识符
created_at string 创建时间
updated_at string 更新时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "id": 3,
  6. "app_id": "5d73209e228c90634547aaf5",
  7. "created_at": "2019-09-07 11:14:38",
  8. "updated_at": "2019-09-07 11:14:38",
  9. "company": "上海xxxx科技有限公司",
  10. "contact_name": "高杨",
  11. "address": "",
  12. "phone": "18656660932",
  13. "email": ""
  14. }
  15. }

产品管理

添加产品

POST /admin/product/

参数 类型 必填 说明
product_name 字符串 产品名称
参数 类型 必有 说明
product_name 字符串 产品名称
product_key 字符串 产品标识符
product_secret 字符串 产品秘钥
created 字符串 创建时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "_id": "5d7609dfe1508d2dfb31c91c",
  6. "product_name": "小系统",
  7. "product_key": "bOZVf6DNvE",
  8. "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA",
  9. "created": "2019-09-09 16:14:23"
  10. }
  11. }

获取产品列表

GET /admin/product/

参数 类型 必有 说明
product_name 字符串 产品名称
product_key 字符串 产品标识符
product_secret 字符串 产品秘钥
created 字符串 创建时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "total": 2,
  6. "pages": 1,
  7. "current_page": 1,
  8. "page_size": 20,
  9. "data": [
  10. {
  11. "_id": "5d6f719ecb25ac82f5103fc9",
  12. "product_name": "test",
  13. "product_key": "hnbSRfI21N",
  14. "product_secret": "WJ1HHwVhixisjyeCR5hGTH6iVk1gele2",
  15. "created": "2019-09-04 16:11:10"
  16. },
  17. {
  18. "_id": "5d7609dfe1508d2dfb31c91c",
  19. "product_name": "小系统",
  20. "product_key": "bOZVf6DNvE",
  21. "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA",
  22. "created": "2019-09-09 16:14:23"
  23. }
  24. ]
  25. }
  26. }

获取产品详情

GET /admin/product/[product_key]/

参数 类型 必填 说明
product_key 字符串 产品标识符
参数 类型 必有 说明
product_name 字符串 产品名称
product_key 字符串 产品标识符
product_secret 字符串 产品秘钥
created 字符串 创建时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "_id": "5d7609dfe1508d2dfb31c91c",
  6. "product_name": "小系统",
  7. "product_key": "bOZVf6DNvE",
  8. "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA",
  9. "created": "2019-09-09 16:14:23"
  10. }
  11. }

编辑产品详情

PUT /admin/product/[product_key]/

参数 类型 必填 说明
product_key 字符串 产品标识符
product_name 字符串 产品名称
参数 类型 必有 说明
product_name 字符串 产品名称
product_key 字符串 产品标识符
product_secret 字符串 产品秘钥
created 字符串 创建时间
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {
  5. "_id": "5d7609dfe1508d2dfb31c91c",
  6. "product_name": "小系统",
  7. "product_key": "bOZVf6DNvE",
  8. "product_secret": "JvSTO0JQz3oBVIWMFwSU7lK8Eo2vmpsA",
  9. "created": "2019-09-09 16:14:23"
  10. }
  11. }

删除产品

DELETE /admin/product/[product_key]/

参数 类型 必填 说明
product_key 字符串 产品标识符
  1. {
  2. "code": 0,
  3. "message": "success",
  4. "data": {}
  5. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注