Commit 7571fc14 by gdj

增加deviceInfoApi,放行

parent 2cf2c60f
......@@ -34,6 +34,7 @@ public class GlobalMVCConfigurer implements WebMvcConfigurer {
excludePaths.add("/swagger-ui/**");
excludePaths.add("/v3/**");
excludePaths.add("/ui/**");
excludePaths.add("/" + managePrefix + manageVersion + "/devices/**/deviceInfo");
// Intercept for all request interfaces.
registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns(excludePaths);
}
......
......@@ -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.
* @param workspaceId
* @param page
......@@ -239,6 +252,24 @@ public class DeviceController {
deviceService.deleteDevice(deviceSn);
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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment