change name function for comment resources

This commit is contained in:
Valentin CZERYBA 2023-01-09 22:10:48 +01:00
parent fecd1799a2
commit f6018542cd

View File

@ -70,7 +70,7 @@ public class CommentRessources {
/// GET
@GET
@RolesAllowed("Admin")
public Response getPublishers(@CookieParam("user") String userCookie, @Context SecurityContext ctx,
public Response getComments(@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 CommentRessources {
@GET
@RolesAllowed("Admin")
@Path("{id}")
public Response getSinglePublisher(@PathParam("id") String id, @CookieParam("user") String userCookie,
public Response getSingleComment(@PathParam("id") String id, @CookieParam("user") String userCookie,
@Context SecurityContext ctx) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -147,7 +147,7 @@ public class CommentRessources {
@RolesAllowed({"Admin", "User"})
@Path("{id}")
@Transactional
public Response createPublisher(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, CommentEntity comment) {
public Response createComment(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, CommentEntity comment) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -176,7 +176,7 @@ public class CommentRessources {
@Path("{id}")
@RolesAllowed({"Admin", "User"})
@Transactional
public Response changeStatusSinglePublisherToDelete(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
public Response changeStatusSingleCommentToDelete(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
@PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -202,7 +202,7 @@ public class CommentRessources {
@Path("/disable/{id}")
@RolesAllowed({"Admin", "User"})
@Transactional
public Response changeStatusSinglePublisherToDisable(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
public Response changeStatusSingleCommentToDisable(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
@PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -230,7 +230,7 @@ public class CommentRessources {
@Consumes(MediaType.APPLICATION_JSON)
@Transactional
@Path("{id}")
public Response updatePublisherAdmin(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
public Response updateCommentAdmin(@Context SecurityContext ctx, @CookieParam("user") String userCookie,
CommentEntity comment, @PathParam("id") String id) {
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
UsersEntity user = UsersEntity.findById(kid);
@ -267,7 +267,7 @@ public class CommentRessources {
@Consumes(MediaType.APPLICATION_JSON)
@Transactional
@Path("enable/{id}")
public Response enableUserAdmin(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id) {
public Response enableCommentAdmin(@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);