Skip to content

Commit

Permalink
add case short circuit one bus, enum values (#622)
Browse files Browse the repository at this point in the history
* add case short circuit one bus, enum values
 ---------

Signed-off-by: maissa SOUISSI <[email protected]>
  • Loading branch information
souissimai authored Oct 15, 2024
1 parent 67d82ab commit c489dee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public ResponseEntity<UUID> duplicateStudy(@RequestParam("duplicateFrom") UUID s
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "The study information"),
@ApiResponse(responseCode = "404", description = "The study doesn't exist")})
public ResponseEntity<StudyInfos> getStudy(@PathVariable("studyUuid") UUID studyUuid) {
public ResponseEntity<CreatedStudyBasicInfos> getStudy(@PathVariable("studyUuid") UUID studyUuid) {
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(studyService.getStudyInfos(studyUuid));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ public StudyService(
this.self = studyService;
}

private static StudyInfos toStudyInfos(StudyEntity entity) {
return StudyInfos.builder()
private static CreatedStudyBasicInfos toStudyInfos(StudyEntity entity) {
return CreatedStudyBasicInfos.builder()
.id(entity.getId())
.caseFormat(entity.getCaseFormat())
.build();
Expand Down Expand Up @@ -350,7 +350,7 @@ public void duplicateStudyAsync(BasicStudyInfos basicStudyInfos, UUID sourceStud
}

@Transactional(readOnly = true)
public StudyInfos getStudyInfos(UUID studyUuid) {
public CreatedStudyBasicInfos getStudyInfos(UUID studyUuid) {
return StudyService.toStudyInfos(studyRepository.findById(studyUuid).orElseThrow(() -> new StudyException(STUDY_NOT_FOUND)));
}

Expand Down Expand Up @@ -1112,7 +1112,7 @@ public List<String> getResultEnumValues(UUID studyUuid, UUID nodeUuid, Computati
return switch (computationType) {
case LOAD_FLOW -> loadflowService.getEnumValues(enumName, resultUuidOpt.get());
case SECURITY_ANALYSIS -> securityAnalysisService.getEnumValues(enumName, resultUuidOpt.get());
case SHORT_CIRCUIT -> shortCircuitService.getEnumValues(enumName, resultUuidOpt.get());
case SHORT_CIRCUIT, SHORT_CIRCUIT_ONE_BUS -> shortCircuitService.getEnumValues(enumName, resultUuidOpt.get());
default -> throw new StudyException(NOT_ALLOWED);
};
} else {
Expand Down

0 comments on commit c489dee

Please sign in to comment.