Commit f2aba79a authored by Javi Corvi's avatar Javi Corvi
Browse files

change api url develop

parent c3cc078f
......@@ -26,23 +26,23 @@ public class DocumentController {
@Autowired
public DocumentService documentService;
@GetMapping(path = "/documents/basicauth")
@GetMapping(path = "/pretoxapi/basicauth")
public AuthenticationBean helloWorldBean() {
//throw new RuntimeException("Some Error has Happened! Contact Support at ***-***");
return new AuthenticationBean("You are authenticated");
}
@RequestMapping("/documents/")
@RequestMapping("/pretoxapi/documents/")
public List<Document> findAll() {
return documentService.findAll();
}
@RequestMapping("/documents/{id}")
@RequestMapping("/pretoxapi/documents/{id}")
public DocumentAnnotations find(@PathVariable(value="id") Long id) {
return documentService.findDocumentAnnotationsByDocumentId(id);
}
@RequestMapping("/documents/{id}/srdomain")
@RequestMapping("/pretoxapi/documents/{id}/srdomain")
public DocumentAnnotations findDocumentSRDomain(@PathVariable(value="id") Long id) {
return documentService.findDocumentSRDomainByDocumentId(id);
}
......@@ -52,51 +52,51 @@ public class DocumentController {
// return documentService.findByDocumentId2(id);
// }
@RequestMapping("/documents/{id}/finding/{findingId}")
@RequestMapping("/pretoxapi/documents/{id}/finding/{findingId}")
public String findFinding(@PathVariable(value="id") Long id, @PathVariable(value="findingId") Integer findingId) {
String snippet = documentService.findFindingEvidenceByDocumentIdAndFindingId(id, findingId);
return snippet;
}
@RequestMapping("/documents/{id}/findings/{findingIds}")
@RequestMapping("/pretoxapi/documents/{id}/findings/{findingIds}")
public String findFindings(@PathVariable(value="id") Long id, @PathVariable(value="findingIds") List<Integer> findingIds) {
//String snippet = documentService.findFindingEvidenceByDocumentIdAndFindingId(id, findingId);
//return snippet;
return "";
}
@RequestMapping("/documents/{id}/setExportSRDomain/{srDomainId}/{export_srDomain}")
@RequestMapping("/pretoxapi/documents/{id}/setExportSRDomain/{srDomainId}/{export_srDomain}")
public String setExportFinding(@PathVariable(value="id") Long id, @PathVariable(value="srDomainId") Integer srDomainId, @PathVariable(value="export_srDomain") Boolean export_srDomain) {
documentService.setExportSRDomainFinding(id, srDomainId, export_srDomain);
return "true";
}
@RequestMapping("/documents/{id}/findingValidation/{findingId}/{status}")
@RequestMapping("/pretoxapi/documents/{id}/findingValidation/{findingId}/{status}")
public String setFindingValidation(@PathVariable(value="id") Long id, @PathVariable(value="findingId") Integer findingId, @PathVariable(value="status") String status) {
documentService.setFindingValidation(id, findingId, status);
return "true";
}
@RequestMapping("/documents/{id}/sentence/{sentenceId}")
@RequestMapping("/pretoxapi/documents/{id}/sentence/{sentenceId}")
public String findSentence(@PathVariable(value="id") Long id, @PathVariable(value="sentenceId") Integer sentenceId) {
String snippet = documentService.findSentenceEvidenceByDocumentIdAndSentenceId(id, sentenceId);
return snippet;
}
@RequestMapping("/documents/{id}/evidence/all")
@RequestMapping("/pretoxapi/documents/{id}/evidence/all")
public String findAllEvidence(@PathVariable(value="id") Long id) {
String snippet = documentService.findFindingsEvidenceByDocumentId(id);
return snippet;
}
@RequestMapping("/documents/{id}/finding2/{findingId}")
@RequestMapping("/pretoxapi/documents/{id}/finding2/{findingId}")
public String findFinding2(@PathVariable(value="id") Long id, @PathVariable(value="findingId") Integer findingId) {
String snippet = documentService.findTextSnippetByDocumentIdAndFindingId2(id, findingId);
return snippet;
}
@RequestMapping(value = "/documents/export/{id}")
@RequestMapping(value = "/pretoxapi/documents/export/{id}")
public ResponseEntity<byte[]> generateReport(@PathVariable("id") long documentId){
String filename = "Study_Report_" + documentId +".txt";
byte[] content = documentService.exportDocumentAnnotation(documentId);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment