Commit 74eee284 authored by Javi Corvi's avatar Javi Corvi
Browse files

change in api name base url

parent c8f2d4e1
......@@ -26,23 +26,17 @@ public class DocumentController {
@Autowired
public DocumentService documentService;
@GetMapping(path = "/pretoxapi/basicauth")
public AuthenticationBean helloWorldBean() {
//throw new RuntimeException("Some Error has Happened! Contact Support at ***-***");
return new AuthenticationBean("You are authenticated");
}
@RequestMapping("/pretoxapi/documents/")
@RequestMapping("/documents")
public List<Document> findAll() {
return documentService.findAll();
}
@RequestMapping("/pretoxapi/documents/{id}")
@RequestMapping("/documents/{id}")
public DocumentAnnotations find(@PathVariable(value="id") Long id) {
return documentService.findDocumentAnnotationsByDocumentId(id);
}
@RequestMapping("/pretoxapi/documents/{id}/srdomain")
@RequestMapping("/documents/{id}/srdomain")
public DocumentAnnotations findDocumentSRDomain(@PathVariable(value="id") Long id) {
return documentService.findDocumentSRDomainByDocumentId(id);
}
......@@ -52,51 +46,51 @@ public class DocumentController {
// return documentService.findByDocumentId2(id);
// }
@RequestMapping("/pretoxapi/documents/{id}/finding/{findingId}")
@RequestMapping("/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("/pretoxapi/documents/{id}/findings/{findingIds}")
@RequestMapping("/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("/pretoxapi/documents/{id}/setExportSRDomain/{srDomainId}/{export_srDomain}")
@RequestMapping("/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("/pretoxapi/documents/{id}/findingValidation/{findingId}/{status}")
@RequestMapping("/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("/pretoxapi/documents/{id}/sentence/{sentenceId}")
@RequestMapping("/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("/pretoxapi/documents/{id}/evidence/all")
@RequestMapping("/documents/{id}/evidence/all")
public String findAllEvidence(@PathVariable(value="id") Long id) {
String snippet = documentService.findFindingsEvidenceByDocumentId(id);
return snippet;
}
@RequestMapping("/pretoxapi/documents/{id}/finding2/{findingId}")
@RequestMapping("/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 = "/pretoxapi/documents/export/{id}")
@RequestMapping(value = "/documents/export/{id}")
public ResponseEntity<byte[]> generateReport(@PathVariable("id") long documentId){
String filename = "Study_Report_" + documentId +".txt";
byte[] content = documentService.exportDocumentAnnotation(documentId);
......
......@@ -20,6 +20,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("admin").password("{noop}password").roles("USER");
auth.inMemoryAuthentication().withUser("admin").password("{noop}eTRAN2019!").roles("USER");
}
}
spring.application.name =ades_rest_api
server.servlet.context-path=/pretoxapi
#Spring Boot Port
server.port = ${SERVER_PORT}
#PRETOX Database
......
spring.application.name =ades_rest_api
server.servlet.context-path=/pretoxapi
#Spring Boot Port
#server.port = ${SERVER_PORT}
server.port = 8090
......
Supports Markdown
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