Configure Maven repository for unionflow-server-api dependency
This commit is contained in:
@@ -0,0 +1,204 @@
|
||||
package dev.lions.unionflow.client.service;
|
||||
|
||||
import dev.lions.unionflow.client.dto.MembreDTO;
|
||||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@RegisterRestClient(configKey = "unionflow-api")
|
||||
@Path("/api/membres")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public interface MembreService {
|
||||
|
||||
@GET
|
||||
List<MembreDTO> listerTous();
|
||||
|
||||
@GET
|
||||
@Path("/{id}")
|
||||
MembreDTO obtenirParId(@PathParam("id") UUID id);
|
||||
|
||||
@GET
|
||||
@Path("/numero/{numeroMembre}")
|
||||
MembreDTO obtenirParNumero(@PathParam("numeroMembre") String numeroMembre);
|
||||
|
||||
@GET
|
||||
@Path("/search")
|
||||
List<MembreDTO> rechercher(
|
||||
@QueryParam("nom") String nom,
|
||||
@QueryParam("prenom") String prenom,
|
||||
@QueryParam("email") String email,
|
||||
@QueryParam("telephone") String telephone,
|
||||
@QueryParam("statut") String statut,
|
||||
@QueryParam("associationId") UUID associationId,
|
||||
@QueryParam("page") @DefaultValue("0") int page,
|
||||
@QueryParam("size") @DefaultValue("20") int size
|
||||
);
|
||||
|
||||
@GET
|
||||
@Path("/association/{associationId}")
|
||||
List<MembreDTO> listerParAssociation(@PathParam("associationId") UUID associationId);
|
||||
|
||||
@GET
|
||||
@Path("/actifs")
|
||||
List<MembreDTO> listerActifs();
|
||||
|
||||
@GET
|
||||
@Path("/inactifs")
|
||||
List<MembreDTO> listerInactifs();
|
||||
|
||||
@POST
|
||||
MembreDTO creer(MembreDTO membre);
|
||||
|
||||
@PUT
|
||||
@Path("/{id}")
|
||||
MembreDTO modifier(@PathParam("id") UUID id, MembreDTO membre);
|
||||
|
||||
@DELETE
|
||||
@Path("/{id}")
|
||||
void supprimer(@PathParam("id") UUID id);
|
||||
|
||||
@PUT
|
||||
@Path("/{id}/activer")
|
||||
MembreDTO activer(@PathParam("id") UUID id);
|
||||
|
||||
@PUT
|
||||
@Path("/{id}/desactiver")
|
||||
MembreDTO desactiver(@PathParam("id") UUID id);
|
||||
|
||||
@PUT
|
||||
@Path("/{id}/suspendre")
|
||||
MembreDTO suspendre(@PathParam("id") UUID id);
|
||||
|
||||
@PUT
|
||||
@Path("/{id}/radier")
|
||||
MembreDTO radier(@PathParam("id") UUID id);
|
||||
|
||||
@GET
|
||||
@Path("/statistiques")
|
||||
StatistiquesMembreDTO obtenirStatistiques();
|
||||
|
||||
@GET
|
||||
@Path("/export")
|
||||
@Produces({"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "text/csv", "application/pdf", "application/json"})
|
||||
byte[] exporterExcel(
|
||||
@QueryParam("format") @DefaultValue("EXCEL") String format,
|
||||
@QueryParam("associationId") UUID associationId,
|
||||
@QueryParam("statut") String statut,
|
||||
@QueryParam("type") String type,
|
||||
@QueryParam("dateAdhesionDebut") String dateAdhesionDebut,
|
||||
@QueryParam("dateAdhesionFin") String dateAdhesionFin,
|
||||
@QueryParam("colonnes") List<String> colonnesExport,
|
||||
@QueryParam("inclureHeaders") @DefaultValue("true") boolean inclureHeaders,
|
||||
@QueryParam("formaterDates") @DefaultValue("true") boolean formaterDates,
|
||||
@QueryParam("inclureStatistiques") @DefaultValue("false") boolean inclureStatistiques,
|
||||
@QueryParam("motDePasse") String motDePasse
|
||||
);
|
||||
|
||||
@GET
|
||||
@Path("/export/count")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
Long compterMembresPourExport(
|
||||
@QueryParam("associationId") UUID associationId,
|
||||
@QueryParam("statut") String statut,
|
||||
@QueryParam("type") String type,
|
||||
@QueryParam("dateAdhesionDebut") String dateAdhesionDebut,
|
||||
@QueryParam("dateAdhesionFin") String dateAdhesionFin
|
||||
);
|
||||
|
||||
@POST
|
||||
@Path("/import")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
ResultatImportDTO importerDonnees(MembreImportMultipartForm form);
|
||||
|
||||
@GET
|
||||
@Path("/import/modele")
|
||||
@Produces("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
byte[] telechargerModeleImport();
|
||||
|
||||
@GET
|
||||
@Path("/autocomplete/villes")
|
||||
List<String> obtenirVilles(@QueryParam("query") String query);
|
||||
|
||||
@GET
|
||||
@Path("/autocomplete/professions")
|
||||
List<String> obtenirProfessions(@QueryParam("query") String query);
|
||||
|
||||
@POST
|
||||
@Path("/export/selection")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
byte[] exporterSelection(
|
||||
List<UUID> membreIds,
|
||||
@QueryParam("format") @DefaultValue("EXCEL") String format);
|
||||
|
||||
// Classes DTO internes pour les réponses spécialisées
|
||||
class StatistiquesMembreDTO {
|
||||
public Long totalMembres;
|
||||
public Long membresActifs;
|
||||
public Long membresInactifs;
|
||||
public Long membresSuspendus;
|
||||
public Long membresRadies;
|
||||
public Long nouveauxMembres30Jours;
|
||||
public Double tauxActivite;
|
||||
public Double tauxCroissance;
|
||||
|
||||
// Constructeurs
|
||||
public StatistiquesMembreDTO() {}
|
||||
|
||||
// Getters et setters
|
||||
public Long getTotalMembres() { return totalMembres; }
|
||||
public void setTotalMembres(Long totalMembres) { this.totalMembres = totalMembres; }
|
||||
|
||||
public Long getMembresActifs() { return membresActifs; }
|
||||
public void setMembresActifs(Long membresActifs) { this.membresActifs = membresActifs; }
|
||||
|
||||
public Long getMembresInactifs() { return membresInactifs; }
|
||||
public void setMembresInactifs(Long membresInactifs) { this.membresInactifs = membresInactifs; }
|
||||
|
||||
public Long getMembresSuspendus() { return membresSuspendus; }
|
||||
public void setMembresSuspendus(Long membresSuspendus) { this.membresSuspendus = membresSuspendus; }
|
||||
|
||||
public Long getMembresRadies() { return membresRadies; }
|
||||
public void setMembresRadies(Long membresRadies) { this.membresRadies = membresRadies; }
|
||||
|
||||
public Long getNouveauxMembres30Jours() { return nouveauxMembres30Jours; }
|
||||
public void setNouveauxMembres30Jours(Long nouveauxMembres30Jours) { this.nouveauxMembres30Jours = nouveauxMembres30Jours; }
|
||||
|
||||
public Double getTauxActivite() { return tauxActivite; }
|
||||
public void setTauxActivite(Double tauxActivite) { this.tauxActivite = tauxActivite; }
|
||||
|
||||
public Double getTauxCroissance() { return tauxCroissance; }
|
||||
public void setTauxCroissance(Double tauxCroissance) { this.tauxCroissance = tauxCroissance; }
|
||||
}
|
||||
|
||||
class ResultatImportDTO {
|
||||
public Integer totalLignes;
|
||||
public Integer lignesTraitees;
|
||||
public Integer lignesErreur;
|
||||
public List<String> erreurs;
|
||||
public List<MembreDTO> membresImportes;
|
||||
|
||||
// Constructeurs
|
||||
public ResultatImportDTO() {}
|
||||
|
||||
// Getters et setters
|
||||
public Integer getTotalLignes() { return totalLignes; }
|
||||
public void setTotalLignes(Integer totalLignes) { this.totalLignes = totalLignes; }
|
||||
|
||||
public Integer getLignesTraitees() { return lignesTraitees; }
|
||||
public void setLignesTraitees(Integer lignesTraitees) { this.lignesTraitees = lignesTraitees; }
|
||||
|
||||
public Integer getLignesErreur() { return lignesErreur; }
|
||||
public void setLignesErreur(Integer lignesErreur) { this.lignesErreur = lignesErreur; }
|
||||
|
||||
public List<String> getErreurs() { return erreurs; }
|
||||
public void setErreurs(List<String> erreurs) { this.erreurs = erreurs; }
|
||||
|
||||
public List<MembreDTO> getMembresImportes() { return membresImportes; }
|
||||
public void setMembresImportes(List<MembreDTO> membresImportes) { this.membresImportes = membresImportes; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user