Adding interface

This commit is contained in:
Luca Frosini 2023-03-06 16:31:45 +01:00
parent 35586fa674
commit 15bacdbfef
3 changed files with 52 additions and 1 deletions

View File

@ -62,7 +62,11 @@
<artifactId>authorization-utils</artifactId>
<version>[2.1.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>gcat-api</artifactId>
<version>[2.3.2, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>

View File

@ -1,6 +1,7 @@
package org.gcube.grsf.publisher.rest;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
/**
* @author Luca Frosini (ISTI - CNR)
@ -8,4 +9,8 @@ import javax.ws.rs.Path;
@Path("fishery/{source}/")
public class FisheryRESTAPIs extends BaseRESTAPIs {
@PathParam("source")
protected String source;
}

View File

@ -1,6 +1,19 @@
package org.gcube.grsf.publisher.rest;
import javax.ws.rs.Consumes;
import javax.ws.rs.DefaultValue;
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.QueryParam;
import javax.ws.rs.core.MediaType;
import org.gcube.gcat.api.GCatConstants;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
/**
* @author Luca Frosini (ISTI - CNR)
@ -8,4 +21,33 @@ import javax.ws.rs.Path;
@Path("stock/{source}/")
public class StockRESTAPIs extends BaseRESTAPIs {
@PathParam("source")
protected String source;
@GET
@Produces(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8)
@StatusCodes ({
@ResponseCode ( code = 200, condition = "The request succeeded.")
})
public String list(@QueryParam(GCatConstants.LIMIT_QUERY_PARAMETER) @DefaultValue("10") int limit,
@QueryParam(GCatConstants.OFFSET_QUERY_PARAMETER) @DefaultValue("0") int offset) {
return null;
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public void create(String jsonString) {
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public String read() {
return null;
}
}