Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
rx
Commits
bb165784
Commit
bb165784
authored
Aug 23, 2024
by
wujipeng
Browse files
优化接口
parent
bd2f99b8
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/rx/controller/EquipmentController.java
View file @
bb165784
...
...
@@ -25,7 +25,7 @@ public class EquipmentController {
return
Result
.
success
(
equipmentService
.
getDeviceDataByDeviceId
(
deviceId
));
}
@ApiOperation
(
value
=
"根据设备id查询设备信息"
)
@ApiOperation
(
value
=
"根据设备id查询设备信息
和最新的一条上报信息
"
)
@GetMapping
(
"/info/{deviceId}"
)
public
Result
getDeviceInfoByDeviceId
(
@PathVariable
String
deviceId
)
{
return
Result
.
success
(
equipmentService
.
getDeviceInfoByDeviceId
(
deviceId
));
...
...
src/main/java/com/ruzhoukj/rx/pojo/vo/EquipmentVO.java
View file @
bb165784
...
...
@@ -16,4 +16,7 @@ public class EquipmentVO extends EquipmentEntity {
@ApiModelProperty
(
value
=
"液位状态 0:没超过阀值 1:超过阀值"
)
private
Integer
liquidLevelStatus
;
@ApiModelProperty
(
value
=
"最新一条上报信息"
)
private
DeviceVO
deviceVO
;
}
src/main/java/com/ruzhoukj/rx/service/impl/EquipmentServiceImpl.java
View file @
bb165784
package
com.ruzhoukj.rx.service.impl
;
import
ch.qos.logback.classic.spi.EventArgUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruzhoukj.rx.common.NumberConstant
;
import
com.ruzhoukj.rx.dao.DeviceDao
;
...
...
@@ -32,7 +33,12 @@ public class EquipmentServiceImpl
@Override
public
EquipmentVO
getDeviceInfoByDeviceId
(
String
deviceId
)
{
return
baseMapper
.
getDeviceInfoByDeviceId
(
deviceId
);
EquipmentVO
equipmentVO
=
baseMapper
.
getDeviceInfoByDeviceId
(
deviceId
);
DeviceVO
deviceVO
=
deviceDao
.
findTopByDeviceIdOrderByTimestampDesc
(
deviceId
);
if
(
equipmentVO
!=
null
&&
deviceVO
!=
null
){
equipmentVO
.
setDeviceVO
(
deviceVO
);
}
return
equipmentVO
;
}
@Override
...
...
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