change name

This commit is contained in:
Valentin CZERYBA 2023-01-16 21:29:22 +01:00
parent 981ed99434
commit f8752395d4

View File

@ -73,7 +73,7 @@ public class FriendRessources {
/// GET /// GET
@GET @GET
@RolesAllowed("Admin") @RolesAllowed("Admin")
public Response getGroups(@CookieParam("user") String userCookie, @Context SecurityContext ctx, public Response getFriends(@CookieParam("user") String userCookie, @Context SecurityContext ctx,
@QueryParam("page") Integer page, @QueryParam("nbPages") Integer nbPages) { @QueryParam("page") Integer page, @QueryParam("nbPages") Integer nbPages) {
if(nbPages == null){ if(nbPages == null){
nbPages = 20; nbPages = 20;
@ -110,7 +110,7 @@ public class FriendRessources {
@GET @GET
@RolesAllowed("Admin") @RolesAllowed("Admin")
@Path("{id}") @Path("{id}")
public Response getSingleGroup(@PathParam("id") String id, @CookieParam("user") String userCookie, public Response getSingleFriend(@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);
@ -155,7 +155,7 @@ public class FriendRessources {
@RolesAllowed({"Admin", "User"}) @RolesAllowed({"Admin", "User"})
@Path("{id}") @Path("{id}")
@Transactional @Transactional
public Response createGroup(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, FriendEntity friend) { public Response createFriend(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, FriendEntity friend) {
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);
@ -179,7 +179,7 @@ public class FriendRessources {
@Path("{id}") @Path("{id}")
@RolesAllowed({"Admin", "User"}) @RolesAllowed({"Admin", "User"})
@Transactional @Transactional
public Response changeStatusSingleGroupToDelete(@Context SecurityContext ctx, @CookieParam("user") String userCookie, public Response changeStatusSingleFriendToDelete(@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);
@ -206,7 +206,7 @@ public class FriendRessources {
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Transactional @Transactional
@Path("{id}") @Path("{id}")
public Response updateGroup(@Context SecurityContext ctx, @CookieParam("user") String userCookie, public Response updateFriend(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
FriendEntity friend, @PathParam("id") String id) { FriendEntity friend, @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);
@ -234,8 +234,4 @@ public class FriendRessources {
} }
return Response.status(status).build(); return Response.status(status).build();
} }
} }