You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
package rest; |
|
|
|
import org.eclipse.microprofile.rest.client.inject.RestClient; |
|
import dto.ScanObj; |
|
|
|
import javax.inject.Inject; |
|
import javax.validation.Valid; |
|
import javax.ws.rs.Consumes; |
|
import javax.ws.rs.POST; |
|
import javax.ws.rs.Path; |
|
import java.net.URI; |
|
import java.net.URISyntaxException; |
|
import java.util.ArrayList; |
|
import java.util.Arrays; |
|
import java.util.List; |
|
import java.util.UUID; |
|
import org.json.JSONObject; |
|
import org.json.JSONArray; |
|
|
|
import dto.ScanObjPayload; |
|
|
|
import static constants.HttpHeaders.AUTHORIZATION_STRING; |
|
|
|
@Path("/createScan") |
|
public class CreateScanResource { |
|
|
|
// @Inject |
|
@RestClient |
|
CreateScanService createScanService; |
|
// ScanObjPayload scanObjPayload; |
|
|
|
@POST |
|
@Consumes({ "application/json" }) |
|
//in theory should take List<String> but something weird is happening, didnt want to fix it specifically before adding the DB dto |
|
public ScanObj invokeScanAnalyze(@Valid String scanInvocation) throws URISyntaxException { |
|
|
|
//weird work around is currently being fixed |
|
JSONObject jsonData = new JSONObject(scanInvocation); |
|
System.out.println(jsonData); |
|
//ignore all of this, temporary for testing purposes, "parser" will be in ScanObjPayload |
|
ScanObj scanObj = ScanObjPayload.constructScanPayload(jsonData); |
|
return scanObj; |
|
} |
|
}
|
|
|