Sync: code local unifié
Synchronisation du code source local (fait foi). Signed-off-by: lions dev Team
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package dev.lions.unionflow.server.resource.culte;
|
||||
|
||||
import dev.lions.unionflow.server.api.dto.culte.DonReligieuxDTO;
|
||||
import dev.lions.unionflow.server.service.culte.DonReligieuxService;
|
||||
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Path("/api/v1/culte/dons")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public class DonReligieuxResource {
|
||||
|
||||
@Inject
|
||||
DonReligieuxService donReligieuxService;
|
||||
|
||||
@POST
|
||||
@RolesAllowed({ "membre_actif", "admin", "admin_organisation" })
|
||||
public Response enregistrerDon(@Valid DonReligieuxDTO dto) {
|
||||
DonReligieuxDTO response = donReligieuxService.enregistrerDon(dto);
|
||||
return Response.status(Response.Status.CREATED).entity(response).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{id}")
|
||||
@RolesAllowed({ "admin", "admin_organisation", "culte_resp", "membre_actif" })
|
||||
public Response getDonById(@PathParam("id") UUID id) {
|
||||
DonReligieuxDTO response = donReligieuxService.getDonById(id);
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/organisation/{organisationId}")
|
||||
@RolesAllowed({ "admin", "admin_organisation", "culte_resp" })
|
||||
public Response getDonsByOrganisation(@PathParam("organisationId") UUID organisationId) {
|
||||
List<DonReligieuxDTO> response = donReligieuxService.getDonsByOrganisation(organisationId);
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user