change name function

This commit is contained in:
Valentin CZERYBA 2023-01-14 21:16:27 +01:00
parent 3881009353
commit 8aadc04fd5

View File

@ -75,7 +75,7 @@ public class EventRessources {
/// GET /// GET
@GET @GET
@RolesAllowed("Admin") @RolesAllowed("Admin")
public Response getComments(@CookieParam("user") String userCookie, @Context SecurityContext ctx, public Response getEvents(@CookieParam("user") String userCookie, @Context SecurityContext ctx,
@QueryParam("page") Integer page, @QueryParam("nbPages") Integer nbPages, @QueryParam("page") Integer page, @QueryParam("nbPages") Integer nbPages,
@QueryParam("status") Short status, @QueryParam("status") Short status,
@QueryParam("search") String search, @QueryParam("search") String search,
@ -125,7 +125,7 @@ public class EventRessources {
@GET @GET
@RolesAllowed("Admin") @RolesAllowed("Admin")
@Path("{id}") @Path("{id}")
public Response getSingleComment(@PathParam("id") String id, @CookieParam("user") String userCookie, public Response getSingleEvent(@PathParam("id") String id, @CookieParam("user") String userCookie,
@Context SecurityContext ctx) { @Context SecurityContext ctx) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid)); UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid); UsersEntity user = UsersEntity.findById(kid);
@ -149,7 +149,7 @@ public class EventRessources {
@RolesAllowed({"Admin", "User"}) @RolesAllowed({"Admin", "User"})
@Path("{id}") @Path("{id}")
@Transactional @Transactional
public Response createComment(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, EventEntity event) { public Response createEvent(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, EventEntity event) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid)); UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid); UsersEntity user = UsersEntity.findById(kid);
@ -174,7 +174,7 @@ public class EventRessources {
@Path("{id}") @Path("{id}")
@RolesAllowed({"Admin", "User"}) @RolesAllowed({"Admin", "User"})
@Transactional @Transactional
public Response changeStatusSingleCommentToDelete(@Context SecurityContext ctx, @CookieParam("user") String userCookie, public Response changeStatusSingleEventToDelete(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
@PathParam("id") String id) { @PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid)); UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid); UsersEntity user = UsersEntity.findById(kid);
@ -197,7 +197,7 @@ public class EventRessources {
@Path("/disable/{id}") @Path("/disable/{id}")
@RolesAllowed({"Admin", "User"}) @RolesAllowed({"Admin", "User"})
@Transactional @Transactional
public Response changeStatusSingleCommentToDisable(@Context SecurityContext ctx, @CookieParam("user") String userCookie, public Response changeStatusSingleEventToDisable(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
@PathParam("id") String id) { @PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid)); UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid); UsersEntity user = UsersEntity.findById(kid);
@ -222,7 +222,7 @@ public class EventRessources {
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Transactional @Transactional
@Path("{id}") @Path("{id}")
public Response updateCommentAdmin(@Context SecurityContext ctx, @CookieParam("user") String userCookie, public Response updateEvent(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
EventEntity event, @PathParam("id") String id) { EventEntity event, @PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid)); UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid); UsersEntity user = UsersEntity.findById(kid);
@ -257,7 +257,7 @@ public class EventRessources {
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Transactional @Transactional
@Path("enable/{id}") @Path("enable/{id}")
public Response enableCommentAdmin(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id) { public Response enableEvent(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid)); UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid); UsersEntity user = UsersEntity.findById(kid);
Response.Status status = getResponseCheck(ctx, userCookie, user); Response.Status status = getResponseCheck(ctx, userCookie, user);