change name for group resources

This commit is contained in:
Valentin CZERYBA 2023-01-15 20:44:21 +01:00
parent b597bdb255
commit 1e990820d1

View File

@ -72,7 +72,7 @@ public class GroupRessources {
/// GET
@GET
@RolesAllowed("Admin")
public Response getEvents(@CookieParam("user") String userCookie, @Context SecurityContext ctx,
public Response getGroups(@CookieParam("user") String userCookie, @Context SecurityContext ctx,
@QueryParam("page") Integer page, @QueryParam("nbPages") Integer nbPages,
@QueryParam("status") Short status,
@QueryParam("search") String search,
@ -122,7 +122,7 @@ public class GroupRessources {
@GET
@RolesAllowed("Admin")
@Path("{id}")
public Response getSingleEvent(@PathParam("id") String id, @CookieParam("user") String userCookie,
public Response getSingleGroup(@PathParam("id") String id, @CookieParam("user") String userCookie,
@Context SecurityContext ctx) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -146,7 +146,7 @@ public class GroupRessources {
@RolesAllowed({"Admin", "User"})
@Path("{id}")
@Transactional
public Response createEvent(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, GroupEntity group) {
public Response createGroup(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, GroupEntity group) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -170,7 +170,7 @@ public class GroupRessources {
@Path("{id}")
@RolesAllowed({"Admin", "User"})
@Transactional
public Response changeStatusSingleEventToDelete(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
public Response changeStatusSingleGroupToDelete(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
@PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -193,7 +193,7 @@ public class GroupRessources {
@Path("/disable/{id}")
@RolesAllowed({"Admin", "User"})
@Transactional
public Response changeStatusSingleEventToDisable(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
public Response changeStatusSingleGroupToDisable(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
@PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -218,7 +218,7 @@ public class GroupRessources {
@Consumes(MediaType.APPLICATION_JSON)
@Transactional
@Path("{id}")
public Response updateEvent(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
public Response updateGroup(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
GroupEntity group, @PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -253,7 +253,7 @@ public class GroupRessources {
@Consumes(MediaType.APPLICATION_JSON)
@Transactional
@Path("enable/{id}")
public Response enableEvent(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id) {
public Response enableGroup(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
Response.Status status = getResponseCheck(ctx, userCookie, user);
@ -269,4 +269,4 @@ public class GroupRessources {
}
return Response.status(status).build();
}
}
}