|
|
@ -49,7 +49,6 @@ import javax.ws.rs.Path;
|
|
|
|
import javax.ws.rs.PathParam;
|
|
|
|
import javax.ws.rs.PathParam;
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
import javax.ws.rs.QueryParam;
|
|
|
|
import javax.ws.rs.QueryParam;
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -69,6 +68,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@QueryParam("type") String appType,
|
|
|
|
@QueryParam("type") String appType,
|
|
|
|
@QueryParam("category") String appCategory,
|
|
|
|
@QueryParam("category") String appCategory,
|
|
|
|
@QueryParam("exact-match") boolean isFullMatch,
|
|
|
|
@QueryParam("exact-match") boolean isFullMatch,
|
|
|
|
|
|
|
|
@QueryParam("published-release") boolean requirePublishedReleases,
|
|
|
|
@DefaultValue("0") @QueryParam("offset") int offset,
|
|
|
|
@DefaultValue("0") @QueryParam("offset") int offset,
|
|
|
|
@DefaultValue("20") @QueryParam("limit") int limit,
|
|
|
|
@DefaultValue("20") @QueryParam("limit") int limit,
|
|
|
|
@DefaultValue("ASC") @QueryParam("sort") String sortBy) {
|
|
|
|
@DefaultValue("ASC") @QueryParam("sort") String sortBy) {
|
|
|
@ -80,6 +80,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
filter.setLimit(limit);
|
|
|
|
filter.setLimit(limit);
|
|
|
|
filter.setSortBy(sortBy);
|
|
|
|
filter.setSortBy(sortBy);
|
|
|
|
filter.setFullMatch(isFullMatch);
|
|
|
|
filter.setFullMatch(isFullMatch);
|
|
|
|
|
|
|
|
filter.setRequirePublishedRelease(requirePublishedReleases);
|
|
|
|
if (appName != null && !appName.isEmpty()) {
|
|
|
|
if (appName != null && !appName.isEmpty()) {
|
|
|
|
filter.setAppName(appName);
|
|
|
|
filter.setAppName(appName);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -107,10 +108,11 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@Consumes("application/json")
|
|
|
|
@Consumes("application/json")
|
|
|
|
@Path("/{appId}")
|
|
|
|
@Path("/{appId}")
|
|
|
|
public Response getApplication(
|
|
|
|
public Response getApplication(
|
|
|
|
|
|
|
|
@QueryParam("published-release") boolean requirePublishedReleases,
|
|
|
|
@PathParam("appId") int appId) {
|
|
|
|
@PathParam("appId") int appId) {
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Application application = applicationManager.getApplicationById(appId);
|
|
|
|
Application application = applicationManager.getApplicationById(appId, requirePublishedReleases);
|
|
|
|
if (application == null) {
|
|
|
|
if (application == null) {
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).entity
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).entity
|
|
|
|
("Application with application id: " + appId + " not found").build();
|
|
|
|
("Application with application id: " + appId + " not found").build();
|
|
|
|