|
|
@ -80,8 +80,13 @@ public class CommentManagementAPIImpl implements CommentManagementAPI {
|
|
|
|
return Response.status(Response.Status.OK).entity(comments).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(comments).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override @POST @Consumes("application/json") @Path("/{uuid}") public Response addComments(
|
|
|
|
@Override
|
|
|
|
@ApiParam Comment comment, @PathParam("uuid") String uuid) {
|
|
|
|
@POST
|
|
|
|
|
|
|
|
@Consumes("application/json")
|
|
|
|
|
|
|
|
@Path("/{uuid}")
|
|
|
|
|
|
|
|
public Response addComments(
|
|
|
|
|
|
|
|
@ApiParam Comment comment,
|
|
|
|
|
|
|
|
@PathParam("uuid") String uuid) {
|
|
|
|
|
|
|
|
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
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(
|
|
|
|
@Override
|
|
|
|
@ApiParam Comment comment, @PathParam("CommentId") int CommentId) {
|
|
|
|
@PUT
|
|
|
|
|
|
|
|
@Consumes("application/json")
|
|
|
|
|
|
|
|
@Path("/{CommentId}")
|
|
|
|
|
|
|
|
public Response updateComment(
|
|
|
|
|
|
|
|
@ApiParam Comment comment,
|
|
|
|
|
|
|
|
@PathParam("CommentId") int CommentId) {
|
|
|
|
|
|
|
|
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -129,7 +139,8 @@ public class CommentManagementAPIImpl implements CommentManagementAPI {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@DELETE
|
|
|
|
@DELETE
|
|
|
|
@Path("/{CommentId}")
|
|
|
|
@Path("/{CommentId}")
|
|
|
|
public Response deleteComment(@PathParam("CommentId") int CommentId) {
|
|
|
|
public Response deleteComment(
|
|
|
|
|
|
|
|
@PathParam("CommentId") int CommentId) {
|
|
|
|
|
|
|
|
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -149,7 +160,8 @@ public class CommentManagementAPIImpl implements CommentManagementAPI {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
@Path("/{uuid}")
|
|
|
|
@Path("/{uuid}")
|
|
|
|
public Response getStars(@PathParam("uuid") String uuid) {
|
|
|
|
public Response getStars(
|
|
|
|
|
|
|
|
@PathParam("uuid") String uuid) {
|
|
|
|
|
|
|
|
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
int Stars = 0;
|
|
|
|
int Stars = 0;
|
|
|
@ -169,7 +181,8 @@ public class CommentManagementAPIImpl implements CommentManagementAPI {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
@Path("/{uuid}")
|
|
|
|
@Path("/{uuid}")
|
|
|
|
public Response getRatedUser(@PathParam("uuid") String uuid) {
|
|
|
|
public Response getRatedUser(
|
|
|
|
|
|
|
|
@PathParam("uuid") String uuid) {
|
|
|
|
|
|
|
|
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
int ratedUsers = 0;
|
|
|
|
int ratedUsers = 0;
|
|
|
@ -187,7 +200,11 @@ public class CommentManagementAPIImpl implements CommentManagementAPI {
|
|
|
|
return Response.status(Response.Status.OK).entity(ratedUsers).build();
|
|
|
|
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) {
|
|
|
|
@PathParam("uuid") String uuid) {
|
|
|
|
|
|
|
|
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|
CommentsManager commentsManager = APIUtil.getCommentsManager();
|
|
|
|