Package org.ctan.site.resources.admin
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 Summary
ConstructorsConstructorDescriptionCrudVote3Resource(@NonNull VoteStore store) This is the constructor for the classCrudVote3Resource. -
Method Summary
Modifier and TypeMethodDescriptionThe methodcreateprovides an end-point to create a vote.The methodgetprovides means to retrieve a vote.The methodlistprovides means to retrieve a page of users.booleanThe methodremoveprovides an end-point to remove a vote.
-
Constructor Details
-
CrudVote3Resource
This is the constructor for the classCrudVote3Resource.- Parameters:
store- the underlying store
-
-
Method Details
-
create
The methodcreateprovides 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 methodgetprovides means to retrieve a vote.- Parameters:
id- the id- Returns:
trueiff 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 methodlistprovides means to retrieve a page of users.- Parameters:
q- the name patternpage- the pagesize- the page sizeorderBy- the orderasc- 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 methodremoveprovides an end-point to remove a vote.- Parameters:
id- the id- Returns:
trueiff the user has existed
-