# **公共接口说明**
* * * * *
## **接口与接口说明**
1. 添加留言板信息
2. 获取留言板信息
3. 获取用户未读的信息数量
## 添加留言板信息
> >可能返回的错误码:998,1006,1021
+++
post: Api/MessageBoard/addMessageBoard?token=用户token
*content=留言内容 #
*img=图片【json格式】最多上传三张 #
<<<
success
返回参数说明:
currentTime : 服务器当前时间。用于判断留言板是什么时候发布的
{
"data": {
"0": {
"portrait": "",
"level": "0",
"name": "",
"content": "33333",
"image_data_id": [
{
"img": "image/201601211234451234.png"
},
{
"img": "image/201601211234451235.png"
},
{
"img": "image/201609272110489834.png"
}
],
"release_time": "1484981557"
},
"18": {
"portrait": "",
"level": "0",
"name": "",
"content": "1111",
"image_data_id": [
{
"img": "image/201601211234451234.png"
},
{
"img": "image/201601211234451235.png"
},
{
"img": "image/201609272110489834.png"
}
],
"release_time": "1484970694"
},
"currentTime": 1484981557 // 服务器当前时间
},
"info": "添加成功。",
"code": 1000,
"state": 1
}
<<<
error
{
"data": "",
"info": "只能输入1到200个字符。",
"code": 1006,
"state": 2
}
可能返回的错误:
代号 错误
998 添加失败
999 用户未登录
1006 输入的信息不符合
1021 留言板最多只能添加3张图片
+++
## 获取留言板信息
+++
get: Api/MessageBoard/getMessageBoard
<<<
success
返回参数说明:
currentTime : 服务器当前时间。用于判断留言板是什么时候发布的
{
"data": {
"0": {
"portrait": "",
"level": "0",
"name": "",
"content": "33333",
"image_data_id": [
{
"img": "image/201601211234451234.png"
},
{
"img": "image/201601211234451235.png"
},
{
"img": "image/201609272110489834.png"
}
],
"release_time": "1484981557"
},
"18": {
"portrait": "",
"level": "0",
"name": "",
"content": "1111",
"image_data_id": [
{
"img": "image/201601211234451234.png"
},
{
"img": "image/201601211234451235.png"
},
{
"img": "image/201609272110489834.png"
}
],
"release_time": "1484970694"
},
"currentTime": 1484981557 // 服务器当前时间
},
"info": "添加成功。",
"code": 1000,
"state": 1
}
+++
## 获取用户未读的信息数量
> >可能返回的错误码:998,1006,1021
+++
get:Api/MessageBoard/getUnreadNum?token=用户token
<<<
success
返回参数说明:
num : 未读数量
{
"data": {
"num": 2
},
"info": "查询成功",
"code": 1000,
"state": 1
}
<<<
error
{
"data": "",
"info": "您还未登录。",
"code": 999,
"state": 2
}
可能返回的错误:
代号 错误
999 用户未登录
1029 未登录无法获取未读信息
+++