package com.megatim.fdxconsultation.service.ifaces.abstracts;
|
|
import com.mgt.rs.security.core.common.Secured;
|
import java.io.Serializable;
|
import javax.validation.Valid;
|
import javax.ws.rs.Consumes;
|
import javax.ws.rs.GET;
|
import javax.ws.rs.POST;
|
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;
|
|
public interface AbstractGenericCrudResourceIFaces<T, K, ID extends Serializable, U> { //U représente le type de l'objet sur lequel on va appliquer la recherche
|
|
@POST
|
@Consumes({MediaType.APPLICATION_JSON})
|
@Produces({MediaType.APPLICATION_JSON})
|
@Path("add")
|
@Secured(action = "ajouter")
|
public Response save(@Context HttpHeaders headers, @Valid T entity);
|
|
@POST
|
@Consumes({MediaType.APPLICATION_JSON})
|
@Produces({MediaType.APPLICATION_JSON})
|
@Path("update/{id}")
|
@Secured(action = "modifier")
|
public Response update(@Context HttpHeaders headers, @PathParam("id") ID id, @Valid T entity);
|
|
@POST
|
@Produces({MediaType.APPLICATION_JSON})
|
@Path("delete/{id}")
|
@Secured(action = "supprimer")
|
public Response delete(@Context HttpHeaders headers, @PathParam("id") ID id);
|
|
@GET
|
@Produces({MediaType.APPLICATION_JSON})
|
@Path("findbyid/{id}")
|
@Secured(action = "*")
|
public Response findById(@Context HttpHeaders headers, @PathParam("id") ID id);
|
|
// @POST
|
// @Produces({MediaType.APPLICATION_JSON})
|
// @Path("findwithpagination/{pageNumber}/{pagesize}")
|
// @Secured(actions = {"ajouter", "modifier", "supprimer", "voir"})
|
// public Response findWithPagination(@Context HttpHeaders headers, @PathParam("pageNumber") Integer pageNumber, @PathParam("pagesize") Integer pagesize, U searchEntity);
|
//
|
// @POST
|
// @Produces({MediaType.APPLICATION_JSON})
|
// @Secured(actions = {"ajouter", "modifier", "supprimer", "voir"})
|
// @Path("findall")
|
// public Response findAll(@Context HttpHeaders headers, U searchEntity);
|
// @POST
|
// @Produces({MediaType.APPLICATION_JSON})
|
// @Path("count")
|
// @Secured(actions = {"ajouter", "modifier", "supprimer", "voir"})
|
// public Long count(@Context HttpHeaders headers, U searchEntity);
|
}
|