Skip to content

Commit

Permalink
Just to be sure
Browse files Browse the repository at this point in the history
revert `@Autowired` delete
  • Loading branch information
Tristan-WorkGH committed Oct 24, 2024
1 parent 664075f commit 4a4eeb0
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service;

/**
Expand All @@ -12,6 +13,7 @@

import org.apache.commons.lang3.StringUtils;
import org.gridsuite.study.server.RemoteServicesProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
Expand All @@ -32,6 +34,7 @@ public class ActionsService {

private String actionsServerBaseUri;

@Autowired
public ActionsService(RemoteServicesProperties remoteServicesProperties, RestTemplate restTemplate) {
this.actionsServerBaseUri = remoteServicesProperties.getServiceUri("actions-server");
this.restTemplate = restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service;

/**
Expand All @@ -13,6 +14,7 @@
import org.gridsuite.study.server.StudyException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
Expand All @@ -35,6 +37,7 @@ public class CaseService {

private static final Logger LOGGER = LoggerFactory.getLogger(CaseService.class);

@Autowired
public CaseService(@Value("${powsybl.services.case-server.base-uri:http://case-server/}") String caseServerBaseUri, RestTemplate restTemplate) {
this.caseServerBaseUri = caseServerBaseUri;
this.restTemplate = restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand All @@ -22,6 +23,7 @@
import org.gridsuite.study.server.service.shortcircuit.ShortCircuitService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -66,6 +68,7 @@ public class ConsumerService {
private final StudyRepository studyRepository;
private final ShortCircuitService shortCircuitService;

@Autowired
public ConsumerService(ObjectMapper objectMapper,
NotificationService notificationService,
StudyService studyService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
* 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.study.server.service;

import org.gridsuite.study.server.RemoteServicesProperties;
import org.gridsuite.study.server.StudyException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -43,6 +45,7 @@ public String getBaseUri() {
return baseUri;
}

@Autowired
public FilterService(RemoteServicesProperties remoteServicesProperties, RestTemplate restTemplate) {
this.baseUri = remoteServicesProperties.getServiceUri("filter-server");
this.restTemplate = restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service;

/**
Expand All @@ -12,6 +13,7 @@

import org.apache.commons.lang3.StringUtils;
import org.gridsuite.study.server.RemoteServicesProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
Expand All @@ -29,6 +31,7 @@ public class GeoDataService {

private String geoDataServerBaseUri;

@Autowired
public GeoDataService(RemoteServicesProperties remoteServicesProperties, RestTemplate restTemplate) {
this.geoDataServerBaseUri = remoteServicesProperties.getServiceUri("geo-data-server");
this.restTemplate = restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand All @@ -14,6 +15,7 @@
import org.gridsuite.study.server.dto.*;
import org.gridsuite.study.server.repository.StudyEntity;
import org.gridsuite.study.server.service.common.AbstractComputationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.data.domain.Sort;
import org.springframework.http.*;
Expand Down Expand Up @@ -46,6 +48,7 @@ public class LoadFlowService extends AbstractComputationService {
private final NetworkModificationTreeService networkModificationTreeService;
private String loadFlowServerBaseUri;

@Autowired
public LoadFlowService(RemoteServicesProperties remoteServicesProperties,
NetworkModificationTreeService networkModificationTreeService,
NetworkService networkStoreService, ObjectMapper objectMapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service;

/**
Expand All @@ -15,6 +16,7 @@
import org.gridsuite.study.server.StudyException;
import org.gridsuite.study.server.dto.IdentifiableInfos;
import org.gridsuite.study.server.dto.InfoTypeParameters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
Expand Down Expand Up @@ -43,6 +45,7 @@ public class NetworkMapService {

private String networkMapServerBaseUri;

@Autowired
public NetworkMapService(RemoteServicesProperties remoteServicesProperties, RestTemplate restTemplate) {
this.networkMapServerBaseUri = remoteServicesProperties.getServiceUri("network-map-server");
this.restTemplate = restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.gridsuite.study.server.repository.nonevacuatedenergy.NonEvacuatedEnergyParametersEntity;
import org.gridsuite.study.server.repository.nonevacuatedenergy.NonEvacuatedEnergyStageDefinitionEntity;
import org.gridsuite.study.server.repository.nonevacuatedenergy.NonEvacuatedEnergyStagesSelectionEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
Expand Down Expand Up @@ -77,6 +78,7 @@ public class NonEvacuatedEnergyService {

private final NetworkModificationTreeService networkModificationTreeService;

@Autowired
NonEvacuatedEnergyService(RemoteServicesProperties remoteServicesProperties,
NetworkModificationTreeService networkModificationTreeService,
ObjectMapper objectMapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.gridsuite.study.server.dto.sensianalysis.SensitivityAnalysisCsvFileInfos;
import org.gridsuite.study.server.dto.sensianalysis.SensitivityFactorsIdsByGroup;
import org.gridsuite.study.server.repository.StudyEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.HttpStatusCodeException;
Expand Down Expand Up @@ -54,6 +55,7 @@ public class SensitivityAnalysisService {

private final NetworkModificationTreeService networkModificationTreeService;

@Autowired
SensitivityAnalysisService(RemoteServicesProperties remoteServicesProperties,
NetworkModificationTreeService networkModificationTreeService,
RestTemplate restTemplate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
* 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.study.server.service;

import org.gridsuite.study.server.RemoteServicesProperties;
import org.gridsuite.study.server.dto.UserProfileInfos;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;

import java.util.Optional;

import static org.gridsuite.study.server.StudyConstants.DELIMITER;
import static org.gridsuite.study.server.StudyConstants.USER_ADMIN_API_VERSION;
import static org.gridsuite.study.server.StudyConstants.*;
import static org.gridsuite.study.server.StudyException.Type.GET_USER_PROFILE_FAILED;
import static org.gridsuite.study.server.utils.StudyUtils.handleHttpError;

Expand All @@ -31,6 +32,7 @@ public class UserAdminService {
private final RestTemplate restTemplate;
private String userAdminServerBaseUri;

@Autowired
public UserAdminService(RemoteServicesProperties remoteServicesProperties, RestTemplate restTemplate) {
this.userAdminServerBaseUri = remoteServicesProperties.getServiceUri("user-admin-server");
this.restTemplate = restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand All @@ -15,6 +16,7 @@
import org.gridsuite.study.server.dto.NodeReceiver;
import org.gridsuite.study.server.dto.VoltageInitStatus;
import org.gridsuite.study.server.dto.voltageinit.parameters.VoltageInitParametersInfos;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.HttpStatusCodeException;
Expand Down Expand Up @@ -51,6 +53,7 @@ public class VoltageInitService {

private final RestTemplate restTemplate;

@Autowired
public VoltageInitService(RemoteServicesProperties remoteServicesProperties,
NetworkModificationTreeService networkModificationTreeService,
RestTemplate restTemplate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service.client.dynamicmapping.impl;

import org.apache.commons.lang3.StringUtils;
Expand All @@ -13,6 +14,7 @@
import org.gridsuite.study.server.dto.dynamicmapping.ModelInfos;
import org.gridsuite.study.server.service.client.AbstractRestClient;
import org.gridsuite.study.server.service.client.dynamicmapping.DynamicMappingClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
Expand All @@ -33,6 +35,7 @@
@Service
public class DynamicMappingClientImpl extends AbstractRestClient implements DynamicMappingClient {

@Autowired
public DynamicMappingClientImpl(RemoteServicesProperties remoteServicesProperties,
RestTemplate restTemplate) {
super(remoteServicesProperties.getServiceUri("dynamic-mapping-server"), restTemplate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service.client.dynamicsimulation.impl;

import org.gridsuite.study.server.RemoteServicesProperties;
Expand All @@ -14,6 +15,7 @@
import org.gridsuite.study.server.service.StudyService;
import org.gridsuite.study.server.service.client.AbstractRestClient;
import org.gridsuite.study.server.service.client.dynamicsimulation.DynamicSimulationClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
Expand All @@ -36,6 +38,7 @@
@Service
public class DynamicSimulationClientImpl extends AbstractRestClient implements DynamicSimulationClient {

@Autowired
public DynamicSimulationClientImpl(RemoteServicesProperties remoteServicesProperties,
RestTemplate restTemplate) {
super(remoteServicesProperties.getServiceUri("dynamic-simulation-server"), restTemplate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 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.study.server.service.client.timeseries.impl;

import com.powsybl.timeseries.TimeSeries;
Expand All @@ -12,6 +13,7 @@
import org.gridsuite.study.server.dto.timeseries.rest.TimeSeriesGroupRest;
import org.gridsuite.study.server.service.client.AbstractRestClient;
import org.gridsuite.study.server.service.client.timeseries.TimeSeriesClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.client.RestTemplate;
Expand All @@ -31,6 +33,7 @@
@Service
public class TimeSeriesClientImpl extends AbstractRestClient implements TimeSeriesClient {

@Autowired
public TimeSeriesClientImpl(RemoteServicesProperties remoteServicesProperties,
RestTemplate restTemplate) {
super(remoteServicesProperties.getServiceUri("timeseries-server"), restTemplate);
Expand Down

0 comments on commit 4a4eeb0

Please sign in to comment.