应急api

1
外网: http://111.198.29.129:8001     局域网: http:192.168.0.7:8001

目录:

1、注册

2、登录

3、修改用户名

4、修改头像

5、添加标记

6、删除标记

7、删除所有标记

8、修改标记

9、查询标记

10、推送内容和修改推送内容

11、查询推送内容

12、websocket

接口列表:

1、注册

请求URL:

1
http://111.198.29.129:8001/user/register

请求方式:

1
POST

参数类型:

参数 是否必选 类型 说明
phone Y string 手机号
password Y string 密码
username Y string 用户名

返回示例:

1
2
3
4
5
6
7
8
9
10
{
"code": 200,
"data": {
"_id": "5bdc1f30810e0613012ee6df",
"phone": "15515001500",
"password": "123",
"username": "15115001500"
},
"msg": "注册成功!"
}

2、登录

请求URL:

1
http://111.198.29.129:8001/user/login

请求方式:

1
POST

参数类型:

参数 是否必选 类型 说明
phone Y string 手机号
password Y string 密码

返回示例:

1
2
3
4
5
6
7
8
9
10
11
{
"code": 200,
"data": {
"_id": "5bd128fb7fd11131588cf068",
"phone": "15115001500",
"password": "123456",
"username": "15115001500",
"token": "564546554564"
},
"msg": "登录成功!"
}

3、修改用户名

请求URL:

1
http://111.198.29.129:8001/user/rename/:userId

示例:

1
http://111.198.29.129:8001/user/rename/5bd128fb7fd11131588cf068

请求方式:

1
POST

参数类型:param

参数 是否必选 类型 说明
username Y string 用户名

返回示例:

1
2
3
4
5
6
7
8
9
10
11
{
"code": 200,
"data": {
"_id": "5bd128fb7fd11131588cf068",
"phone": "15115001500",
"password": "123456",
"username": "15115001500",
"token": "564546554564"
},
"msg": "修改成功!"
}

4、修改头像

请求URL:

1
http://111.198.29.129:8001/user/avatar/:userId

示例:

http://111.198.29.129:8001/user/avatar/5bd128fb7fd11131588cf068

请求方式:

1
POST

参数类型:param

参数 是否必选 类型 说明
avatar Y file 图片

返回示例:

1
2
3
4
5
6
7
8
9
10
11
12
{
"code": 200,
"data": {
"avatar": "http://111.198.29.129:8001/images/187613da20c304f80b64b47fe86cdfd4.jpg",
"_id": "5bd128fb7fd11131588cf068",
"phone": "15115001500",
"password": "123456",
"username": "15115001500",
"token": "564546554564"
},
"msg": "修改成功!"
}

5、添加标记

请求URL:

1
http://111.198.29.129:8001/sign/add

请求方式:

1
POST

参数类型:

参数 是否必选 类型 说明
userId Y string 用户ID
name N string 标记名称
address N string 地址
temperature N number 温度
dampness N number 湿度
type N string 类型
latgitude Y number 纬度
longitude Y number 经度
userName Y string 采集人
describe Y string 描述
status N number(0/1) 状态
pic N file 上传图片
dataSource Y number(0/1) 来源
id Y string 客户端的id
ampLat Y string 纬度
ampLng Y string 经度

返回示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"code": 200,
"data": {
"_id": "5bdc1b33810e0613012ee6dd",
"userId": "5bd128fb7fd11131588cf0681",
"latgitude": 39.90469,
"longitude": 116.407173,
"userName": "wwsdf",
"describe": "1234568",
"address": "aaa1111"
},
"msg": "添加成功!"
}

6、删除标记

请求URL:

1
http://111.198.29.129:8001/sign/delete/:signId

示例:

http://111.198.29.129:8001/sign/delete/5bdc0a79562d527dd0fe1c1d

请求方式:

1
DELETE

参数类型:param

参数 是否必选 类型 说明
signId Y string 标记ID

返回示例:

1
2
3
4
5
6
7
8
{
"code": 200,
"data": {
"n": 1,
"ok": 1
},
"msg": "删除成功!"
}

7、删除所有标记

请求URL:

1
http://111.198.29.129:8001/sign/deleteAll/:userId

示例:

http://111.198.29.129:8001/sign/deleteAll/5bd128fb7fd11131588cf0681

请求方式:

1
DELETE

参数类型:param

参数 是否必选 类型 说明
userId Y string 用户ID

返回示例:

1
2
3
4
5
6
7
8
{
"code": 200,
"data": {
"n": 3,
"ok": 1
},
"msg": "删除成功!"
}

8、修改标记

请求URL:

1
http://111.198.29.129:8001/sign/update/

请求方式:

1
POST

参数类型:

参数 是否必选 类型 说明
userId Y string 用户ID
name N string 标记名称
address N string 地址
temperature N number 温度
dampness N number 湿度
type N string 类型
latgitude Y number 纬度
longitude Y number 经度
userName Y string 采集人
describe Y string 描述
status N number(0/1) 状态
pic N file 上传图片
dataSource Y number(0/1) 来源
id Y string 客户端的id
ampLat Y string 纬度
ampLng Y string 经度

返回示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"code": 200,
"data": {
"_id": "5bdc25b3c5317b13b99383f1",
"userId": "5bd128fb7fd11131588cf0681",
"latgitude": 39.90469,
"longitude": 116.407173,
"userName": "wwsdf",
"describe": "1234568",
"address": "sss",
"name": "1111",
"temperature": 111
},
"msg": "修改成功!"
}

9、查询标记

请求URL:

1
http://111.198.29.129:8001/sign/history/

示例:

http://111.198.29.129:8001/sign/history/5bd128fb7fd11131588cf0681?pageSize=10&page=1

请求方式:

1
GET

参数类型:param+query

参数 是否必选 类型 说明
userId Y string 用户ID
page N number 页数(默认第1页)
pageSize N number 每页个数(默认10个)

返回示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"code": 200,
"data": [
{
"_id": "5bdc25b3c5317b13b99383f1",
"userId": "5bd128fb7fd11131588cf0681",
"latgitude": 39.90469,
"longitude": 116.407173,
"userName": "wwsdf",
"describe": "1234568",
"address": "aaa1111"
}
],
"msg": "查询成功!"
}

10、推送内容和修改推送内容

请求URL:

1
http://111.198.29.129:8001/push/all

请求方式:

1
POST

参数类型:query

参数 是否必选 类型 说明
value Y string 推送内容
id N string 修改内容的id

返回示例:

1
2
3
4
{
"sendno": "1",
"msg_id": "1109414512"
}

11、查询推送内容

请求URL:

1
http://111.198.29.129:8001/push/history

示例:

localhost:8001/push/history?pageSize=10&page=1

请求方式:

1
POST

参数类型:query

参数 是否必选 类型 说明
page N number 页数(默认第1页)
pageSize N number 每页个数(默认10个)

返回示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"code": 200,
"data": [
{
"_id": "5bfbc2dfffc7983568cb1db8",
"content": "4",
"issueDate": "2018-11-26 17:54:38"
},
{
"_id": "5bfbc2e1ffc7983568cb1db9",
"content": "4",
"issueDate": "2018-11-26 17:54:41"
},
{
"_id": "5bfbc2e5ffc7983568cb1dba",
"content": "3",
"issueDate": "2018-11-26 17:54:45"
}
],
"msg": "查询成功!"
}

12、websocket

请求URL:

1
ws://111.198.29.129:8001/ws/position

推荐文章