-
Notifications
You must be signed in to change notification settings - Fork 0
allow to have a list of temporary limits in line catalog #764
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
Changes from 13 commits
c96609c
38c604b
c3997f3
2d5683d
30d801e
d519030
7805b12
8b7c0c7
e680116
e972bf4
b51b241
e6f8675
3c0c690
7864969
8853c81
0c3c2a5
a099c06
86094f8
f096ad7
0aa4434
cb4f441
e44647d
84ed283
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -197,8 +197,18 @@ public ResponseEntity<List<LineTypeInfos>> getLineTypes() { | |||||
| @GetMapping(value = "/network-modifications/catalog/line_types/{uuid}", produces = MediaType.APPLICATION_JSON_VALUE) | ||||||
| @Operation(summary = "Get a line types catalog") | ||||||
| @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The line types catalog is returned")}) | ||||||
| public ResponseEntity<LineTypeInfos> getOneLineTypeWithLimits(@PathVariable("uuid") UUID uuid) { | ||||||
| return ResponseEntity.ok().body(lineTypesCatalogService.getLineTypesWithLimits(uuid)); | ||||||
| public ResponseEntity<LineTypeInfos> getOneLineTypeWithAreaAndTemperature(@PathVariable("uuid") UUID uuid) { | ||||||
| return ResponseEntity.ok().body(lineTypesCatalogService.getLineTypesWithAreaTemperatureShapeFactors(uuid)); | ||||||
| } | ||||||
|
|
||||||
| @GetMapping(value = "/network-modifications/catalog/line_types/{uuid}/withLimits", produces = MediaType.APPLICATION_JSON_VALUE) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From our guidelines :
Suggested change
But there are conflicting data in the examples !
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where do you see conflicts ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be better keep it withLimits without "-"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the guideline page you have the above texte which asks for kebab case and at the end of the page you have that king of example :
Which don't use kebab case at all. |
||||||
| @Operation(summary = "Get a line types catalog") | ||||||
|
Mathieu-Deharbe marked this conversation as resolved.
Outdated
|
||||||
| @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The line types catalog is returned")}) | ||||||
| public ResponseEntity<LineTypeInfos> getOneLineTypeWithLimits(@PathVariable UUID uuid, @RequestParam String area, | ||||||
| @RequestParam(required = false) String temperature, | ||||||
| @RequestParam(required = false) String shapeFactor) { | ||||||
| LineTypeInfos test = lineTypesCatalogService.getLineTypesWithLimits(uuid, area, temperature, shapeFactor); | ||||||
| return ResponseEntity.ok().body(test); | ||||||
| } | ||||||
|
|
||||||
| @PostMapping(value = "/network-modifications/catalog/line_types", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /** | ||
| * Copyright (c) 2026, 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/. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
| package org.gridsuite.modification.server.dto.catalog; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
| import lombok.experimental.SuperBuilder; | ||
| import org.gridsuite.modification.server.entities.catalog.TemporaryLimitEntity; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| /** | ||
| * @author Etienne Lesot <etienne.lesot at rte-france.com> | ||
| */ | ||
| @SuperBuilder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Getter | ||
| @Setter | ||
| @Schema(description = "Temporary Limits infos") | ||
|
Mathieu-Deharbe marked this conversation as resolved.
Outdated
|
||
| public class TemporaryLimitInfos { | ||
| @Schema(description = "id") | ||
| private UUID id; | ||
|
|
||
| @Schema(description = "Temporary limit value") | ||
| private Double limitValue; | ||
|
|
||
| @Schema(description = "Temporary limit acceptable duration") | ||
| private Integer acceptableDuration; | ||
|
|
||
| @Schema(description = "Temporary limit name") | ||
| private String name; | ||
|
|
||
| public TemporaryLimitEntity toTemporaryLimitEntity() { | ||
| return TemporaryLimitEntity.builder() | ||
| .limitValue(limitValue) | ||
| .acceptableDuration(acceptableDuration) | ||
| .name(name).build(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| import jakarta.persistence.*; | ||
| import lombok.NoArgsConstructor; | ||
| import org.gridsuite.modification.server.dto.catalog.AerialLineTypeInfos; | ||
| import org.gridsuite.modification.server.dto.catalog.LineTypeInfos; | ||
|
|
||
| /** | ||
| * @author Sylvain Bouzols <sylvain.bouzols at rte-france.com> | ||
|
|
@@ -41,17 +42,17 @@ private void assignAttributes(AerialLineTypeInfos aerialLineType) { | |
|
|
||
| AerialLineTypeInfos.AerialLineTypeInfosBuilder<?, ?> toDtoBuilder() { | ||
| return AerialLineTypeInfos.builder() | ||
| .id(this.getId()) | ||
| .type(this.getType()) | ||
| .voltage(this.getVoltage()) | ||
| .conductorType(this.getConductorType()) | ||
| .section(this.getSection()) | ||
| .conductorsNumber(this.conductorsNumber) | ||
| .circuitsNumber(this.circuitsNumber) | ||
| .groundWiresNumber(this.groundWiresNumber) | ||
| .linearResistance(this.getLinearResistance()) | ||
| .linearReactance(this.getLinearReactance()) | ||
| .linearCapacity(this.getLinearCapacity()); | ||
| .id(this.getId()) | ||
| .type(this.getType()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| .voltage(this.getVoltage()) | ||
| .conductorType(this.getConductorType()) | ||
| .section(this.getSection()) | ||
| .conductorsNumber(this.conductorsNumber) | ||
| .circuitsNumber(this.circuitsNumber) | ||
| .groundWiresNumber(this.groundWiresNumber) | ||
| .linearResistance(this.getLinearResistance()) | ||
| .linearReactance(this.getLinearReactance()) | ||
| .linearCapacity(this.getLinearCapacity()); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -60,10 +61,20 @@ public AerialLineTypeInfos toDto() { | |
| } | ||
|
|
||
| @Override | ||
| public AerialLineTypeInfos toDtoWithLimits() { | ||
| public AerialLineTypeInfos toDtoWithLimits(String area, String temperature, String shapeFactor) { | ||
| return toDtoBuilder() | ||
| .limitsForLineType(this.getLimitsForLineType().stream().map(LimitsForLineTypeEntity::toLineTypeInfos).toList()) | ||
| .build(); | ||
| .limitsForLineType(this.getLimitsForLineType().stream() | ||
| .filter(limitsForLineTypeEntity -> limitsForLineTypeEntity.getArea().equals(area) && | ||
| limitsForLineTypeEntity.getTemperature().equals(temperature)) | ||
| .map(LimitsForLineTypeEntity::toLineTypeInfos).toList()) | ||
| .build(); | ||
| } | ||
|
|
||
| @Override | ||
| public LineTypeInfos toDtoWithAreaTemperatureShapeFactors() { | ||
| return toDtoBuilder() | ||
| .limitsForLineType(this.getLimitsForLineType().stream().map(LimitsForLineTypeEntity::toLineTypeInfosWithoutLimits).toList()) | ||
| .build(); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /** | ||
| * Copyright (c) 2026, 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/. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
| package org.gridsuite.modification.server.entities.catalog; | ||
|
|
||
| import jakarta.persistence.*; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
| import lombok.experimental.SuperBuilder; | ||
| import org.gridsuite.modification.server.dto.catalog.TemporaryLimitInfos; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| /** | ||
| * @author Etienne Lesot <etienne.lesot at rte-france.com> | ||
| */ | ||
| @Getter | ||
| @Setter | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @SuperBuilder | ||
| @Entity | ||
| @Table(name = "temporary_limit_for_line_catalog") | ||
| public class TemporaryLimitEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.AUTO) | ||
| @Column(name = "id") | ||
| private UUID id; | ||
|
|
||
| @Column | ||
| private Double limitValue; | ||
|
|
||
| @Column | ||
| private Integer acceptableDuration; | ||
|
|
||
| @Column | ||
| private String name; | ||
|
|
||
| public TemporaryLimitInfos toTemporaryLimitInfos() { | ||
| return TemporaryLimitInfos.builder() | ||
| .id(id) | ||
| .limitValue(limitValue) | ||
| .acceptableDuration(acceptableDuration) | ||
| .name(name) | ||
| .build(); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.