[TOC=2,3]
* * * * *
* * * * *
* * * * *
## 1. 獲取所有產品類型
+++
get:store/product_type/get_product_type
<<<
success
返回示例:
{
"status": 200,
"product_type": [
{
"p_tid": 1,
"product_type_name": "FOHEART-C1"
},
{
"p_tid": 2,
"product_type_name": "FOHEART-TLE"
}
]
}
<<<
error
返回示例:
{
status: 400,
message: "沒有產品類型!"
}
+++
* * * * *
* * * * *
* * * * *
## 2. 新增產品類型
+++
post:store/product_type/add_product_type
*string:type_name#產品類型
<<<
success
返回示例:
{
status: 200,
message: "類型添加成功!"
}
<<<
error1
返回示例:
{
status: 400,
message: "類型不能為空!"【PS:type_name為空】
}
<<<
error2
返回示例:
{
status: 400,
message: "該類型已經存在!"【PS:類型已經存在】
}
+++
* * * * *
* * * * *
* * * * *
## 3. 修改產品類型
+++
post:store/product_type/edit_product_type【獲取該類型信息】
*int:id#修改產品類型的id
<<<
success
返回示例:
{
status: 200,
id: 1,
product_type_name: "FOHEART-C1"
}
<<<
error
返回示例:
{
status: 400,
message: "沒有產品類型!"【PS:id不存在】
}
+++
* * * * *
* * * * *
* * * * *
+++
post:store/product_type/edit_product_type【提交該類型信息】
*int:id#修改產品類型的id
*string:type_name#產品類型
<<<
success
返回示例:
{
status: 200,
message: "類型修改成功!"
}
<<<
error1
返回示例:
{
status: 400,
message: "類型不能為空!"【PS:type_name為空】
}
<<<
error2
返回示例:
{
status: 400,
message: "該類型已經存在!"【PS:類型已經存在】
}
<<<
error3
返回示例:
{
status: 400,
message: "類型修改失敗!"【PS:類型修改失敗】
}
+++
* * * * *
* * * * *
* * * * *
## 4. 刪除產品類型
+++
post:store/product_type/delete_product_type
*int:id#所刪除的型號id【可選,多個id用‘逗號’分開,id='1,2,3,4'】
<<<
success
返回示例:
{
status: 200,
message: "刪除成功!"
}
<<<
error1
返回示例:
{
status: 400,
message: "該訪問方式不正確!"【非post傳值】
}
<<<
error2
返回示例:
{
status: 400,
message: "該類型下有設備禁止刪除!"【該類型下有設備】
}
<<<
error3
返回示例:
{
status: 400,
message: "沒有傳入所刪類型的id"【沒有傳入id】
}
<<<
error4
返回示例:
{
status: 400,
message: "刪除失敗!"
}
+++