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
7571fc14
Commit
7571fc14
authored
Jul 21, 2025
by
gdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加deviceInfoApi,放行
parent
2cf2c60f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
sample/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java
+1
-0
sample/src/main/java/com/dji/sample/manage/controller/DeviceController.java
+31
-0
No files found.
sample/src/main/java/com/dji/sample/configuration/mvc/GlobalMVCConfigurer.java
View file @
7571fc14
...
@@ -34,6 +34,7 @@ public class GlobalMVCConfigurer implements WebMvcConfigurer {
...
@@ -34,6 +34,7 @@ public class GlobalMVCConfigurer implements WebMvcConfigurer {
excludePaths
.
add
(
"/swagger-ui/**"
);
excludePaths
.
add
(
"/swagger-ui/**"
);
excludePaths
.
add
(
"/v3/**"
);
excludePaths
.
add
(
"/v3/**"
);
excludePaths
.
add
(
"/ui/**"
);
excludePaths
.
add
(
"/ui/**"
);
excludePaths
.
add
(
"/"
+
managePrefix
+
manageVersion
+
"/devices/**/deviceInfo"
);
// Intercept for all request interfaces.
// Intercept for all request interfaces.
registry
.
addInterceptor
(
authInterceptor
).
addPathPatterns
(
"/**"
).
excludePathPatterns
(
excludePaths
);
registry
.
addInterceptor
(
authInterceptor
).
addPathPatterns
(
"/**"
).
excludePathPatterns
(
excludePaths
);
}
}
...
...
sample/src/main/java/com/dji/sample/manage/controller/DeviceController.java
View file @
7571fc14
...
@@ -74,6 +74,19 @@ public class DeviceController {
...
@@ -74,6 +74,19 @@ public class DeviceController {
}
}
/**
/**
* Obtain device information according to device sn.
* @param workspaceId
* @param deviceSn
* @return
*/
@GetMapping
(
"/{workspace_id}/deviceInfo"
)
public
HttpResultResponse
getDeviceInfo
(
@PathVariable
(
"workspace_id"
)
String
workspaceId
,
@RequestParam
(
"device_sn"
)
String
deviceSn
)
{
Optional
<
DeviceDTO
>
deviceOpt
=
deviceService
.
getDeviceBySn
(
deviceSn
);
return
deviceOpt
.
isEmpty
()
?
HttpResultResponse
.
error
(
"device not found."
)
:
HttpResultResponse
.
success
(
deviceOpt
.
get
());
}
/**
* Get the binding devices list in one workspace.
* Get the binding devices list in one workspace.
* @param workspaceId
* @param workspaceId
* @param page
* @param page
...
@@ -239,6 +252,24 @@ public class DeviceController {
...
@@ -239,6 +252,24 @@ public class DeviceController {
deviceService
.
deleteDevice
(
deviceSn
);
deviceService
.
deleteDevice
(
deviceSn
);
return
HttpResultResponse
.
success
();
return
HttpResultResponse
.
success
();
}
}
/**
* Get the binding devices list in one workspace.
* @param workspaceId
* @param page
* @param pageSize
* @return
*/
@GetMapping
(
"/{workspace_id}/devices/noWorkspaceList"
)
public
HttpResultResponse
<
PaginationData
<
DeviceDTO
>>
getNoWorkspaceDevices
(
@PathVariable
(
"workspace_id"
)
String
workspaceId
,
@RequestParam
(
value
=
"domain"
,
required
=
false
)
Integer
domain
,
@RequestParam
(
value
=
"device_name"
,
required
=
false
)
String
deviceName
,
@RequestParam
(
defaultValue
=
"1"
)
Long
page
,
@RequestParam
(
value
=
"page_size"
,
defaultValue
=
"50"
)
Long
pageSize
)
{
PaginationData
<
DeviceDTO
>
devices
=
deviceService
.
getNoWorkspaceDevices
(
workspaceId
,
deviceName
,
page
,
pageSize
,
domain
);
return
HttpResultResponse
.
success
(
devices
);
}
/**
/**
* Removing the device.
* Removing the device.
...
...
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