Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-platform
Commits
113039e7
Commit
113039e7
authored
Jun 21, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备站点名称
parent
dd9f1b35
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
1 deletion
+81
-1
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+4
-1
doc/api.md
doc/api.md
+77
-0
No files found.
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
113039e7
...
...
@@ -94,9 +94,12 @@ public class DeviceController extends BaseCRUDJsonMappingController<DeviceServic
this
.
addDict
(
model
,
"status"
,
paramService
.
getParamBySecondOrganize
(
"Device"
,
"status"
));
this
.
addDict
(
model
,
"deviceFirmId"
,
firmService
.
find
(
new
FirmQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getFirmName
())));
this
.
addDict
(
model
,
"deviceSource"
,
paramService
.
getParamBySecondOrganize
(
"Device"
,
"deviceSource"
));
Map
<
Boolean
,
Long
>
collect
=
this
.
service
.
find
(
new
DeviceQuery
()).
stream
().
collect
(
Collectors
.
partitioningBy
(
item
->
(
item
.
getDeviceOnlineStatus
()
==
DeviceOnlineStatusEnum
.
在线
.
getValue
()),
Collectors
.
counting
()));
List
<
DeviceEntity
>
deviceEntityList
=
this
.
service
.
find
(
new
DeviceQuery
());
Map
<
Boolean
,
Long
>
collect
=
deviceEntityList
.
stream
().
collect
(
Collectors
.
partitioningBy
(
item
->
(
item
.
getDeviceOnlineStatus
()
==
DeviceOnlineStatusEnum
.
在线
.
getValue
()),
Collectors
.
counting
()));
model
.
put
(
"totalCount"
,
deviceEntityList
.
size
());
model
.
put
(
"onlineCount"
,
collect
.
get
(
true
));
model
.
put
(
"offlineCount"
,
collect
.
get
(
false
));
model
.
put
(
"warnCount"
,
0
);
super
.
init
(
request
,
response
,
form
,
model
,
context
);
}
...
...
doc/api.md
0 → 100644
View file @
113039e7
## 服务接口
### 查询设备列表
**URL:**
http://localhost:8080/m/device/list
**Type:**
POST
**Content-Type:**
application/x-www-form-urlencoded;charset=utf-8
**Description:**
查询设备列表
**Query-parameters:**
参数名称|类型|备注|必填|其它
---|---|---|---|---
pageInfo|object|分页对象|否|-
└─prePageResult|Integer|每页条数|否|-
└─currPage|Integer|当前页|否|-
query|object|查询对象|否|-
└─deviceCode|String|设备编码|否|前后添加%%模糊查询
└─siteName|String|站点名称|否|前后添加%%模糊查询
└─deviceType|Integer|设备类型|否|来源dict中信息
└─deviceOnlineStatus|Integer|设备状态|否|来源dict中信息
**请求样例:**
```
curl -X POST -i http://localhost:8080/m/device/list --data 'query.id=1'
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(0.失败,1.成功)|-
msg|String|消息|-
data|object|数据对象|-
└─result|array|结果集列表|数组
└─pageInfo|object|分页对象|-
└─dict|object|字典对象|-
└─deviceType|object|字典属性对象,详见附录|-
└─deviceOnlineStatus|object|字典属性对象,详见附录|-
└─status|object|字典属性对象,详见附录|-
└─deviceFirmId|object|字典属性对象,详见附录|-
└─totalCount|object|字典属性对象,详见附录|-
└─onlineCount|object|字典属性对象,详见附录|-
└─offlineCount|object|字典属性对象,详见附录|-
└─warnCount|object|字典属性对象,详见附录|-
└─query|object|查询时候返回的查询列表参数对象|-
**响应消息样例:**
```
{
"code":1,
"data":{
"result":[
{
"appId":6,
"businessName":"device",
}
],
"pageInfo":{
"currPage":1,
"prePageResult":200,
"totalPage":1,
"totalResult":16
},
"dict":{
"dividedTableType":{
"0":"无",
"1":"日"
}
}
},
"query":{
"appId":6
}
}
```
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment