File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
service/src/main/java/greencity/config Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11package greencity .config ;
22
33import com .google .maps .GeoApiContext ;
4- import org .springframework .beans .factory .annotation .Value ;
4+ import greencity .properties .GoogleProperties ;
5+ import lombok .RequiredArgsConstructor ;
56import org .springframework .context .annotation .Bean ;
67import org .springframework .context .annotation .Configuration ;
78
89@ Configuration
10+ @ RequiredArgsConstructor
911public 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}
You can’t perform that action at this time.
0 commit comments