-
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
Add loadflow parameters controller #82
Conversation
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
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.
depending on what we do with my remark on study-server we might need to change the api
src/main/java/org/gridsuite/loadflow/server/entities/parameters/LoadFlowParametersEntity.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/entities/parameters/LoadFlowParametersEntity.java
Outdated
Show resolved
Hide resolved
.../java/org/gridsuite/loadflow/server/entities/parameters/LoadFlowSpecificParameterEntity.java
Outdated
Show resolved
Hide resolved
...java/org/gridsuite/loadflow/server/repositories/parameters/LoadFlowParametersRepository.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/service/parameters/LoadFlowParametersService.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/server/LoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/utils/assertions/DTOAssert.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/utils/assertions/DTOAssert.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/utils/assertions/Assertions.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/utils/assertions/Assertions.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
I added a new endpoint that allows creating default parameters |
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/service/parameters/LoadFlowParametersService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
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.
fix sonar issue about method with 10 parameters (for exemple you can add a class to handle some parameters ; https://github.com/gridsuite/network-modification-server/blob/main/src/main/java/org/gridsuite/modification/server/dto/ReportInfos.java)
src/main/java/org/gridsuite/loadflow/server/LoadFlowController.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
src/main/java/org/gridsuite/loadflow/server/service/parameters/LoadFlowParametersService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/service/parameters/LoadFlowParametersService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
.build(); | ||
} | ||
|
||
public LoadFlowParametersEntity copy() { |
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.
Good !
Good job ! |
src/main/java/org/gridsuite/loadflow/server/dto/parameters/LoadFlowParametersInfos.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/dto/parameters/LoadFlowParametersValues.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/service/parameters/LoadFlowParametersService.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/server/LoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/server/LoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/server/LoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/server/LoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/server/LoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/loadflow/server/LoadFlowParametersTest.java
Outdated
Show resolved
Hide resolved
/** | ||
* @author Ayoub LABIDI <ayoub.labidi at rte-france.com> | ||
*/ | ||
public class DTOAssert<T> extends AbstractAssert<DTOAssert<T>, T> { |
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.
good 👏🏻
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/loadflow/server/LoadFlowParametersController.java
Outdated
Show resolved
Hide resolved
@Operation(summary = "Get all parameters") | ||
@ApiResponse(responseCode = "200", description = "The list of all parameters was returned") | ||
public ResponseEntity<List<LoadFlowParametersInfos>> getAllParameters() { | ||
return ResponseEntity.ok().body(parametersService.getAllParameters()); |
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 ResponseEntity.ok().body(parametersService.getAllParameters()); | |
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(parametersService.getAllParameters()); |
@NoArgsConstructor | ||
@AllArgsConstructor |
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.
To have a constructor without default values
@NoArgsConstructor | |
@AllArgsConstructor | |
@NoArgsConstructor | |
@AllArgsConstructor | |
@RequiredArgsConstructor |
src/main/java/org/gridsuite/loadflow/server/entities/parameters/LoadFlowParametersEntity.java
Outdated
Show resolved
Hide resolved
@Table(name = "loadFlowSpecificParameters", indexes = { | ||
@Index(name = "loadFlowParametersEntity_specificParameters_index", columnList = "load_flow_parameters_id") | ||
}) | ||
public class LoadFlowSpecificParameterEntity { |
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.
myabe add a //TODO
to remember to rename entity field after the data migration?
src/main/resources/db/changelog/changesets/changelog_20240124T152518Z.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
* 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.loadflow.server.service.parameters; |
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.
Why in a sub-package?
src/main/java/org/gridsuite/loadflow/server/service/parameters/LoadFlowParametersService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Linked to: