Compare commits
No commits in common. "11c8437eb015ff5fee21e22d465beb1407ea947e" and "14420e101e81687eeda0cbef56cb18fc097b0c8e" have entirely different histories.
11c8437eb0
...
14420e101e
@ -24,8 +24,6 @@ public class EventEntity extends PanacheMongoEntity {
|
|||||||
|
|
||||||
public Collection<String> interesses;
|
public Collection<String> interesses;
|
||||||
|
|
||||||
public Collection<String> publication;
|
|
||||||
|
|
||||||
public String reservation;
|
public String reservation;
|
||||||
|
|
||||||
public Confidentialite confidentialite;
|
public Confidentialite confidentialite;
|
||||||
|
@ -17,8 +17,6 @@ public class GroupEntity extends PanacheMongoEntity {
|
|||||||
|
|
||||||
public Collection<String> membres;
|
public Collection<String> membres;
|
||||||
|
|
||||||
public Collection<String> publication;
|
|
||||||
|
|
||||||
public LocalDateTime created_at;
|
public LocalDateTime created_at;
|
||||||
public LocalDateTime updated_at;
|
public LocalDateTime updated_at;
|
||||||
public LocalDateTime deleted_at;
|
public LocalDateTime deleted_at;
|
||||||
|
@ -270,31 +270,4 @@ public class EventRessources {
|
|||||||
}
|
}
|
||||||
return Response.status(status).build();
|
return Response.status(status).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch
|
|
||||||
|
|
||||||
@PATCH
|
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
|
||||||
@RolesAllowed({"Admin", "User"})
|
|
||||||
@Path("{id}")
|
|
||||||
@Transactional
|
|
||||||
public Response createPublishers(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, @PathParam("publisher") String publisher) {
|
|
||||||
|
|
||||||
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
|
|
||||||
UsersEntity user = UsersEntity.findById(kid);
|
|
||||||
Response.Status status = getResponseCheck(ctx, userCookie, user);
|
|
||||||
if (status.equals(Response.Status.OK)) {
|
|
||||||
EventEntity singleEvent = EventEntity.find("id", new ObjectId(id)).firstResult();
|
|
||||||
status = Response.Status.NOT_FOUND;
|
|
||||||
if(singleEvent != null){
|
|
||||||
status = Response.Status.NOT_MODIFIED;
|
|
||||||
if(singleEvent.publication.add(publisher)){
|
|
||||||
singleEvent.updated_at = LocalDateTime.now();
|
|
||||||
singleEvent.persist();
|
|
||||||
status = Response.Status.CREATED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Response.status(status).build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -164,33 +164,6 @@ public class GroupRessources {
|
|||||||
return Response.status(status).entity(newGroup).build();
|
return Response.status(status).entity(newGroup).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch
|
|
||||||
|
|
||||||
@PATCH
|
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
|
||||||
@RolesAllowed({"Admin", "User"})
|
|
||||||
@Path("{id}")
|
|
||||||
@Transactional
|
|
||||||
public Response createPublishers(@Context SecurityContext ctx, @CookieParam("user") String userCookie, @PathParam("id") String id, @PathParam("publisher") String publisher) {
|
|
||||||
|
|
||||||
UUID kid = UUID.fromString(jwt.getClaim(Claims.kid));
|
|
||||||
UsersEntity user = UsersEntity.findById(kid);
|
|
||||||
Response.Status status = getResponseCheck(ctx, userCookie, user);
|
|
||||||
if (status.equals(Response.Status.OK)) {
|
|
||||||
GroupEntity singleGroup = GroupEntity.find("id", new ObjectId(id)).firstResult();
|
|
||||||
status = Response.Status.NOT_FOUND;
|
|
||||||
if(singleGroup != null){
|
|
||||||
status = Response.Status.NOT_MODIFIED;
|
|
||||||
if(singleGroup.publication.add(publisher)){
|
|
||||||
singleGroup.updated_at = LocalDateTime.now();
|
|
||||||
singleGroup.persist();
|
|
||||||
status = Response.Status.CREATED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Response.status(status).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// DELETE
|
// DELETE
|
||||||
@DELETE
|
@DELETE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user