|
|
@ -9,6 +9,7 @@ import org.dromara.common.satoken.utils.LoginHelper; |
|
|
|
import org.dromara.common.web.core.BaseController; |
|
|
|
import org.dromara.sample.manage.model.dto.DeviceDTO; |
|
|
|
import org.dromara.sample.manage.model.dto.DeviceFirmwareUpgradeDTO; |
|
|
|
import org.dromara.sample.manage.service.IDeviceProService; |
|
|
|
import org.dromara.sample.manage.service.IDeviceService; |
|
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -37,6 +38,10 @@ public class DeviceController { |
|
|
|
@Autowired |
|
|
|
private IDeviceService deviceService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IDeviceProService deviceProService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取一个工作区中所有在线设备的列表。 |
|
|
|
* Get the topology list of all online devices in one workspace. |
|
|
@ -45,8 +50,8 @@ public class DeviceController { |
|
|
|
@GetMapping("/{workspace_id}/devices") |
|
|
|
@Operation(summary = "获取一个工作区中所有在线设备的列表。", description = "获取一个工作区中所有在线设备的列表") |
|
|
|
public HttpResultResponse<List<DeviceDTO>> getDevices(@PathVariable("workspace_id") String workspaceId, |
|
|
|
@RequestParam(name = "nickname",required = false) String nickname) { |
|
|
|
List<DeviceDTO> devicesList = deviceService.getDevicesTopoForWeb(workspaceId,nickname); |
|
|
|
@RequestParam(name = "nickname",required = false) String nickname,@RequestParam(name = "proIds",required = false) List<Integer> proIds) { |
|
|
|
List<DeviceDTO> devicesList = deviceService.getDevicesTopoForWeb(workspaceId,nickname,proIds); |
|
|
|
return HttpResultResponse.success(devicesList); |
|
|
|
} |
|
|
|
|
|
|
@ -92,9 +97,9 @@ public class DeviceController { |
|
|
|
@PathVariable("workspace_id") String workspaceId,Integer domain, |
|
|
|
@RequestParam(name = "pageNum", defaultValue = "1") Long page, |
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Long pageSize, |
|
|
|
@RequestParam(name = "nickname",required = false) String nickname) { |
|
|
|
LoginUser loginUser = LoginHelper.getLoginUser(); |
|
|
|
PaginationData<DeviceDTO> devices = deviceService.getBoundDevicesWithDomain(workspaceId, page, pageSize, domain,nickname); |
|
|
|
@RequestParam(name = "nickname",required = false) String nickname, |
|
|
|
@RequestParam(name = "proIds",required = false) List<Integer> proIds) { |
|
|
|
PaginationData<DeviceDTO> devices = deviceService.getBoundDevicesWithDomain(workspaceId, page, pageSize, domain,nickname,proIds); |
|
|
|
|
|
|
|
return HttpResultResponse.success(devices); |
|
|
|
} |
|
|
|