Class CrudVote3Resource

java.lang.Object
org.ctan.site.resources.admin.CrudVote3Resource

@Path("/3.0/admin") @Produces("application/json") @RolesAllowed("ADMIN") public class CrudVote3Resource extends Object
The class CrudVote3Resource contains the CRUD controller for the vote resource.
  • Constructor Details

    • CrudVote3Resource

      public CrudVote3Resource(@NonNull @NonNull VoteStore store)
      This is the constructor for the class CrudVote3Resource.
      Parameters:
      store - the underlying store
  • Method Details

    • create

      @POST @Path("/vote") @UnitOfWork("siteDb") public Vote create(@NonNull @NonNull Vote vote)
      The method create provides an end-point to create a vote.
      Parameters:
      vote - the vote object to store
      Returns:
      the updated entity
    • get

      @GET @Path("/vote/{id}") @UnitOfWork("siteDb") public Vote get(@NonNull @PathParam("id") @NonNull Long id)
      The method get provides means to retrieve a vote.
      Parameters:
      id - the id
      Returns:
      true iff the vote exists
    • list

      @GET @Path("/votes") @UnitOfWork("siteDb") public GeneralPage list(@QueryParam("q") String q, @QueryParam("page") int page, @QueryParam("size") int size, @QueryParam("order") String orderBy, @QueryParam("asc") boolean asc)
      The method list provides means to retrieve a page of users.
      Parameters:
      q - the name pattern
      page - the page
      size - the page size
      orderBy - the order
      asc - the indicator for ascending
      Returns:
      the page for the user or null
    • remove

      @DELETE @Path("/vote/{id}") @UnitOfWork("siteDb") public boolean remove(@NonNull @PathParam("id") @NonNull Long id)
      The method remove provides an end-point to remove a vote.
      Parameters:
      id - the id
      Returns:
      true iff the user has existed