-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/gridsuite/network-modificat…
…ion-server into homogenize_2WT_attributes
- Loading branch information
Showing
43 changed files
with
1,322 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/org/gridsuite/modification/server/dto/ModificationMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Copyright (c) 2024, 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.modification.server.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.gridsuite.modification.server.ModificationType; | ||
import java.util.UUID; | ||
|
||
/** | ||
* @author David Braquart <david.braquart@rte-france.com> | ||
*/ | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@Schema(description = "Modification metadata") | ||
public class ModificationMetadata { | ||
|
||
@Schema(description = "Modification id") | ||
private UUID id; | ||
|
||
@Schema(description = "Modification type") | ||
private ModificationType type; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/main/java/org/gridsuite/modification/server/dto/TabularCreationInfos.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
Copyright (c) 2024, 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.modification.server.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
import com.powsybl.commons.reporter.Reporter; | ||
import com.powsybl.commons.reporter.ReporterModel; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
import org.gridsuite.modification.server.ModificationType; | ||
import org.gridsuite.modification.server.dto.annotation.ModificationErrorTypeName; | ||
import org.gridsuite.modification.server.entities.ModificationEntity; | ||
import org.gridsuite.modification.server.entities.TabularCreationEntity; | ||
import org.gridsuite.modification.server.modifications.AbstractModification; | ||
import org.gridsuite.modification.server.modifications.TabularCreation; | ||
import org.springframework.lang.NonNull; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author Franck Lecuyer <franck.lecuyer at rte-france.com> | ||
*/ | ||
@EqualsAndHashCode(callSuper = true) | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@Data | ||
@Schema(description = "Tabular creation") | ||
@JsonTypeName("TABULAR_CREATION") | ||
@ModificationErrorTypeName("TABULAR_CREATION_ERROR") | ||
public class TabularCreationInfos extends ModificationInfos { | ||
|
||
@Schema(description = "Creation type") | ||
@NonNull | ||
private ModificationType creationType; | ||
|
||
@Schema(description = "Creations") | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private List<ModificationInfos> creations; | ||
|
||
@Override | ||
public ModificationEntity toEntity() { | ||
return new TabularCreationEntity(this); | ||
} | ||
|
||
@Override | ||
public AbstractModification toModification() { | ||
return new TabularCreation(this); | ||
} | ||
|
||
@Override | ||
public Reporter createSubReporter(ReporterModel reporter) { | ||
return reporter.createSubReporter(ModificationType.TABULAR_CREATION.name(), "Tabular creation"); | ||
} | ||
|
||
@Override | ||
public Map<String, String> getMapMessageValues() { | ||
Map<String, String> mapMessageValues = new HashMap<>(); | ||
mapMessageValues.put("tabularCreationType", getCreationType().name()); | ||
return mapMessageValues; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.