设备管理平台前端接口

### 1、查询所有渠道信息 #### API地址 ###### https://{API_SERVER_ENDPOINT}/channelInfo/listAll.json ##### 请求方式 ###### Get #### 请求参数:无 ##### 响应示例: ``` {     "success": true,     "msg": "操作成功",     "code": 0,     "data": [         {             "id": 2,             "firstChannelName": "上海市",             "secChannelName": "虹口区",             "threeChannelName": "虹口",             "authKey": "3e399dd8-35f3-4254-acbd-0f5e23f93afb",             "createdBy": "system",             "createdTime": "2020-03-11T02:43:57.000+0000",             "updatedTime": "2020-03-11T02:43:57.000+0000",             "updatedBy": "system",             "deleteTag": 0         },         {             "id": 4,             "firstChannelName": "上海市",             "secChannelName": "静安区",             "threeChannelName": "静安",             "authKey": "da33d18504524fd682f4c8f6db0794071584432861513",             "createdBy": "system",             "createdTime": "2020-03-17T08:08:50.000+0000",             "updatedTime": "2020-03-17T08:08:50.000+0000",             "updatedBy": "system",             "deleteTag": 0         }     ] } ``` ### 2、通过渠道id查询关联的所有的设备类型接口 #### API地址 ###### https://{API_SERVER_ENDPOINT}/channelDevType/listDeviceType.json ##### 请求方式 ###### Get #### 请求参数 |参数名称 |约束 |类型 |描述| |:------|:------:|:------:|------:| |channelId |必填 |Integer |渠道id| #### 响应参数 |参数名称| 约束| 类型| 描述| |:------|:------:|:------:|------:| |msg |必填 |String |结果信息| |code |必填 |Integer |响应码:0成功| |data |必填 |List<Map> |结果数据:| ##### 请求示例: ``` { "channelId":"4" } ``` ##### 响应示例: ``` {     "success": true,     "msg": "操作成功",     "code": 0,     "data": [         {             "deviceType": "TemperatureHumiditySensor",             "deviceTypeName": "温湿度传感器"         },         {             "deviceType": "WeChatDoorOpen",             "deviceTypeName": "微信开门传感器"         }     ] } ``` ### 3、设备查询接口 #### API地址 ###### https://{API_SERVER_ENDPOINT}/deviceMode/listPage.json ##### 请求方式 ###### Get #### 请求参数 |参数名称 |约束 |类型 |描述| |:------|:------:|:------:|------:| |channelId |非必填 |String |渠道id| |deviceType |非必填 |String |设备类型| |pageNum |必填 |Integer| 页码数| |pageSize |必填 |Integer| 行数| #### 响应参数 |参数名称| 约束| 类型| 描述| |:------|:------:|:------:|------:| |msg |必填 |String |结果信息| |code |必填 |Integer |响应码:0成功| |data |必填 |Json |结果数据:| |list|设备数据| ##### 请求示例: ``` { "channelId":"", "deviceType":"YGA", "pageNum":0, "pageSize":10 } ``` ##### 响应示例: ``` {     "success": true,     "msg": "操作成功",     "code": 0,     "data": {         "pageNum": 0,         "pageSize": 10,         "total": 2,         "pages": 1,         "list": [             {                 "id": 3,                 "platformDeviceId": "11211583893796424",                 "deviceId": "121",                 "deviceType": "YGA",                 "channelId": 1,                 "vendor": "商户A",                 "lat": 3.5600000,                 "lng": 1.4200000,                 "address": "静安区",                 "city": "",                 "district": "",                 "town": "",                 "ptscene": "",                 "createdBy": "system",                 "createdTime": "2020-03-11T02:24:00.000+0000",                 "updatedTime": "2020-03-11T02:24:00.000+0000",                 "updatedBy": "system",                 "deleteTag": 0             },             {                 "id": 4,                 "platformDeviceId": "11221583896453587",                 "deviceId": "122",                 "deviceType": "YGA",                 "channelId": 1,                 "vendor": "商户A",                 "lat": 132.4512391,                 "lng": 42.2487817,                 "address": "静安区",                 "city": "",                 "district": "",                 "town": "",                 "ptscene": "",                 "createdBy": "system",                 "createdTime": "2020-03-11T03:08:16.000+0000",                 "updatedTime": "2020-03-11T03:08:16.000+0000",                 "updatedBy": "system",                 "deleteTag": 0             }         ],         "lastPage": false,         "firstPage": false     } } ``` ### 4、新增渠道信息接口 #### API地址 ##### https://{API_SERVER_ENDPOINT}/channelInfo/add.do #### 请求方式 ##### Post #### 请求参数 |参数名称 |约束| 类型| 描述| |:------|:------:|:------:|------:| |firstChannelName| 必填| String| 一级渠道| |secChannelName |必填 |String| 二级渠道| |threeChannelName| 必填| String| 三级渠道| #### 响应参数 |参数名称| 约束| 类型| 描述| |:------|:------:|:------:|------:| |msg |必填 |String |结果信息| |code |必填 |Integer| 响应码:0成功| |data |必填 |Json |结果数据:| |authKey|渠道接入key| #### 请求示例: ``` { "firstChannelName":"上海市", "secChannelName":"静安区", "threeChannelName":"静安" } ``` #### 响应示例: ``` {     "success": true,     "msg": "操作成功",     "code": 0,     "data": {         "id": null,         "firstChannelName": "上海市",         "secChannelName": "静安区",         "threeChannelName": "静安",         "authKey": "da33d18504524fd682f4c8f6db0794071584432861513",         "createdBy": null,         "createdTime": null,         "updatedTime": null,         "updatedBy": null,         "deleteTag": 0     } } ``` ### 5、渠道设备类型查询列表接口 #### API地址 ##### https://{API_SERVER_ENDPOINT}/channelDevType/listPage.json #### 请求方式 ##### Get #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |channelId|非必填|long|渠道号| |deviceType|非必填|String|设备类型| |pageNum |必填 |Integer |页码数| |pageSize |必填 |Integer |行数| ##### 响应参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |msg |必填 |String |结果信息| |code |必填 |Integer| 响应码:0成功| |data |必填 |Json |结果数据:| ##### 请求示例: ``` { "pageNum":"4", "pageSize":"2" } ``` ##### 响应示例: ``` {     "success": true,     "msg": "操作成功",     "code": 0,     "data": {         "pageNum": 4,         "pageSize": 2,         "total": 102,         "pages": 51,         "list": [             {                 "id": 63,                 "channelId": 2,                 "deviceType": "TrashBin",                 "deviceTypeName": "垃圾监测传感器",                 "createdBy": null,                 "createdTime": null,                 "updatedTime": "2020-03-16T07:29:03.000+0000",                 "updatedBy": null,                 "deleteTag": 0,                 "firstChannelName": "上海市",                 "secChannelName": "虹口区",                 "threeChannelName": "虹口"             },             {                 "id": 64,                 "channelId": 2,                 "deviceType": "GeomagneticSensor",                 "deviceTypeName": "地磁传感器",                 "createdBy": null,                 "createdTime": null,                 "updatedTime": "2020-03-16T07:29:03.000+0000",                 "updatedBy": null,                 "deleteTag": 0,                 "firstChannelName": "上海市",                 "secChannelName": "虹口区",                 "threeChannelName": "虹口"             }         ],         "firstPage": false,         "lastPage": false     } } ``` ### 6、渠道下新增设备类型接口 #### API地址 ##### https://{API_SERVER_ENDPOINT}/channelDevType/add.do #### 请求方式 ##### Post #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |channelId |必填 |Integer |渠道编号| |deviceType |必填 |String |设备类型| |deviceTypeName |必填 |String |设备类型名称| ##### 响应参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |msg |必填 |String |结果信息| |code |必填 |Integer| 响应码:0成功| |data |非必填 | | | #### 请求示例: ``` { "channelId":"4", "deviceType":"TemperatureHumiditySensor", "deviceTypeName":"温湿度传感器" } ``` #### 响应示例: ``` {     "success": true,     "msg": "操作成功",     "code": 0,     "data": null } ``` ### 7、登陆接口 #### API地址 ##### https://{API_SERVER_ENDPOINT}/login #### 请求方式 ##### Post #### 请求参数 ``` { "userName":"admin", "password":"admin" } ``` ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": { "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIxIn0.dQMt-whQl9DmFOo-JIupTPRKZkApwBhUjSvIRuZ9lF8", "authCheckDto": { "operatorId": 1, "username": "admin", "password": "admin", "roleId": 1, "role": "系统管理员", "pageAuthorityDtos": [ { "id": 1, "authorityName": "首页", "authorityUrl": "index", "imgUrl": "/dam/index.html", "selectImgUrl": null, "parentId": "0", "authorityType": "page" }, { "id": 2, "authorityName": "权限管理", "authorityUrl": null, "imgUrl": null, "selectImgUrl": null, "parentId": "0", "authorityType": "folder" }, { "id": 3, "authorityName": "用户管理", "authorityUrl": "/dam/operator/listPage.json", "imgUrl": null, "selectImgUrl": null, "parentId": "2", "authorityType": "page" } ] } } } ``` ### 8、角色修改 #### API地址 ##### https://{API_SERVER_ENDPOINT}/role/edit.do #### 请求方式 ##### Post #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |id|必填 |Long|角色id| |roleName|必填 |String |角色名称| |authorityIds|必填 |List<Long>|权限id| ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": null } ``` ### 9、角色新增 #### API地址 ##### https://{API_SERVER_ENDPOINT}/role/add.do #### 请求方式 ##### Post #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |roleName|必填 |String |角色名称| |authorityIds|必填 |List<Long>|权限id| ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": null } ``` ### 10、角色列表 #### API地址 ##### https://{API_SERVER_ENDPOINT}/role/listPage.json #### 请求方式 ##### Post #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |pageNum|必填 |Int|页码| |pageSize|必填 |Int|页大小| |roleName|非必填 |String|角色名称| ##### 响应参数 ``` { "success": true,     "msg": "操作成功",     "code": 0,     "data": {         "pageNum": 0,         "pageSize": 10,         "total": 2,         "pages": 1,         "list": [             {                 "id": 3,                 "roleName": "张三",                 "createBy": "121",                 "createTime": "2020-03-11T02:43:57.000+0000",                 "updateBy": "121",                 "updateTime": "2020-03-11T02:43:57.000+0000",                 "deleteTag": 0, "pageAuthorities": [ { "id": 1, "authorityName": "首页", "authorityUrl": "index", "imgUrl": "/dam/index.html", "selectImgUrl": null, "parentId": "0", "sort": "1", "authorityType": "page", "authorityDesc": "首页", "createBy": "system", "createTime": "2020-03-16T02:43:47.000+0000", "updateBy": "system", "updateTime": "2020-03-30T10:08:48.000+0000", "deleteTag": 0 } ]             },             {                 "id": 4,                 "roleName": "李四",                 "createBy": "xxx",                 "createTime": "2020-03-11T02:43:57.000+0000",                 "updateBy": "121",                 "updateTime": "2020-03-11T02:43:57.000+0000",                 "deleteTag": 0, "pageAuthorities": [ { "id": 1, "authorityName": "首页", "authorityUrl": "index", "imgUrl": "/dam/index.html", "selectImgUrl": null, "parentId": "0", "sort": "1", "authorityType": "page", "authorityDesc": "首页", "createBy": "system", "createTime": "2020-03-16T02:43:47.000+0000", "updateBy": "system", "updateTime": "2020-03-30T10:08:48.000+0000", "deleteTag": 0 } ]             }         ],         "lastPage": false,         "firstPage": false     } } ``` ### 11、平台设备类型列表 #### API地址 ##### https://{API_SERVER_ENDPOINT}/platform/list #### 请求方式 ##### Get #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |deviceType|非必填|String|设备类型| ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": [ { "id": 1, "deviceType": "WellCoverSensor", "deviceTypeName": "井盖传感器update", "createdBy": "system", "createdTime": "2020-03-19T09:39:02.000+0000", "updatedTime": "2020-03-19T09:54:24.000+0000", "updatedBy": "system", "deleteTag": 0 } ] } ``` ### 12、平台设备类型新增 #### API地址 ##### https://{API_SERVER_ENDPOINT}/platform/add #### 请求方式 ##### POST #### 请求参数 { "deviceType": "StuffGeolocating", "deviceTypeName": "人员定位设备" } ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": null } ``` ### 13、平台设备类型修改 #### API地址 ##### https://{API_SERVER_ENDPOINT}/platform/update #### 请求方式 ##### POST #### 请求参数 { "id":2, "deviceType": "StuffGeolocating1", "deviceTypeName": "人员定位设备test" } ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": null } ``` ### 14、平台设备类型删除 #### API地址 ##### https://{API_SERVER_ENDPOINT}/platform/delete #### 请求方式 ##### POST #### 请求参数 { "id":2 } ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": null } ``` ### 15、获取所有权限 #### API地址 ##### https://{API_SERVER_ENDPOINT}/authority/getAllPageAuthoritys.json #### 请求方式 ##### GET #### 请求参数 无 ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": [ { "id":1, "authorityName":"操作员管理", "authorityUrl":"/operator/listPage.json", "parentId":0, "sort":1, "authorityType":page }, { "id":2, "authorityName":"操作员新增", "authorityUrl":"/operator/add.do", "parentId":1, "sort":1, "authorityType":button } ] } ``` ### 16、权限新增 #### API地址 ##### https://{API_SERVER_ENDPOINT}/authority/add.do #### 请求方式 ##### POST #### 请求参数 { "authorityName":"xxx", "authorityUrl":"xxx/xxx.do", "imgUrl":"sdsdsds", "selectImgUrl":"sdsdsd", "parentId":1, "authorityType":"button" } ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": { "id":5, "authorityName":"xxx", "authorityUrl":"xxx/xxx.do", "imgUrl":"sdsdsds", "selectImgUrl":"sdsdsd", "parentId":1, "authorityType":"button" } } ``` ### 17、权限编辑 #### API地址 ##### https://{API_SERVER_ENDPOINT}/authority/edit.do #### 请求方式 ##### POST #### 请求参数 { "id":5, "authorityName":"xxx", "authorityUrl":"xxx/xxx.do", "imgUrl":"sdsdsds", "selectImgUrl":"sdsdsd", "parentId":1, "authorityType":"button" } ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": null } ``` ### 18、权限删除 #### API地址 ##### https://{API_SERVER_ENDPOINT}/authority/del.do #### 请求方式 ##### POST #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |pageAuthorityId|必填 |Int|权限id| ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": null } ``` ### 19、设备在线率查询 #### API地址 ##### https://{API_SERVER_ENDPOINT}/deviceMode/countAllChannelOnline #### 请求方式 ##### GET #### 请求参数 |参数名称 |约束 |类型 |描述| |:------:|:------:|:------:|------:| |无| ##### 响应参数 ``` { "success": true, "msg": "操作成功", "code": 0, "data": [ { "threeChannelName": "AAA", "firstChannelName": "A", "online": 0.0, "channelId": 1, "secChannelName": "AA" }, { "threeChannelName": "虹口", "firstChannelName": "上海市", "online": 0.375, "channelId": 2, "secChannelName": "虹口区" } ] } ```