[TOC=2]
## 枚舉變量
### 所在位置:( position )
| 可選值 | 說明 |
| --- | --- |
| top | 頂部 |
| center | 中間 |
| bottom | 底部 |
## baner列表
~~~[api]
get:/banner/list
<<<
success
{
"code": 0,
"data": {
"list": [
{
"id": 1,
"title": "111",//標題
"img": "https://www.baidu.com",//圖片地址
"url": "https://www.baidu.com",//連接地址
"is_enable": true,//是否顯示 true 顯示 false 不顯示
"page": "index",//所在頁面
"position": "top",//所在位置
"create_time": "2018-05-16 09:41:47"//創建時間
}
]
}
}
~~~
## 修改查詢
~~~[api]
get:/banner/edit
*int:id=0#banner id
<<<
success
// 正確id返回
{
"code": 0,
"data": {
"id": 1,
"title": "111",//標題
"img": "https://www.baidu.com",//圖片地址
"url": "https://www.baidu.com",//鏈接地址
"is_enable": true,//是否顯示 true 顯示 false 不顯示
"page": "index",//所在頁面
"position": "top",//所在位置 見枚舉變量
"create_time": "2018-05-16 09:41:47"//創建時間
}
}
<<<
success
// id 不存在返回
{
"code": 0
}
~~~
## 新增、修改
~~~[api]
post:/banner/saveData
int:id=0#banner id
*string:title=標題#標題
*string:img=http://www.baidu.com#圖片地址
*string:url=http://www.baidu.com#連接地址
*boolean:is_enable=false#是否顯示
*string:position=top#所在位置
*string:page=index#所在頁面
<<<
success
//新增返回
{
"code": 0,
"data": {
"title": "123",
"img": "https://www.baidu.com",
"url": "https://www.baidu.com",
"is_enable": true,
"position": "top",
"page": "index",
"id": 1
}
}
<<<
success
//修改返回
{
"code": 0,
"data": {
"id": 1,
"title": "111",
"img": "https://www.baidu.com",
"url": "https://www.baidu.com",
"is_enable": true,
"position": "top",
"page": "index"
}
}
<<<
error
{
"code": -1,
"msg":"參數錯誤"
}
~~~
## banner刪除
~~~[api]
post:/banner/delete
*int:id=0#banner id
<<<
success
{
"code":0,
"data":[
"id":0
]
}
~~~
## 批量刪除
~~~[api]
post:/banner/deleteBatch
*array:id_list=[1]#id 數組
<<<
success
{
"code": 0
}
~~~