-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle the get count filters ids #54
Conversation
@@ -97,6 +98,16 @@ public ResponseEntity<UUID> runAndSave(@Parameter(description = "Network UUID") | |||
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(resultUuid); | |||
} | |||
|
|||
@PostMapping(value = "/networks/{networkUuid}/computation-count", produces = APPLICATION_JSON_VALUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/networks/{networkUuid}/parameters/complexity ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a proposal from Slimane
@Operation(summary = "Get computation count of the total of identifiables for a list of filters") | ||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The sensitivity analysis identifiables count"), | ||
@ApiResponse(responseCode = "404", description = "Sensitivity analysis identifiables count result has not been found")}) | ||
public ResponseEntity<Integer> getComputationCount(@Parameter(description = "Result UUID") @PathVariable("networkUuid") UUID networkUuid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description = "Network UUID"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -113,6 +114,18 @@ private List<IdentifiableAttributes> goGetIdentifiables(EquipmentsContainer filt | |||
} | |||
} | |||
|
|||
private Integer getComputationCount(Map<String, List<UUID>> ids, UUID networkUuid, Integer containersAttributesCount) { | |||
Map<String, List<Integer>> map = filterService.getIdentifiablesCount(ids, networkUuid, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for contingency list ids, you should request the actions-server and not the filter-server, to get all the contingencies ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -465,7 +469,7 @@ public void setUp() { | |||
given(filterService.getIdentifiablesFromFilter(EQUIPMENTS_IN_VOLTAGE_REGULATION_FILTERS_UUID, NETWORK_UUID, VARIANT_2_ID)).willReturn(EQUIPMENTS_IN_VOLTAGE_REGULATION); | |||
given(filterService.getIdentifiablesFromFilter(EQUIPMENTS_IN_VOLTAGE_REGULATION_FILTERS_UUID, NETWORK_UUID, null)).willReturn(EQUIPMENTS_IN_VOLTAGE_REGULATION); | |||
given(filterService.getIdentifiablesFromFilter(EQUIPMENTS_IN_VOLTAGE_REGULATION_FILTERS_UUID, NETWORK_STOP_UUID, VARIANT_2_ID)).willReturn(EQUIPMENTS_IN_VOLTAGE_REGULATION); | |||
|
|||
given(filterService.getIdentifiablesCount(IDS, NETWORK_UUID, null)).willReturn(Map.of("0", List.of(6), "1", List.of(6), "2", List.of(6))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See remark above for contingencies ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
HttpEntity<Map<String, List<UUID>>> httpEntity = new HttpEntity<>(ids, headers); | ||
|
||
return restTemplate.exchange(filterServerBaseUri + path, HttpMethod.POST, httpEntity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HttpMethod.GET
ids.remove(INJECTIONS); | ||
} | ||
containersAttributesCount = getComputationCount(ids, networkUuid, variantId, containersAttributesCount); | ||
return containersAttributesCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return getComputationCount(ids, networkUuid, variantId, containersAttributesCount)
?
@@ -133,6 +133,14 @@ public class SensitivityAnalysisControllerTest { | |||
private static final UUID MONITORED_VOLTAGE_LEVELS_FILTERS_NODES_UUID = UUID.randomUUID(); | |||
private static final UUID EQUIPMENTS_IN_VOLTAGE_REGULATION_FILTERS_UUID = UUID.randomUUID(); | |||
private static final UUID CONTINGENCIES_NODES_UUID = UUID.randomUUID(); | |||
private static final List<UUID> MONITORED_BRANCHES_FILTERS_UUID = List.of(UUID.randomUUID()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really need these constants ?
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
No description provided.