|
|
@ -1,10 +1,9 @@ |
|
|
package org.sebi.incident; |
|
|
package org.sebi.incident; |
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
import javax.ws.rs.GET; |
|
|
import javax.ws.rs.GET; |
|
|
import javax.ws.rs.Path; |
|
|
import javax.ws.rs.Path; |
|
|
import javax.ws.rs.QueryParam; |
|
|
import javax.ws.rs.QueryParam; |
|
|
|
|
|
import javax.ws.rs.core.Response; |
|
|
|
|
|
|
|
|
import org.eclipse.microprofile.config.inject.ConfigProperty; |
|
|
import org.eclipse.microprofile.config.inject.ConfigProperty; |
|
|
|
|
|
|
|
|
@ -19,11 +18,11 @@ public class IncidentResource { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GET |
|
|
@GET |
|
|
public List<Incident> getIncidents(@QueryParam("api_key") String apiKey){ |
|
|
public Response getIncidents(@QueryParam("api_key") String apiKey){ |
|
|
if(this.apiKey.equals(apiKey)){ |
|
|
if(this.apiKey.equals(apiKey)){ |
|
|
return Incident.listAll(); |
|
|
return Response.ok(Incident.listAll()).build(); |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return Response.status(Response.Status.UNAUTHORIZED).build(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GET |
|
|
@GET |
|
|
|