Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeoFlyApi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GeoFly
GeoFlyApi
Commits
85ec5535
Commit
85ec5535
authored
Apr 22, 2025
by
gdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加机场和无人机查询接口。
parent
49328e57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
0 deletions
+68
-0
sample/src/main/java/com/dji/sample/manage/controller/DeviceController.java
+18
-0
sample/src/main/java/com/dji/sample/manage/service/IDeviceService.java
+10
-0
sample/src/main/java/com/dji/sample/manage/service/impl/DeviceServiceImpl.java
+40
-0
No files found.
sample/src/main/java/com/dji/sample/manage/controller/DeviceController.java
View file @
85ec5535
...
...
@@ -253,4 +253,21 @@ public class DeviceController {
return
HttpResultResponse
.
success
();
}
/**
* Get the binding devices list in one workspace.
* @param workspaceId
* @param page
* @param pageSize
* @return
*/
@GetMapping
(
"/{workspace_id}/devices/DockAndDroneList"
)
public
HttpResultResponse
<
PaginationData
<
DeviceDTO
>>
getDockAndDrone
(
@PathVariable
(
"workspace_id"
)
String
workspaceId
,
@RequestParam
(
defaultValue
=
"1"
)
Long
page
,
@RequestParam
(
name
=
"page_size"
,
defaultValue
=
"50"
)
Long
pageSize
)
{
PaginationData
<
DeviceDTO
>
devices
=
deviceService
.
getDockAndDrone
(
workspaceId
,
page
,
pageSize
);
return
HttpResultResponse
.
success
(
devices
);
}
}
\ No newline at end of file
sample/src/main/java/com/dji/sample/manage/service/IDeviceService.java
View file @
85ec5535
...
...
@@ -244,4 +244,13 @@ public interface IDeviceService {
boolean
editAirport
(
DeviceDTO
airport
);
/**
* Get the devices list in one workspace.
* @param workspaceId
* @param page
* @param pageSize
* @return
*/
PaginationData
<
DeviceDTO
>
getDockAndDrone
(
String
workspaceId
,
Long
page
,
Long
pageSize
);
}
\ No newline at end of file
sample/src/main/java/com/dji/sample/manage/service/impl/DeviceServiceImpl.java
View file @
85ec5535
...
...
@@ -962,4 +962,43 @@ public class DeviceServiceImpl implements IDeviceService {
return
update
>
0
;
}
/**
* Get the devices list in one workspace.
* @param workspaceId
* @param page
* @param pageSize
* @return
*/
@Override
public
PaginationData
<
DeviceDTO
>
getDockAndDrone
(
String
workspaceId
,
Long
page
,
Long
pageSize
)
{
LambdaQueryWrapper
<
DeviceEntity
>
wrapper
=
new
LambdaQueryWrapper
<
DeviceEntity
>()
.
eq
(
DeviceEntity:
:
getWorkspaceId
,
workspaceId
);
// if (StringUtils.hasText(deviceName)) {
// wrapper.like(DeviceEntity::getDeviceName, deviceName);
// }
wrapper
.
in
(
DeviceEntity:
:
getDomain
,
DeviceDomainEnum
.
DOCK
.
getDomain
(),
DeviceDomainEnum
.
DRONE
.
getDomain
());
Page
<
DeviceEntity
>
pagination
=
mapper
.
selectPage
(
new
Page
<>(
page
,
pageSize
),
wrapper
);
List
<
DeviceDTO
>
devicesList
=
pagination
.
getRecords
().
stream
().
map
(
this
::
deviceEntityConvertToDTO
)
.
peek
(
device
->
{
if
(
StringUtils
.
hasText
(
device
.
getDeviceSn
()))
{
device
.
setStatus
(
deviceRedisService
.
checkDeviceOnline
(
device
.
getDeviceSn
()));
}
if
(
StringUtils
.
hasText
(
device
.
getChildDeviceSn
()))
{
Optional
<
DeviceDTO
>
childOpt
=
this
.
getDeviceBySn
(
device
.
getChildDeviceSn
());
childOpt
.
ifPresent
(
child
->
{
child
.
setStatus
(
deviceRedisService
.
checkDeviceOnline
(
child
.
getDeviceSn
()));
child
.
setWorkspaceName
(
device
.
getWorkspaceName
());
device
.
setChildren
(
child
);
});
}
})
.
collect
(
Collectors
.
toList
());
return
new
PaginationData
<
DeviceDTO
>(
devicesList
,
new
Pagination
(
pagination
.
getCurrent
(),
pagination
.
getSize
(),
pagination
.
getTotal
()));
}
}
\ 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