parent
a8135f4b54
commit
d41bb15bfa
|
@ -0,0 +1,568 @@
|
||||||
|
# 处置模块接口协议
|
||||||
|
## 登录
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/auth/login
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604296988,"msgContent":"{\"password\":\"c3855e6b6bb120450f160ba91134522868f89d36062f2061ebeefd80817e1d58\",\"userName\":\"admin\"}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604296988,
|
||||||
|
"msgContent": "{\"password\":\"c3855e6b6bb120450f160ba91134522868f89d36062f2061ebeefd80817e1d58\",\"userName\":\"admin\"}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604297140,"code":200,"msgContent":"{\"userName\":\"admin\",\"token\":\"b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e\",\"logTime\":1587604297140,\"expireTime\":1587607897140,\"status\":0}"}
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604297140,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"userName\":\"admin\",\"token\":\"b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e\",\"logTime\":1587604297140,\"expireTime\":1587607897140,\"status\":0}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 注销
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/auth/logout
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604300195,"msgContent":"{\"userName\":\"admin\"}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604300195,
|
||||||
|
"msgContent": "{\"userName\":\"admin\"}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604300216,"code":200,"msgContent":"{\"userName\":\"admin\",\"status\":0,\"message\":\"成功\"}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604300216,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"userName\":\"admin\",\"status\":0,\"message\":\"成功\"}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 添加节点
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/manager/device
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587628826908,"msgContent":"{\"items\":[{\"areaCode\":0,\"ipAddr\":\"10.88.77.15\",\"manufacturer\":\"DPTech\",\"model\":\"UMC\",\"name\":\"中移杭研实验室清洗设备\",\"readme\":\"实验室测试设备\",\"type\":0,\"version\":\"5.7.13\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587628826908,
|
||||||
|
"msgContent": "{\"items\":[{\"areaCode\":0,\"ipAddr\":\"10.88.77.15\",\"manufacturer\":\"DPTech\",\"model\":\"UMC\",\"name\":\"中移杭研实验室清洗设备\",\"readme\":\"实验室测试设备\",\"type\":0,\"version\":\"5.7.13\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587628827102,"code":200,"msgContent":"{\"result\":[{\"ipAddr\":\"10.88.77.15\",\"devId\":\"245\",\"status\":20,\"message\":\"设备已经存在\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587628827102,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"result\":[{\"ipAddr\":\"10.88.77.15\",\"devId\":\"245\",\"status\":20,\"message\":\"设备已经存在\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 删除节点
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/manager/device
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604308040,"msgContent":"{\"id\":[\"0\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604308040,
|
||||||
|
"msgContent": "{\"id\":[\"0\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604308056,"code":200,"msgContent":"[{\"id\":\"0\",\"status\":19,\"message\":\"没有这个设备\"}]"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604308056,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "[{\"id\":\"0\",\"status\":19,\"message\":\"没有这个设备\"}]"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取节点版本信息
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/information/version
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604310504,"msgContent":"{\"id\":[\"242\",\"123\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604310504,
|
||||||
|
"msgContent": "{\"id\":[\"242\",\"123\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604310520,"code":200,"msgContent":"[{\"id\":\"242\",\"version\":\"Virtual_Device_1.0.0\",\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"status\":19,\"message\":\"没有这个设备\"}]"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604310520,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "[{\"id\":\"242\",\"version\":\"Virtual_Device_1.0.0\",\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"status\":19,\"message\":\"没有这个设备\"}]"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取设备信息
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/information/deviceinfo
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604315683,"msgContent":"{\"id\":[\"242\",\"123\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604315683,
|
||||||
|
"msgContent": "{\"id\":[\"242\",\"123\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604315699,"code":200,"msgContent":"{\"items\":[{\"id\":\"242\",\"vendor\":\"Virtual\",\"model\":\"Dispose_1000\",\"firmware\":\"Unknown\",\"os\":\"Unknown\",\"kernel\":\"Linux\",\"arch\":\"x86_64\",\"memory\":-1,\"freeMemory\":-1,\"cpuUsed\":-1,\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"memory\":0,\"freeMemory\":0,\"cpuUsed\":0,\"status\":19,\"message\":\"没有这个设备\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604315699,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"items\":[{\"id\":\"242\",\"vendor\":\"Virtual\",\"model\":\"Dispose_1000\",\"firmware\":\"Unknown\",\"os\":\"Unknown\",\"kernel\":\"Linux\",\"arch\":\"x86_64\",\"memory\":-1,\"freeMemory\":-1,\"cpuUsed\":-1,\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"memory\":0,\"freeMemory\":0,\"cpuUsed\":0,\"status\":19,\"message\":\"没有这个设备\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取链接状态
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/information/linkstatus
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604339955,"msgContent":"{\"id\":[\"242\",\"123\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604339955,
|
||||||
|
"msgContent": "{\"id\":[\"242\",\"123\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604339971,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "[{\"id\":\"242\",\"online\":1,\"status\":0,\"message\":\"成功\"},{\"online\":0,\"status\":19,\"message\":\"没有这个设备\"}]"
|
||||||
|
}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604339971,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "[{\"id\":\"242\",\"online\":1,\"status\":0,\"message\":\"成功\"},{\"online\":0,\"status\":19,\"message\":\"没有这个设备\"}]"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取节点能力信息
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/information/capacity
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604320678,"msgContent":"{\"id\":[\"242\",\"123\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604320678,
|
||||||
|
"msgContent": "{\"id\":[\"242\",\"123\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604320693,"code":200,"msgContent":"{\"items\":[{\"id\":\"242\",\"capacity\":[{\"type\":0,\"tolCapacity\":1024,\"usedCapacity\":0},{\"type\":3,\"tolCapacity\":0,\"usedCapacity\":0}],\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"status\":19,\"message\":\"没有这个设备\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604320693,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"items\":[{\"id\":\"242\",\"capacity\":[{\"type\":0,\"tolCapacity\":1024,\"usedCapacity\":0},{\"type\":3,\"tolCapacity\":0,\"usedCapacity\":0}],\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"status\":19,\"message\":\"没有这个设备\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取节点防护IP
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/information/protected_ip
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604325494,"msgContent":"{\"id\":[\"242\",\"123\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"cmdId": 204,
|
||||||
|
"ver": 1,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1585289549836,
|
||||||
|
"msgContent": "{\"id\":[\"1\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604325510,"code":200,"msgContent":"{\"items\":[{\"id\":\"242\",\"capacity\":[{\"type\":0,\"disposeIp\":\"192.168.1.1,192.168.1.2\"},{\"type\":3,\"disposeIp\":\"192.168.2.1,192.168.2.2\"}],\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"status\":19,\"message\":\"没有这个设备\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604325510,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"items\":[{\"id\":\"242\",\"capacity\":[{\"type\":0,\"disposeIp\":\"192.168.1.1,192.168.1.2\"},{\"type\":3,\"disposeIp\":\"192.168.2.1,192.168.2.2\"}],\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"status\":19,\"message\":\"没有这个设备\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取能力节点列表
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/information/node_list
|
||||||
|
Request URI|dispose/information/node_list
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604330447,"msgContent":"{\"id\":[\"242\",\"123\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604330447,
|
||||||
|
"msgContent": "{\"id\":[\"242\",\"123\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604330462,"code":200,"msgContent":"{\"items\":[{\"id\":\"242\",\"type\":0,\"name\":\"中移杭研实验室清洗设备\",\"ip\":\"10.88.77.15\",\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"type\":0,\"status\":19,\"message\":\"没有这个设备\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604330462,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"items\":[{\"id\":\"242\",\"type\":0,\"name\":\"中移杭研实验室清洗设备\",\"ip\":\"10.88.77.15\",\"status\":0,\"message\":\"成功\"},{\"id\":\"123\",\"type\":0,\"status\":19,\"message\":\"没有这个设备\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取能力节点详细信息
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/information/node_details
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604330447,"msgContent":"{\"id\":[\"242\",\"123\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604330447,
|
||||||
|
"msgContent": "{\"id\":[\"242\",\"123\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604335156,"code":200,"msgContent":"{\"items\":[{\"id\":\"242\",\"type\":0,\"name\":\"中移杭研实验室清洗设备\",\"ip\":\"10.88.77.15\",\"areaCode\":0,\"manufacturer\":\"DPTech\",\"model\":\"UMC\",\"version\":\"Virtual_Device_1.0.0\",\"readme\":\"实验室测试设备\",\"status\":0,\"message\":\"成功\",\"capacity\":[{\"type\":0,\"disposeIp\":\"192.168.1.1,192.168.1.2\",\"tolCapacity\":1024,\"usedCapacity\":0},{\"type\":3,\"disposeIp\":\"192.168.2.1,192.168.2.2\",\"tolCapacity\":0,\"usedCapacity\":0}]},{\"id\":\"123\",\"type\":0,\"status\":19,\"message\":\"没有这个设备\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604335156,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"items\":[{\"id\":\"242\",\"type\":0,\"name\":\"中移杭研实验室清洗设备\",\"ip\":\"10.88.77.15\",\"areaCode\":0,\"manufacturer\":\"DPTech\",\"model\":\"UMC\",\"version\":\"Virtual_Device_1.0.0\",\"readme\":\"实验室测试设备\",\"status\":0,\"message\":\"成功\",\"capacity\":[{\"type\":0,\"disposeIp\":\"192.168.1.1,192.168.1.2\",\"tolCapacity\":1024,\"usedCapacity\":0},{\"type\":3,\"disposeIp\":\"192.168.2.1,192.168.2.2\",\"tolCapacity\":0,\"usedCapacity\":0}]},{\"id\":\"123\",\"type\":0,\"status\":19,\"message\":\"没有这个设备\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 启动处置任务
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/task/start
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604357152,"msgContent":"{\"disposeIp\":\"192.168.0.1\",\"disposeTime\":0,\"id\":210,\"type\":0}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604357152,
|
||||||
|
"msgContent": "{\"disposeIp\":\"192.168.0.1\",\"disposeTime\":0,\"id\":210,\"type\":0}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604357152,"code":200,"msgContent":"{\"taskId\":\"210\",\"expireTime\":0,\"status\":0,\"message\":\"成功\"}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604357152,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"taskId\":\"210\",\"expireTime\":0,\"status\":0,\"message\":\"成功\"}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 停止指定处置任务
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/task/stop
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604347877,"msgContent":"{\"taskId\":[\"1\",\"2\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604347877,
|
||||||
|
"msgContent": "{\"taskId\":[\"1\",\"2\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604347877,"code":200,"msgContent":"{\"result\":[{\"taskId\":\"1\",\"status\":0,\"message\":\"成功\"},{\"taskId\":\"2\",\"status\":0,\"message\":\"成功\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604347877,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"result\":[{\"taskId\":\"1\",\"status\":0,\"message\":\"成功\"},{\"taskId\":\"2\",\"status\":0,\"message\":\"成功\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 停止某处置IP处置任务
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/task/stop_ip
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604345160,"msgContent":"{\"items\":[{\"id\":\"210\",\"type\":0,\"disposeIp\":\"192.168.1.1\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604345160,
|
||||||
|
"msgContent": "{\"items\":[{\"id\":\"210\",\"type\":0,\"disposeIp\":\"192.168.1.1\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604345194,"code":200,"msgContent":"{\"result\":[{\"id\":\"210\",\"type\":0,\"status\":0,\"message\":\"成功\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604345194,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"result\":[{\"id\":\"210\",\"type\":0,\"status\":0,\"message\":\"成功\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 停止指定能力节点全部处置任务
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/task/stop_node
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604354810,"msgContent":"{\"items\":[{\"id\":\"210\",\"type\":0}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604354810,
|
||||||
|
"msgContent": "{\"items\":[{\"id\":\"210\",\"type\":0}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604354810,"code":200,"msgContent":"{\"result\":[{\"id\":\"210\",\"type\":0,\"status\":0,\"message\":\"成功\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604354810,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"result\":[{\"id\":\"210\",\"type\":0,\"status\":0,\"message\":\"成功\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 停止全部处置任务
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/task/stop_all
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604352531,"msgContent":"{\"items\":[{\"type\":0}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604352531,
|
||||||
|
"msgContent": "{\"items\":[{\"type\":0}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604352547,"code":200,"msgContent":"{\"result\":[{\"type\":0,\"status\":0,\"message\":\"成功\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604352547,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"result\":[{\"type\":0,\"status\":0,\"message\":\"成功\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取指定能力节点全部处置任务
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/task/get_node
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604359568,"msgContent":"{\"taskId\":[\"1\",\"2\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604359568,
|
||||||
|
"msgContent": "{\"taskId\":[\"1\",\"2\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604359583,"code":200,"msgContent":"{\"result\":[{\"taskId\":\"1\",\"status\":0,\"message\":\"成功\"},{\"taskId\":\"2\",\"status\":0,\"message\":\"成功\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604359583,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"result\":[{\"taskId\":\"1\",\"status\":0,\"message\":\"成功\"},{\"taskId\":\"2\",\"status\":0,\"message\":\"成功\"}]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 获取处置任务详细信息
|
||||||
|
+ 请求命令
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Request URI|dispose/task/get
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Authorization|"Bearer b8f01b8303cd9fcb7d3c9ed1b1c54d4a6e04bac3a66ab7df6ba81f690882ca2e"
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604350194,"msgContent":"{\"taskId\":[\"1\",\"2\"]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604350194,
|
||||||
|
"msgContent": "{\"taskId\":[\"1\",\"2\"]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
+ 响应消息
|
||||||
|
字段|内容
|
||||||
|
----|----
|
||||||
|
Content type|application/json;charset=UTF-8
|
||||||
|
Body|{"ver":2,"cryptoType":0,"timeStamp":1587604350194,"code":200,"msgContent":"{\"result\":[{\"taskId\":\"1\",\"status\":0,\"message\":\"成功\"},{\"taskId\":\"2\",\"status\":0,\"message\":\"成功\"}]}"}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ver": 2,
|
||||||
|
"cryptoType": 0,
|
||||||
|
"timeStamp": 1587604359583,
|
||||||
|
"code": 200,
|
||||||
|
"msgContent": "{\"result\":[{\"taskId\":\"1\",\"status\":0,\"message\":\"成功\"},{\"taskId\":\"2\",\"status\":0,\"message\":\"成功\"}]}"
|
||||||
|
}
|
||||||
|
```
|
|
@ -77,7 +77,6 @@ public class DisposeNodeManagerController {
|
||||||
|
|
||||||
reqInfo.getItems().forEach(v -> {
|
reqInfo.getItems().forEach(v -> {
|
||||||
DisposeDevice dev = DisposeDevice.builder()
|
DisposeDevice dev = DisposeDevice.builder()
|
||||||
.id(Long.valueOf(v.getId()))
|
|
||||||
.type(v.getType())
|
.type(v.getType())
|
||||||
.name(v.getName())
|
.name(v.getName())
|
||||||
.ipAddr(v.getIpAddr())
|
.ipAddr(v.getIpAddr())
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.springframework.stereotype.Component;
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class UserAccountCacheManagerImpl implements UserAccountCacheManager {
|
public class UserAccountCacheManagerImpl implements UserAccountCacheManager {
|
||||||
private static final Random randomGen = new Random(System.currentTimeMillis());
|
private static final Random RANDOM_GEN = new Random(System.currentTimeMillis());
|
||||||
private final ConcurrentHashMap<String, UserAccountCache> userAccountCache = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, UserAccountCache> userAccountCache = new ConcurrentHashMap<>();
|
||||||
@Resource
|
@Resource
|
||||||
private DisposeConfigure disposeConfigure;
|
private DisposeConfigure disposeConfigure;
|
||||||
|
@ -177,7 +177,7 @@ public class UserAccountCacheManagerImpl implements UserAccountCacheManager {
|
||||||
.token("")
|
.token("")
|
||||||
.lastAccess(System.currentTimeMillis())
|
.lastAccess(System.currentTimeMillis())
|
||||||
.pwdErrTimes(0)
|
.pwdErrTimes(0)
|
||||||
.lastAccess(System.currentTimeMillis()).build();
|
.build();
|
||||||
|
|
||||||
userAccountCache.put(uc.getToken(), uc);
|
userAccountCache.put(uc.getToken(), uc);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -252,7 +252,7 @@ public class UserAccountCacheManagerImpl implements UserAccountCacheManager {
|
||||||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); // 此处的sha代表sha1
|
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); // 此处的sha代表sha1
|
||||||
|
|
||||||
String tokenKey = username +
|
String tokenKey = username +
|
||||||
Convert.toStr(randomGen.nextInt()) +
|
Convert.toStr(RANDOM_GEN.nextInt()) +
|
||||||
Convert.toStr(System.currentTimeMillis());
|
Convert.toStr(System.currentTimeMillis());
|
||||||
// 调用digest方法,进行加密操作
|
// 调用digest方法,进行加密操作
|
||||||
byte[] cipherBytes = messageDigest.digest(tokenKey.getBytes());
|
byte[] cipherBytes = messageDigest.digest(tokenKey.getBytes());
|
||||||
|
|
|
@ -87,9 +87,7 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager {
|
||||||
|
|
||||||
DisposeDevice dev = disposeDevMap.get(ipAddr);
|
DisposeDevice dev = disposeDevMap.get(ipAddr);
|
||||||
|
|
||||||
try {
|
if(dev == null) {
|
||||||
dp = DeviceRouter.deviceRouterFactory(dev.getType(), ipAddr, ConstValue.IPAddrType.getIpAddrType(ipAddr));
|
|
||||||
} catch (Exception ex) {
|
|
||||||
return ErrorCode.ERR_NOSUCHDEVICE;
|
return ErrorCode.ERR_NOSUCHDEVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,15 +111,17 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager {
|
||||||
dp = DeviceRouter.deviceRouterFactory(dev.getType(),
|
dp = DeviceRouter.deviceRouterFactory(dev.getType(),
|
||||||
dev.getIpAddr(), ConstValue.IPAddrType.getIpAddrType(dev.getIpAddr()));
|
dev.getIpAddr(), ConstValue.IPAddrType.getIpAddrType(dev.getIpAddr()));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return new MReturnType<>(ErrorCode.ERR_NOSUCHDEVICE, dev.getIpAddr());
|
return new MReturnType<>(ErrorCode.ERR_NOSUCHDEVICE, String.valueOf(-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disposeDeviceMapper.isDeviceExistsByIp(dev.getIpAddr()) > 0) {
|
DisposeDevice dbDev = disposeDeviceMapper.getDeviceByIp(dev.getIpAddr());
|
||||||
return new MReturnType<>(ErrorCode.ERR_DEVICEEXISTS, dev.getIpAddr());
|
|
||||||
|
if (dbDev != null) {
|
||||||
|
return new MReturnType<>(ErrorCode.ERR_DEVICEEXISTS, String.valueOf(dbDev.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dp.getDeviceLinkStatus()) {
|
if (!dp.getDeviceLinkStatus()) {
|
||||||
return new MReturnType<>(ErrorCode.ERR_NOSUCHDEVICE, dev.getIpAddr());
|
return new MReturnType<>(ErrorCode.ERR_NOSUCHDEVICE, String.valueOf(-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev.getDevCaps() == null) {
|
if (dev.getDevCaps() == null) {
|
||||||
|
@ -135,7 +135,7 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager {
|
||||||
disposeDeviceMapper.addNewDisposeDevice(dev);
|
disposeDeviceMapper.addNewDisposeDevice(dev);
|
||||||
|
|
||||||
disposeDevMap.put(dev.getIpAddr(), dev);
|
disposeDevMap.put(dev.getIpAddr(), dev);
|
||||||
return new MReturnType<>(ErrorCode.ERR_OK, dev.getIpAddr());
|
return new MReturnType<>(ErrorCode.ERR_OK, dev.getId().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -318,7 +318,6 @@ public class DeviceNodeInfoControllerTest extends InitTestEnvironment {
|
||||||
@Test
|
@Test
|
||||||
public void t5_getDisposeNodeList() throws Exception {
|
public void t5_getDisposeNodeList() throws Exception {
|
||||||
IDArrayReq reqData = IDArrayReq.builder()
|
IDArrayReq reqData = IDArrayReq.builder()
|
||||||
.id(new String[]{String.valueOf(getExistsDeviceId()), "123"})
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
ProtocolReqDTO reqInfo = new ProtocolReqDTO();
|
ProtocolReqDTO reqInfo = new ProtocolReqDTO();
|
||||||
|
|
|
@ -50,7 +50,6 @@ public class DeviceNodeManagerControllerTest extends InitTestEnvironment {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
addReq.getItems().add(NewNodeInfo.builder()
|
addReq.getItems().add(NewNodeInfo.builder()
|
||||||
.id("0")
|
|
||||||
.ipAddr("10.88.77.15")
|
.ipAddr("10.88.77.15")
|
||||||
.type(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode())
|
.type(ConstValue.DisposeDeviceType.DPTECH_UMC.getCode())
|
||||||
.areaCode(0)
|
.areaCode(0)
|
||||||
|
|
Loading…
Reference in New Issue