[TOC=2]
## 枚舉變量
### 接收用戶類型:( receiver_type )
| 可選值 | 說明 |
| --- | --- |
| admin | 后臺管理 |
| user | 前端用戶 |
| store | 門店 |
| community | 小區 |
### 接收用戶群組:( receiver_group )
| 可選值 | 說明 |
| --- | --- |
| personal | 個人 |
| admin | 管理 |
| store | 門店 |
| community | 小區 |
| all | 全體用戶 |
## 站內信列表
>[danger] 1. 站內信列表沒有設計到分頁,不用分頁參數
>2. 取消息是否已讀,建議用 loadsh 來取,默認為 false 未讀。 因為有些消息是群發的,和個人消息沒有什么關聯。
~~~[api]
get:/message/list
<<<
success
{
"code": 0,
"data": {
"list": [
{
"id": 2,
"title": "群發消息",//消息標題
"content": "群發內容",//消息內容
"receiver_group": "user",//接收消息用戶組
"creator_type": "admin",//發送消息類型
"creator_id": 1,//發送消息人id
"link": "",//消息連接地址
"create_time": "2018-04-24 10:55:28"//發送時間
},
{
"is_read": false,//是否已讀 false 未讀 true 已讀
"message_id": 1,// 消息id
"create_time": "2018-04-24 10:55:23",//發送時間
"title": "測試消息",//消息標題
"content": "測試內容",//消息內容
"link": "",//連接地址
"id": 1//消息id
}
]
}
}
~~~
## 獲取未讀數
~~~[api]
get:/message/getUnread
<<<
success
{
"code": 0,
"data": {
"number": 2
}
}
~~~
## 設置已讀
>[danger] 若 message_id 的值為 0 或者 不傳 message_id 則表示全部設置為已讀
>相反 有值的話,則設置當前 message_id 為已讀
~~~[api]
post:/message/read
int:message_id=0#消息列表id
<<<
success
{
"code": 0
}
~~~
## 刪除
>[danger] 若 message_id 的值為 0 或者 不傳 message_id 則表示全部刪除
>相反 有值的話,則刪除當前 message_id 的消息
~~~[api]
post:/message/delete
int:message_id=0#消息列表id
<<<
success
{
"code": 0
}
~~~