Adding device name url param for device search

revert-70aa11f8
Ace 8 years ago
parent c323b5162e
commit 58666bc4b0

@ -96,6 +96,11 @@ public interface DeviceManagementService {
permissions = {"/permission/admin/device-mgt/admin/devices/list"} permissions = {"/permission/admin/device-mgt/admin/devices/list"}
) )
Response getDevices( Response getDevices(
@ApiParam(
name = "name",
value = "The device name, such as shamu, bullhead or angler.",
required = false)
String name,
@ApiParam( @ApiParam(
name = "type", name = "type",
value = "The device type, such as ios, android or windows.", value = "The device type, such as ios, android or windows.",

@ -62,6 +62,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
@GET @GET
@Override @Override
public Response getDevices( public Response getDevices(
@QueryParam("name") String name,
@QueryParam("type") String type, @QueryParam("type") String type,
@QueryParam("user") String user, @QueryParam("user") String user,
@QueryParam("roleName") String roleName, @QueryParam("roleName") String roleName,
@ -79,6 +80,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
PaginationResult result; PaginationResult result;
DeviceList devices = new DeviceList(); DeviceList devices = new DeviceList();
if(name != null && !name.isEmpty()){
request.setDeviceName(name);
}
if (type != null && !type.isEmpty()) { if (type != null && !type.isEmpty()) {
request.setDeviceType(type); request.setDeviceType(type);
} }

Loading…
Cancel
Save