[关闭]
@cfygaoyang 2017-08-07T03:49:19.000000Z 字数 1728 阅读 411

APP

产品信息接口文档(APP)

分页获取产品列表:

GET /product/api/?page=[PAGE]

参数 类型 必须 说明
PAGE 整型 页数
  1. {
  2. "meta": {
  3. "code": 0,
  4. "message": "find success"
  5. },
  6. "data": {
  7. "count": 2,
  8. "next": null,
  9. "previous": null,
  10. "results": [
  11. {
  12. "id": 1,
  13. "product_id": "123456",
  14. "product_name": "cao",
  15. "product_type": "1"
  16. },
  17. {
  18. "id": 2,
  19. "product_id": "qwert",
  20. "product_name": "wefgf",
  21. "product_type": "asdf"
  22. }
  23. ]
  24. }
  25. }
参数 类型 说明
code 整型 错误码;0代表正确,反之错误
message 字符串 请求提示
count 整型 数据总条数
next 字符串 下一页的链接
previous 字符串 上一页的链接
results 数组 数据列表
id 整型 产品主键
product_id 字符串 SDS 产品 product_id
product_name 字符串 产品名称
prodcut_type 字符串 产品类型

数据列表一页显示10条

根据产品主键(id)获取产品详情

GET /product/api/detail/[ID]

参数 类型 必须 说明
ID 整型 产品主键
  1. {
  2. "meta": {
  3. "code": 0,
  4. "message": "find success"
  5. },
  6. "data": {
  7. "id": 1,
  8. "product_id": "123456",
  9. "product_name": "cao",
  10. "product_type": "1"
  11. }
  12. }
参数 类型 说明
code 整型 错误码;0代表正确,反之错误
message 字符串 请求消息提示
id 整型 产品主键
product_id 字符串 SDS 产品 product_id
product_name 字符串 产品名称
product_type 字符串 产品类型

产品模板接口文档(APP)

根据模板主键(id)查询模板详情

GET /product/api/template/detail/[product_id]

参数 类型 必须 说明
product_id 字符串 SDS model

* 请求回调

  1. {
  2. "meta": {
  3. "code": 0,
  4. "message": "find success"
  5. },
  6. "data": {
  7. "id": 1,
  8. "template_name": "dfd",
  9. "template_json": "{\"name\":\"gaoyang\"}",
  10. "template_read": 23,
  11. "product": 1
  12. }
  13. }
参数 类型 说明
code 整型 错误码;0代表正确,反之错误
message 字符串 请求消息提示
id 整型 模板主键 id
template_name 字符串 模板名称
template_json json 字符串 下发指令模板
template_read 整型 是否可更改;0代表 template_json 只读,反之可编辑
product 整型 产品主键

根据产品主键(id)查询产品模板列表

GET /product/api/template/[ID]

参数 类型 必须 说明
ID 整型 产品主键
  1. {
  2. "meta": {
  3. "code": 0,
  4. "message": "find success"
  5. },
  6. "data": {
  7. "count": 1,
  8. "next": null,
  9. "previous": null,
  10. "results": [
  11. {
  12. "id": 1,
  13. "template_name": "dfd",
  14. "template_json": "123",
  15. "template_read": 23,
  16. "product": 1
  17. }
  18. ]
  19. }
  20. }
参数 类型 说明
code 整型 错误码;0代表正确,反之错误
message 字符串 请求提示
count 整型 数据总条数
next 字符串 下一页的链接
previous 字符串 上一页的链接
results 数组 数据列表
id 整型 模板主键
template_name 字符串 模板名称
template_json 字符串json 下发指令模板
template_read 整型 是否可更改;0代表 template_json 只读,反之可编辑
product 整型 产品主键

数据列表一页显示10条

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注