Skip to content
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

Merged
merged 22 commits into from
Jan 26, 2024
Merged

Conversation

ayolab
Copy link
Contributor

@ayolab ayolab commented Dec 26, 2023

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>
Copy link
Contributor

@AbdelHedhili AbdelHedhili left a 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

Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
@ayolab ayolab requested a review from AbdelHedhili January 10, 2024 15:42
@ayolab
Copy link
Contributor Author

ayolab commented Jan 10, 2024

depending on what we do with my remark on study-server we might need to change the api

I added a new endpoint that allows creating default parameters

Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
@ayolab ayolab requested a review from AbdelHedhili January 15, 2024 14:19
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>
Copy link
Contributor

@AbdelHedhili AbdelHedhili left a 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)

Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
@ayolab ayolab requested a review from flomillot January 17, 2024 12:22
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
.build();
}

public LoadFlowParametersEntity copy() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good !

@SlimaneAmar
Copy link
Contributor

Good job !

/**
* @author Ayoub LABIDI <ayoub.labidi at rte-france.com>
*/
public class DTOAssert<T> extends AbstractAssert<DTOAssert<T>, T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good 👏🏻

@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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ResponseEntity.ok().body(parametersService.getAllParameters());
return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(parametersService.getAllParameters());

Comment on lines +28 to +29
@NoArgsConstructor
@AllArgsConstructor
Copy link
Contributor

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

Suggested change
@NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@RequiredArgsConstructor

@Table(name = "loadFlowSpecificParameters", indexes = {
@Index(name = "loadFlowParametersEntity_specificParameters_index", columnList = "load_flow_parameters_id")
})
public class LoadFlowSpecificParameterEntity {
Copy link
Contributor

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?

Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
@ayolab ayolab requested a review from Tristan-WorkGH January 26, 2024 10:58
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;
Copy link
Contributor

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?

Signed-off-by: Ayoub LABIDI <ayoub.labidi@protonmail.com>
Copy link

@ayolab ayolab merged commit 15ac580 into main Jan 26, 2024
3 checks passed
@ayolab ayolab deleted the add_loadflow_parameters_controller branch January 26, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants