feat: club membre export

This commit is contained in:
2025-06-20 16:31:35 +02:00
parent e18ed652f0
commit 17fea2272f
6 changed files with 448 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package fr.titionfire.ffsaf.rest;
import fr.titionfire.ffsaf.domain.service.MembreService;
import fr.titionfire.ffsaf.rest.data.SimpleMembre;
import fr.titionfire.ffsaf.rest.data.SimpleMembreInOutData;
import fr.titionfire.ffsaf.rest.exception.DInternalError;
import fr.titionfire.ffsaf.rest.from.ClubMemberForm;
import fr.titionfire.ffsaf.rest.from.FullMemberForm;
@@ -21,6 +22,8 @@ import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponses;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import java.util.List;
@Tag(name = "Membre club", description = "Gestion des membres (pour les clubs)")
@RolesAllowed({"club_president", "club_secretaire", "club_respo_intra"})
@Path("api/member")
@@ -55,6 +58,19 @@ public class MembreClubEndpoints {
return membreService.search(limit, page - 1, search, securityCtx.getSubject());
}
@GET
@Path("club/export")
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Exporte les membres du club", description = "Exporte les membres du club")
@APIResponses(value = {
@APIResponse(responseCode = "200", description = "Les membres du club ont été exportés avec succès"),
@APIResponse(responseCode = "403", description = "Accès refusé"),
@APIResponse(responseCode = "500", description = "Erreur interne du serveur")
})
public Uni<List<SimpleMembreInOutData>> exportMembre() {
return membreService.getAllExport(securityCtx.getSubject());
}
@PUT
@Path("club/{id}")
@Produces(MediaType.TEXT_PLAIN)