package com.megatim.fdxconsultation.service.ifaces.stats; import com.megatim.fdxcommons.core.ifaces.interceptor.LoggingInterceptorBinding; import com.megatim.fdxcommons.model.pojo.CriteriaFormRequest; import com.megatim.fdxconsultation.model.dto.stats.TableauBordDto; import com.megatim.fdxconsultation.model.dto.stats.TableauBordSlimDto; import com.megatim.fdxconsultation.model.stats.TableauBord; import com.megatim.fdxconsultation.model.stats.dto.TableauBordRequest; import com.mgt.rs.security.core.common.Secured; import java.util.ArrayList; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.validation.Valid; import javax.ws.rs.POST; /** * * @author ASUS */ public interface TableauBordRS /*extends AbstractReadWithCriteriaEntityIFaces*/ { public TableauBordSlimDto mapToSlimDto(TableauBord entity); //@Override public default TableauBordDto mapToDto(TableauBord entity) { throw new UnsupportedOperationException("Not supported yet."); } public default List allToSlimDto(List datas) { List dtos = new ArrayList<>(); if (datas != null) { for (TableauBord data : datas) { dtos.add(mapToSlimDto(data)); } } return dtos; } @GET @Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) @Path("print-metadata/{referentiel_version}/{code_type_fichier}") @Secured(actions = {"éditer"}, enable = true) @LoggingInterceptorBinding(message = "Consultation des colonnes de recherche pour le tableau de bord dont associé au typefichier {code_type_fichier}", classe = TableauBordSlimDto.class) public Response getColumns(@Context HttpHeaders headers, @PathParam("referentiel_version") String referentielVersion, @PathParam("code_type_fichier") String codeTypeFichier); @GET @Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) @Path("get-datas/{referentiel_version}/{code_type_fichier}") @Secured(action = "éditer", enable = true) @LoggingInterceptorBinding(message = "Consultation des données pour le tableau de bord dont associé au typefichier {code_type_fichier}", classe = TableauBordSlimDto.class) public Response getDatas(@Context HttpHeaders headers, @PathParam("referentiel_version") String referentielVersion, @PathParam("code_type_fichier") String codeTypeFichier); @POST @Consumes({MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_JSON}) @Path("add") @Secured(action = "éditer", enable = true) @LoggingInterceptorBinding(message = "Ajout d'un nouveau tableau de bord du typefichier [1.typeFichier.code], l'identifiant est (id)", classe = TableauBordSlimDto.class) public Response save(@Context HttpHeaders headers, @Valid TableauBordRequest tableauBordRequest); @POST @Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) @Path("update/{id}") @Secured(action = "éditer", enable = true) public Response update(@Context HttpHeaders headers, @PathParam("id") Long id, @Valid TableauBordRequest tableauBordRequest); @POST @Produces({MediaType.APPLICATION_JSON}) @Path("delete/{id}") @Secured(action = "éditer", enable = true) @LoggingInterceptorBinding(message = "Suppression du tableau de bord dont l'identifiant est {id}") public Response delete(@Context HttpHeaders headers, @PathParam("id") Long id); @POST @Produces({MediaType.APPLICATION_JSON}) @Path("delete-user-tableaubord/{userName}") @Secured(action = "éditer", enable = true) public Response deleteUserTableauBord(@Context HttpHeaders headers, @PathParam("userName") String userName); @GET @Produces({MediaType.APPLICATION_JSON}) @Path("findbyid/{id}") @Secured(actions = {"éditer"}) public Response findById(@Context HttpHeaders headers, @PathParam("id") Long id); @POST @Produces({MediaType.APPLICATION_JSON}) @Path("findwithpagination/{pageNumber}/{pagesize}") @Secured(actions = {"éditer"}) @LoggingInterceptorBinding(message = "Consultation des colonnes de recherche pour le tableau de bord dont associé au typefichier {code_type_fichier}", classe = TableauBordSlimDto.class) public Response findWithPagination(@Context HttpHeaders headers, @PathParam("pageNumber") Integer pageNumber, @PathParam("pagesize") Integer pageSize, CriteriaFormRequest criteriaFormRequest); @POST @Produces({MediaType.APPLICATION_JSON}) @Path("count") @Secured(actions = {"éditer"}) public Long count(@Context HttpHeaders headers, CriteriaFormRequest criteriaFormRequest); @GET @Produces({MediaType.APPLICATION_JSON}) @Path("search-columns") @Secured(actions = {"éditer"}) public Response getSearchColumns(@Context HttpHeaders headers); @POST @Produces({MediaType.APPLICATION_JSON}) @Secured(actions = {"éditer"}) @Path("find-all") public Response findAll(@Context HttpHeaders headers, CriteriaFormRequest criteriaFormRequest); }