grsf-publisher-ws/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherFisheryService...

42 lines
1.1 KiB
Java
Raw Normal View History

package org.gcube.data_catalogue.grsf_publish_ws.services;
import java.util.UUID;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.gcube.data_catalogue.grsf_publish_ws.json.input.FisheryRecord;
import org.gcube.data_catalogue.grsf_publish_ws.json.output.ResponseCreationBean;
import org.slf4j.LoggerFactory;
/**
* Fishery web service methods
* @author Costantino Perciante at ISTI-CNR
*/
@Path("fishery/")
public class GrsfPublisherFisheryService {
// Logger
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(GrsfPublisherFisheryService.class);
@POST
@Path("publish-product")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response publishFishery(FisheryRecord record){
logger.info("Incoming request for creating a fishery record");
System.out.println(record);
// TODO
return Response.status(Status.CREATED).entity(new ResponseCreationBean(UUID.randomUUID().toString(), null)).build();
}
}