@cfygaoyang
2017-08-17T06:06:29.000000Z
字数 4166
阅读 628
后台管理
GET /product/?page=[PAGE]
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
PAGE | 整型 | 否 | 页数 |
{
"meta": {
"code": 0,
"message": "find success"
},
"data": {
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"product_id": "123456",
"product_name": "cao",
"product_type": "1"
},
{
"id": 2,
"product_id": "qwert",
"product_name": "wefgf",
"product_type": "asdf"
}
]
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求提示 |
count | 整型 | 数据总条数 |
next | 字符串 | 下一页的链接 |
previous | 字符串 | 上一页的链接 |
results | 数组 | 数据列表 |
id | 整型 | 产品主键 |
product_id | 字符串 | SDS 产品 product_id |
product_name | 字符串 | 产品名称 |
prodcut_type | 字符串 | 产品类型 |
数据列表一页显示10条
POST /product/
{
"product_id": "2345678",
"product_name": "2345678",
"product_type": "sdfghj"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
product_id | 字符串 | 是 | SDS 产品 product_id |
prodcut_name | 字符串 | 是 | 产品名称 |
prodcut_type | 字符串 | 是 | 产品类型 |
{
"meta":{
"code" : 0,
"message" : "insert success"
},
"data":{
"id": 1,
"product_id": "123456",
"product_name": "cao",
"product_type": "1"
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求提示 |
data | json | 添加的产品信息 |
GET /product/detail/[ID]
{
"meta": {
"code": 0,
"message": "find success"
},
"data": {
"id": 1,
"product_id": "123456",
"product_name": "cao",
"product_type": "1"
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求提示 |
id | 整型 | 产品主键 |
product_id | 字符串 | SDS 产品 product_id |
product_name | 字符串 | 产品名称 |
prodcut_type | 字符串 | 产品类型 |
请求接口
PUT /product/detail/[ID]
请求参数
{
"product_id": "2345678",
"product_name": "2345678",
"product_type": "sdfghj"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
ID | 整型 | 是 | 产品主键 |
product_id | 字符串 | 是 | SDS 产品 product_id |
product_name | 字符串 | 是 | 产品名称 |
prodcut_type | 字符串 | 是 | 产品类型 |
{
"meta": {
"code" : 0,
"message" : "update success"
},
"data": {
"id": 4,
"product_id": "2345678",
"product_name": "2345678",
"product_type": "sdfghj"
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求提示 |
data | json | 编辑后的产品信息 |
DELETE /product/detail/[ID]
{
"meta": {
"code" : 0,
"message" : "delete success"
},
"data": {}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求提示 |
GET /product/template/?page=[PAGE]
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
PAGE | 整型 | 是 | 页数 |
* 请求回调
{
"meta": {
"code": 0,
"message": "find success"
},
"data": {
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"template_name": "dfd",
"template_json": "{\"name\":\"gaoyang\"}",
"template_read": 23,
"product": 1
}
]
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求提示 |
count | 整型 | 数据总条数 |
next | 字符串 | 下一页的链接 |
previous | 字符串 | 上一页的链接 |
results | 数组 | 数据列表 |
id | 整型 | 模板主键 |
template_name | 字符串 | 模板名称 |
template_json | 字符串json | 下发指令模板 |
template_read | 整型 | 是否可更改;0代表 template_json 只读,反之可编辑 |
product | 整型 | 产品主键 |
数据列表一页显示10条
POST /product/template/
{
"template_name": "sdfghjk",
"template_json": "{\"name\":\"gaoyang\"}",
"template_read": 0,
"product": 1
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
template_name | 字符串 | 是 | 模板名称 |
template_json | json 字符串 | 是 | 下发指令模板 |
template_read | 整型 | 是 | 模板是否只读;0代表template_json只读,反之可编辑 |
product | 整型 | 是 | 产品主键 |
* 请求回调
{
"meta": {
"code" : 0,
"message" : "insert success"
},
"data": {
"id": 1,
"template_name": "dfd",
"template_json": "{\"name\":\"gaoyang\"}",
"template_read": 23,
"product": 1
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求消息提示 |
data | json | 添加的模板信息 |
GET /product/template/detail/[ID]
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
ID | 整型 | 是 | 模板主键 |
{
"meta": {
"code": 0,
"message": "find success"
},
"data": {
"id": 1,
"template_name": "dfd",
"template_json": "{\"name\":\"gaoyang\"}",
"template_read": 23,
"product": 1
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求消息提示 |
id | 整型 | 模板主键 id |
template_name | 字符串 | 模板名称 |
template_json | json 字符串 | 下发指令模板 |
template_read | 整型 | 是否可更改;0代表 template_json 只读,反之可编辑 |
product | 整型 | 产品主键 |
PUT /product/template/detail/[ID]
{
"template_name": "sdfghjk",
"template_json": "{\"name\":\"gaoyang\"}",
"template_read": 0,
"product": 1
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
ID | 整型 | 是 | 模板主键 |
template_name | 字符串 | 是 | 模板名称 |
template_json | json 字符串 | 是 | 下发指令模板 |
template_read | 整型 | 是 | 模板是否只读;0代表template_json只读,反之可编辑 |
product | 整型 | 必须 | 产品主键 |
{
"meta": {
"code" : 0,
"message" : "update success"
},
"data": {
"id": 1234,
"template_name": "sdfghjk",
"template_json": "{\"name\":\"gaoyang\"}",
"template_read": 0,
"product": 1
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求消息提示 |
data | json | 编辑后的模板信息 |
DELETE /product/template/detail/[ID]
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
ID | 整型 | 是 | 模板主键 |
* 请求回调
{
"meta": {
"code" : 0,
"message" : "delete success"
},
"data": {}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求消息提示 |
GET /product/template/[ID]
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
ID | 整型 | 是 | 产品主键 |
{
"meta": {
"code": 0,
"message": "find success"
},
"data": {
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"template_name": "dfd",
"template_json": "123",
"template_read": 23,
"product": 1
}
]
}
}
参数 | 类型 | 说明 |
---|---|---|
code | 整型 | 错误码;0代表正确,反之错误 |
message | 字符串 | 请求提示 |
count | 整型 | 数据总条数 |
next | 字符串 | 下一页的链接 |
previous | 字符串 | 上一页的链接 |
results | 数组 | 数据列表 |
id | 整型 | 模板主键 |
template_name | 字符串 | 模板名称 |
template_json | 字符串json | 下发指令模板 |
template_read | 整型 | 是否可更改;0代表 template_json 只读,反之可编辑 |
product | 整型 | 产品主键 |
数据列表一页显示10条