Kenmegne
7 days ago 23a46b4be35277e06ec89f48730eeb694e686be8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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 TableauBordGlobalRS /*extends AbstractReadWithCriteriaEntityIFaces<TableauBord, TableauBordDto, Long>*/ {
 
    public TableauBordSlimDto mapToSlimDto(TableauBord entity);
 
    //@Override
    public default TableauBordDto mapToDto(TableauBord entity) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
 
    public default List<TableauBordSlimDto> allToSlimDto(List<TableauBord> datas) {
        List<TableauBordSlimDto> 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 = {"ajouter", "modifier"})
    @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 = "consulter", actions = {"ajouter", "modifier"}, 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 = "ajouter", 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 = "modifier", 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 = "ajouter", 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 = "ajouter", enable = true)
    public Response deleteUserTableauBord(@Context HttpHeaders headers, @PathParam("userName") String userName);
 
    //public K mapToDto(T entity);
    @GET
    @Produces({MediaType.APPLICATION_JSON})
    @Path("findbyid/{id}")
    @Secured(actions = {"ajouter", "modifier"})
    public Response findById(@Context HttpHeaders headers, @PathParam("id") Long id);
 
    @POST
    @Produces({MediaType.APPLICATION_JSON})
    @Path("findwithpagination/{pageNumber}/{pagesize}")
    @Secured(actions = {"ajouter", "modifier"})
    @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 = {"ajouter", "modifier"})
    public Long count(@Context HttpHeaders headers, CriteriaFormRequest criteriaFormRequest);
 
    @GET
    @Produces({MediaType.APPLICATION_JSON})
    @Path("search-columns")
    @Secured(actions = {"ajouter", "modifier"})
    public Response getSearchColumns(@Context HttpHeaders headers);
 
    @POST
    @Produces({MediaType.APPLICATION_JSON})
    @Secured(actions = {"ajouter", "modifier"})
    @Path("find-all")
    public Response findAll(@Context HttpHeaders headers, CriteriaFormRequest criteriaFormRequest);
}