Skip to content

Commit

Permalink
[Update] Add summaries api methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kostobog committed Jan 4, 2024
1 parent 14bb790 commit c7eba53
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public List<FailureModesTable> findAll() {
return repositoryService.findAll();
}

@GetMapping("/summaries")
public List<FailureModesTable> summaries() {
return repositoryService.findAllSummaries();
}

@PutMapping(consumes = {MediaType.APPLICATION_JSON_VALUE, JsonLd.MEDIA_TYPE})
public FailureModesTable update(@RequestBody FailureModesTableUpdateDTO tableUpdateDTO) {
log.info("> update - {}", tableUpdateDTO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public List<FaultTree> findAll() {
return repositoryService.findAll();
}

@GetMapping("/summaries")
public List<FaultTree> summaries() {
return repositoryService.findAllSummaries();
}

@GetMapping(value = "/{faultTreeFragment}", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE})
public FaultTree find(@PathVariable(name = "faultTreeFragment") String faultTreeFragment) {
log.info("> find - {}", faultTreeFragment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public List<System> findAll() {
return repositoryService.findAll();
}

@GetMapping("/summaries")
public List<System> summaries() {
return repositoryService.findAllSummaries();
}

@GetMapping(value = "/{systemFragment}", produces = {JsonLd.MEDIA_TYPE, MediaType.APPLICATION_JSON_VALUE})
public System find(@PathVariable(name = "systemFragment") String systemFragment) {
log.info("> find - {}", systemFragment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,8 @@ public String export(URI tableUri) {
return stringWriter.toString();
}

@Transactional(readOnly = true)
public List<FailureModesTable> findAllSummaries(){
return ((FailureModesTableDao)getPrimaryDao()).findAllSummaries();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,9 @@ private void setFaultEventTypes(boolean isBasic, FaultEvent fEvent){
fEvent.setGateType(GateType.OR);
}
}

@Transactional(readOnly = true)
public List<FaultTree> findAllSummaries(){
return ((FaultTreeDao)getPrimaryDao()).findAllSummaries();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@ public void importDocument(URI systemURI, URI contextIRI) {
components.forEach(system::addComponent);
}

@Transactional(readOnly = true)
public List<System> findAllSummaries(){
return ((SystemDao)getPrimaryDao()).findAllSummaries();
}
}

0 comments on commit c7eba53

Please sign in to comment.