diff --git a/src/main/java/org/gridsuite/network/map/NetworkMapController.java b/src/main/java/org/gridsuite/network/map/NetworkMapController.java index 11dc0566..12c3c6ce 100644 --- a/src/main/java/org/gridsuite/network/map/NetworkMapController.java +++ b/src/main/java/org/gridsuite/network/map/NetworkMapController.java @@ -20,7 +20,7 @@ import org.gridsuite.network.map.dto.InfoTypeParameters; import org.gridsuite.network.map.dto.definition.hvdc.HvdcShuntCompensatorsInfos; import org.gridsuite.network.map.dto.definition.topology.BusBarSectionsInfos; -import org.gridsuite.network.map.dto.definition.topology.FeederBaysBusBarSectionsInfos; +import org.gridsuite.network.map.dto.definition.topology.FeederBayInfos; import org.gridsuite.network.map.dto.definition.topology.SwitchInfos; import org.gridsuite.network.map.services.NetworkMapService; import org.springframework.context.annotation.ComponentScan; @@ -95,12 +95,12 @@ public List getVoltageLevelBusesOrBusBarSections(@Parameter(descri return networkMapService.getVoltageLevelBusesOrBusbarSections(networkUuid, voltageLevelId, variantId); } - @GetMapping(value = "/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays-and-bus-bar-sections", produces = APPLICATION_JSON_VALUE) + @GetMapping(value = "/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays", produces = APPLICATION_JSON_VALUE) @Operation(summary = "get feeder bays and bus bar sections information") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = " feeder bays and bus bar sections information retrieved")}) - public FeederBaysBusBarSectionsInfos getFeederBaysInfos(@Parameter(description = "Network UUID") @PathVariable("networkUuid") UUID networkUuid, - @Parameter(description = "Voltage level id") @PathVariable("voltageLevelId") String voltageLevelId, - @Parameter(description = "Variant Id") @RequestParam(name = "variantId", required = false) String variantId) { + public Map> getFeederBaysInfos(@Parameter(description = "Network UUID") @PathVariable("networkUuid") UUID networkUuid, + @Parameter(description = "Voltage level id") @PathVariable("voltageLevelId") String voltageLevelId, + @Parameter(description = "Variant Id") @RequestParam(name = "variantId", required = false) String variantId) { return networkMapService.getFeederBaysInfos(networkUuid, voltageLevelId, variantId); } diff --git a/src/main/java/org/gridsuite/network/map/dto/definition/topology/FeederBaysBusBarSectionsInfos.java b/src/main/java/org/gridsuite/network/map/dto/definition/topology/FeederBaysBusBarSectionsInfos.java deleted file mode 100644 index 9ac645c0..00000000 --- a/src/main/java/org/gridsuite/network/map/dto/definition/topology/FeederBaysBusBarSectionsInfos.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2025, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.gridsuite.network.map.dto.definition.topology; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.SuperBuilder; - -import java.util.List; -import java.util.Map; - -/** - * @author Etienne Lesot - */ -@SuperBuilder -@Getter -@Setter -public class FeederBaysBusBarSectionsInfos { - - @JsonInclude(JsonInclude.Include.NON_NULL) - private Map> feederBaysInfos; - @JsonInclude(JsonInclude.Include.NON_NULL) - private BusBarSectionsInfos busBarSectionsInfos; -} diff --git a/src/main/java/org/gridsuite/network/map/services/NetworkMapService.java b/src/main/java/org/gridsuite/network/map/services/NetworkMapService.java index 4a19ce11..0078d048 100644 --- a/src/main/java/org/gridsuite/network/map/services/NetworkMapService.java +++ b/src/main/java/org/gridsuite/network/map/services/NetworkMapService.java @@ -18,7 +18,7 @@ import org.gridsuite.network.map.dto.InfoTypeParameters; import org.gridsuite.network.map.dto.definition.hvdc.HvdcShuntCompensatorsInfos; import org.gridsuite.network.map.dto.definition.topology.BusBarSectionsInfos; -import org.gridsuite.network.map.dto.definition.topology.FeederBaysBusBarSectionsInfos; +import org.gridsuite.network.map.dto.definition.topology.FeederBayInfos; import org.gridsuite.network.map.dto.definition.topology.SwitchInfos; import org.gridsuite.network.map.dto.mapper.ElementInfosMapper; import org.gridsuite.network.map.dto.mapper.HvdcInfosMapper; @@ -137,13 +137,10 @@ public BusBarSectionsInfos getBusBarSectionsInfos(UUID networkUuid, String volta return TopologyUtils.getBusBarSectionsInfos(voltageLevel); } - public FeederBaysBusBarSectionsInfos getFeederBaysInfos(UUID networkUuid, String voltageLevelId, String variantId) { + public Map> getFeederBaysInfos(UUID networkUuid, String voltageLevelId, String variantId) { Network network = getNetwork(networkUuid, PreloadingStrategy.NONE, variantId); VoltageLevel voltageLevel = network.getVoltageLevel(voltageLevelId); - FeederBaysBusBarSectionsInfos.FeederBaysBusBarSectionsInfosBuilder builder = FeederBaysBusBarSectionsInfos.builder(); - builder.feederBaysInfos(TopologyUtils.getFeederBaysInfos(voltageLevel)); - builder.busBarSectionsInfos(TopologyUtils.getBusBarSectionsInfos(voltageLevel)); - return builder.build(); + return TopologyUtils.getFeederBaysInfos(voltageLevel); } public List getSwitchInfos(UUID networkUuid, String voltageLevelId, String variantId) { diff --git a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java index c7d59bb6..e0dc5088 100644 --- a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java +++ b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java @@ -1446,8 +1446,8 @@ private static String resourceToString(String resource) throws IOException { return new String(ByteStreams.toByteArray(NetworkMapControllerTest.class.getResourceAsStream(resource)), StandardCharsets.UTF_8); } - private void succeedingTestGettingFeederBaysAndBusBarSectionsInfos(UUID networkUuid, String variantId, String voltageLevelId, String expectedJson) throws Exception { - MvcResult res = mvc.perform(get("/v1/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays-and-bus-bar-sections", networkUuid, voltageLevelId) + private void succeedingTestGettingFeederBaysInfos(UUID networkUuid, String variantId, String voltageLevelId, String expectedJson) throws Exception { + MvcResult res = mvc.perform(get("/v1/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays", networkUuid, voltageLevelId) .queryParam(QUERY_PARAM_VARIANT_ID, variantId)) .andExpect(status().isOk()) .andReturn(); @@ -2376,7 +2376,7 @@ void shouldReturnVoltageLevelBusbarSectionsFormInfos() throws Exception { @Test void shouldReturnVoltageLevelFeederBaysFormInfos() throws Exception { - succeedingTestGettingFeederBaysAndBusBarSectionsInfos(NETWORK_UUID, null, "VLGEN4", resourceToString("/feeder-bays-data.json")); + succeedingTestGettingFeederBaysInfos(NETWORK_UUID, null, "VLGEN4", resourceToString("/feeder-bays-data.json")); } @Test diff --git a/src/test/resources/feeder-bays-data.json b/src/test/resources/feeder-bays-data.json index 8e455f6d..b174c6c8 100644 --- a/src/test/resources/feeder-bays-data.json +++ b/src/test/resources/feeder-bays-data.json @@ -1,43 +1,31 @@ { - "feederBaysInfos": { - "SHUNT_VLNB": [ - { - "busbarSectionId": "NGEN4", - "connectablePositionInfos": { - "connectionDirection": null - }, - "connectionSide": null - } - ], - "LINE7": [ - { - "busbarSectionId": "NGEN4", - "connectablePositionInfos": { - "connectionDirection": "BOTTOM", - "connectionPosition": 5, - "connectionName": "LINE7_Side_VLGEN4" - }, - "connectionSide": "ONE" - } - ], - "SHUNT_NON_LINEAR": [ - { - "busbarSectionId": "NGEN4", - "connectablePositionInfos": { - "connectionDirection": null - }, - "connectionSide": null - } - ] - }, - "busBarSectionsInfos": { - "topologyKind": "NODE_BREAKER", - "isSymmetrical": true, - "isBusbarSectionPositionFound": true, - "busBarSections": { - "1": [ - "NGEN4" - ] + "SHUNT_VLNB": [ + { + "busbarSectionId": "NGEN4", + "connectablePositionInfos": { + "connectionDirection": null + }, + "connectionSide": null } - } + ], + "LINE7": [ + { + "busbarSectionId": "NGEN4", + "connectablePositionInfos": { + "connectionDirection": "BOTTOM", + "connectionPosition": 5, + "connectionName": "LINE7_Side_VLGEN4" + }, + "connectionSide": "ONE" + } + ], + "SHUNT_NON_LINEAR": [ + { + "busbarSectionId": "NGEN4", + "connectablePositionInfos": { + "connectionDirection": null + }, + "connectionSide": null + } + ] } \ No newline at end of file