mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt
Adding swagger annotations to beans
This commit is contained in:
commit
6227e93d2f
@ -21,6 +21,7 @@ package org.wso2.carbon.device.mgt.jaxrs.api;
|
|||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.wso2.carbon.device.mgt.common.PaginationResult;
|
import org.wso2.carbon.device.mgt.common.PaginationResult;
|
||||||
import org.wso2.carbon.device.mgt.common.app.mgt.Application;
|
import org.wso2.carbon.device.mgt.common.app.mgt.Application;
|
||||||
|
import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.api.context.DeviceOperationContext;
|
import org.wso2.carbon.device.mgt.jaxrs.api.context.DeviceOperationContext;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.api.util.ResponsePayload;
|
import org.wso2.carbon.device.mgt.jaxrs.api.util.ResponsePayload;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.ApplicationWrapper;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.ApplicationWrapper;
|
||||||
@ -155,4 +156,19 @@ public interface Operation {
|
|||||||
"{tenantDomain}. The default tenant domain " +
|
"{tenantDomain}. The default tenant domain " +
|
||||||
"of WSO2 EMM is carbon.super.",
|
"of WSO2 EMM is carbon.super.",
|
||||||
required = true) @PathParam("tenantDomain") String tenantDomain);
|
required = true) @PathParam("tenantDomain") String tenantDomain);
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("activity/{id}")
|
||||||
|
@ApiOperation(
|
||||||
|
consumes = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML,
|
||||||
|
produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML,
|
||||||
|
httpMethod = "POST",
|
||||||
|
value = "Retrieving the operation details.",
|
||||||
|
notes = "This will return the operation details including the responses from the devices")
|
||||||
|
@ApiResponses(value = { @ApiResponse(code = 200, message = "Activity details provided successfully.."),
|
||||||
|
@ApiResponse(code = 500, message = "Error occurred while fetching the activity for the supplied id.") })
|
||||||
|
Response getActivity(@ApiParam(name = "id", value = "Provide activity id {id} as ACTIVITY_(number)",
|
||||||
|
required = true) @PathParam("id") String id)
|
||||||
|
throws MDMAPIException;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -224,4 +224,22 @@ public class OperationImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Opera
|
|||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@GET
|
||||||
|
@Path("activity/{id}")
|
||||||
|
public Response getActivity(@PathParam("id") String id)
|
||||||
|
throws MDMAPIException {
|
||||||
|
org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation;
|
||||||
|
DeviceManagementProviderService dmService;
|
||||||
|
try {
|
||||||
|
dmService = DeviceMgtAPIUtils.getDeviceManagementService();
|
||||||
|
operation = dmService.getOperationByActivityId(id);
|
||||||
|
} catch (OperationManagementException e) {
|
||||||
|
String msg = "Error occurred while fetching the activity for the supplied id.";
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new MDMAPIException(msg, e);
|
||||||
|
}
|
||||||
|
return Response.status(Response.Status.OK).entity(operation).build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user