From 4ea87284f2a6850c301c2b3bfc970788f2c7a629 Mon Sep 17 00:00:00 2001 From: nishadi Date: Thu, 18 Jan 2018 11:17:05 +0530 Subject: [PATCH] Modified CommentAPIImpl Reformatted --- .../impl/CommentManagementAPIImpl.java | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java index 05273b6979..f6d93cd9b1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/CommentManagementAPIImpl.java @@ -80,8 +80,13 @@ public class CommentManagementAPIImpl implements CommentManagementAPI { return Response.status(Response.Status.OK).entity(comments).build(); } - @Override @POST @Consumes("application/json") @Path("/{uuid}") public Response addComments( - @ApiParam Comment comment, @PathParam("uuid") String uuid) { + @Override + @POST + @Consumes("application/json") + @Path("/{uuid}") + public Response addComments( + @ApiParam Comment comment, + @PathParam("uuid") String uuid) { CommentsManager commentsManager = APIUtil.getCommentsManager(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); @@ -102,8 +107,13 @@ public class CommentManagementAPIImpl implements CommentManagementAPI { } } - @Override @PUT @Consumes("application/json") @Path("/{CommentId}") public Response updateComment( - @ApiParam Comment comment, @PathParam("CommentId") int CommentId) { + @Override + @PUT + @Consumes("application/json") + @Path("/{CommentId}") + public Response updateComment( + @ApiParam Comment comment, + @PathParam("CommentId") int CommentId) { CommentsManager commentsManager = APIUtil.getCommentsManager(); try { @@ -129,7 +139,8 @@ public class CommentManagementAPIImpl implements CommentManagementAPI { @Override @DELETE @Path("/{CommentId}") - public Response deleteComment(@PathParam("CommentId") int CommentId) { + public Response deleteComment( + @PathParam("CommentId") int CommentId) { CommentsManager commentsManager = APIUtil.getCommentsManager(); try { @@ -149,7 +160,8 @@ public class CommentManagementAPIImpl implements CommentManagementAPI { @Override @GET @Path("/{uuid}") - public Response getStars(@PathParam("uuid") String uuid) { + public Response getStars( + @PathParam("uuid") String uuid) { CommentsManager commentsManager = APIUtil.getCommentsManager(); int Stars = 0; @@ -169,7 +181,8 @@ public class CommentManagementAPIImpl implements CommentManagementAPI { @Override @GET @Path("/{uuid}") - public Response getRatedUser(@PathParam("uuid") String uuid) { + public Response getRatedUser( + @PathParam("uuid") String uuid) { CommentsManager commentsManager = APIUtil.getCommentsManager(); int ratedUsers = 0; @@ -187,7 +200,11 @@ public class CommentManagementAPIImpl implements CommentManagementAPI { return Response.status(Response.Status.OK).entity(ratedUsers).build(); } - @Override @POST @Consumes("uuid/stars/json") public Response updateStars(@ApiParam int stars, + @Override + @POST + @Consumes("uuid/stars/json") + public Response updateStars( + @ApiParam int stars, @PathParam("uuid") String uuid) { CommentsManager commentsManager = APIUtil.getCommentsManager();