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 methodcreate
provides an end-point to create a vote.The methodget
provides means to retrieve a vote.The methodlist
provides means to retrieve a page of users.boolean
The methodremove
provides 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 methodcreate
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 methodget
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 methodlist
provides 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 methodremove
provides an end-point to remove a vote.- Parameters:
id
- the id- Returns:
true
iff the user has existed
-