CommentManagementAPIImpl

CommentManagementAPIImpl class moved to store/api/services/impl directory.
feature/appm-store/pbac
nishadi 7 years ago
parent b60f3f0a9e
commit ef059800e2

@ -16,14 +16,15 @@
* under the License. * under the License.
* *
*/ */
package org.wso2.carbon.device.application.mgt.api.services.impl; package org.wso2.carbon.device.application.mgt.store.api.services.impl;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.application.mgt.api.APIUtil; import org.wso2.carbon.device.application.mgt.store.api.APIUtil;
import org.wso2.carbon.device.application.mgt.api.services.CommentManagementAPI; import org.wso2.carbon.device.application.mgt.store.api.services.CommentManagementAPI;
import org.wso2.carbon.device.application.mgt.common.Comment; import org.wso2.carbon.device.application.mgt.common.Comment;
import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.PaginationRequest;
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
@ -77,7 +78,7 @@ public class CommentManagementAPIImpl implements CommentManagementAPI {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR) return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
.entity(" Internal server error occurs").build(); .entity(" Internal server error occurs").build();
} }
return Response.status(Response.Status.OK).entity(comments).build(); return null;
} }
@Override @Override
@ -89,9 +90,8 @@ public class CommentManagementAPIImpl implements CommentManagementAPI {
@PathParam("uuid") String uuid) { @PathParam("uuid") String uuid) {
CommentsManager commentsManager = APIUtil.getCommentsManager(); CommentsManager commentsManager = APIUtil.getCommentsManager();
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
try { try {
Comment newComment = commentsManager.addComment(comment, uuid, tenantId); Comment newComment = commentsManager.addComment(comment, uuid);
if (comment != null) { if (comment != null) {
return Response.status(Response.Status.CREATED).entity(newComment).build(); return Response.status(Response.Status.CREATED).entity(newComment).build();
} else { } else {
Loading…
Cancel
Save