Skip to content

Commit 94d68f6

Browse files
committed
9272/change GoogleApiConfiguration
1 parent a0b68c2 commit 94d68f6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package greencity.config;
22

33
import com.google.maps.GeoApiContext;
4-
import org.springframework.beans.factory.annotation.Value;
4+
import greencity.properties.GoogleProperties;
5+
import lombok.RequiredArgsConstructor;
56
import org.springframework.context.annotation.Bean;
67
import org.springframework.context.annotation.Configuration;
78

89
@Configuration
10+
@RequiredArgsConstructor
911
public class GoogleApiConfiguration {
10-
@Value("${external.google.api-key}")
11-
private String googleApiKey;
12+
private final GoogleProperties googleProperties;
1213

1314
/**
1415
* Method create ApiContext.
@@ -17,6 +18,6 @@ public class GoogleApiConfiguration {
1718
*/
1819
@Bean
1920
GeoApiContext context() {
20-
return new GeoApiContext.Builder().apiKey(googleApiKey).build();
21+
return new GeoApiContext.Builder().apiKey(googleProperties.getGoogleApiKey()).build();
2122
}
2223
}

0 commit comments

Comments
 (0)