Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
INB
eTRANSAFE
pretox-rest-api
Commits
6af263f0
Commit
6af263f0
authored
Oct 12, 2021
by
Javi Corvi
Browse files
change in api name base url
parent
f2aba79a
Pipeline
#25088
passed with stage
in 4 minutes and 39 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/es/bsc/inb/ades/rest/api/controllers/DocumentController.java
View file @
6af263f0
...
...
@@ -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
);
...
...
src/main/java/es/bsc/inb/ades/rest/api/security/basic/inmemory/SecurityConfig.java
View file @
6af263f0
...
...
@@ -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"
);
}
}
src/main/resources/application-prod.properties
View file @
6af263f0
spring.application.name
=
ades_rest_api
server.servlet.context-path
=
/pretoxapi
#Spring Boot Port
server.port
=
${SERVER_PORT}
#PRETOX Database
...
...
src/main/resources/application.properties
View file @
6af263f0
spring.application.name
=
ades_rest_api
server.servlet.context-path
=
/pretoxapi
#Spring Boot Port
#server.port = ${SERVER_PORT}
server.port
=
8090
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment