Fix getGroupHasDeviceTypes API

pull/2/head
Arshana 2 years ago
parent 350f39c036
commit 56a46bc21d

@ -1193,7 +1193,7 @@ public interface GroupManagementService {
boolean requireGroupProps); boolean requireGroupProps);
@Path("/device-types") @Path("/device-types")
@GET @POST
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = HTTPConstants.HEADER_GET, httpMethod = HTTPConstants.HEADER_GET,
@ -1242,9 +1242,8 @@ public interface GroupManagementService {
Response getGroupHasDeviceTypes( Response getGroupHasDeviceTypes(
@ApiParam( @ApiParam(
name = "identifiers", name = "identifiers",
value = "list of identifiers.", value = "GET list of identifiers.",
required = true) required = true)
@QueryParam("identifiers")
List<String> identifiers); List<String> identifiers);
} }

@ -67,6 +67,7 @@ import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import javax.ws.rs.DefaultValue; import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@ -430,12 +431,10 @@ public class GroupManagementServiceImpl implements GroupManagementService {
} }
} }
@GET @POST
@Path("/device-types") @Path("/device-types")
@Override @Override
public Response getGroupHasDeviceTypes(@QueryParam("identifiers") List<String> identifiers) { public Response getGroupHasDeviceTypes(List<String> identifiers) {
try { try {
DeviceTypesOfGroups deviceTypesOfGroups = DeviceMgtAPIUtils.getGroupManagementProviderService() DeviceTypesOfGroups deviceTypesOfGroups = DeviceMgtAPIUtils.getGroupManagementProviderService()
.getDeviceTypesOfGroups(identifiers); .getDeviceTypesOfGroups(identifiers);
@ -446,8 +445,6 @@ public class GroupManagementServiceImpl implements GroupManagementService {
log.error(msg, e); log.error(msg, e);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
} }
} }
} }

@ -336,5 +336,11 @@ public interface GroupManagementProviderService {
*/ */
boolean isDeviceMappedToGroup(int groupId, DeviceIdentifier deviceIdentifier) throws GroupManagementException; boolean isDeviceMappedToGroup(int groupId, DeviceIdentifier deviceIdentifier) throws GroupManagementException;
/**
*
* @param identifiers identifiers of groups
* @return whether the groups has android, iOS, Windows device types
* @throws GroupManagementException
*/
DeviceTypesOfGroups getDeviceTypesOfGroups(List<String> identifiers) throws GroupManagementException; DeviceTypesOfGroups getDeviceTypesOfGroups(List<String> identifiers) throws GroupManagementException;
} }

Loading…
Cancel
Save