|
|
|
|
@ -23,6 +23,8 @@ import dto.ScanObjPayload;
|
|
|
|
|
import dto.BrewObjPayload; |
|
|
|
|
import dto.GitObj; |
|
|
|
|
import dto.GitObjPayload; |
|
|
|
|
import dto.PncObj; |
|
|
|
|
import dto.PncObjPayload; |
|
|
|
|
|
|
|
|
|
import static constants.HttpHeaders.AUTHORIZATION_STRING; |
|
|
|
|
import java.sql.Connection; |
|
|
|
|
@ -83,4 +85,24 @@ public class CreateScanRequest {
|
|
|
|
|
gitObj = null; |
|
|
|
|
return gitObj; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@POST |
|
|
|
|
@Path("/pnc") |
|
|
|
|
@Consumes({ "application/json" }) |
|
|
|
|
public PncObj invokePncScanAnalyze(@Valid String scanInvocation)throws URISyntaxException { |
|
|
|
|
JSONObject jsonData = new JSONObject(scanInvocation); |
|
|
|
|
PncObj pncObj = PncObjPayload.constructScanPayload(jsonData); |
|
|
|
|
|
|
|
|
|
ConnectDB connectDB = new ConnectDB(); |
|
|
|
|
Connection conn = connectDB.connect(); |
|
|
|
|
Statement stmt = null; |
|
|
|
|
String sql = "INSERT INTO pncscans (buildsystemtype, buildid) VALUES ('"+pncObj.buildSystemType+"','"+pncObj.buildId+"')"; |
|
|
|
|
try{ |
|
|
|
|
stmt = conn.createStatement(); |
|
|
|
|
ResultSet rs = stmt.executeQuery(sql); |
|
|
|
|
} catch (SQLException e){ |
|
|
|
|
System.out.println(e); |
|
|
|
|
} |
|
|
|
|
return pncObj; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|