File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/main/java/com/broadcom/tanzu/demos/springai101/weather Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package com .broadcom .tanzu .demos .springai101 .weather ;
18
18
19
+ import org .slf4j .Logger ;
20
+ import org .slf4j .LoggerFactory ;
19
21
import org .springframework .ai .chat .client .ChatClient ;
20
22
import org .springframework .http .MediaType ;
21
23
import org .springframework .web .bind .annotation .GetMapping ;
26
28
27
29
@ RestController
28
30
class WeatherV1Controller {
31
+ private final Logger logger = LoggerFactory .getLogger (WeatherV1Controller .class );
29
32
private final WeatherService weatherService ;
30
33
private final ChatClient chatClient ;
31
34
@@ -44,6 +47,7 @@ String weather(@RequestParam("city") String city) {
44
47
new Function <ByCityRequest , Weather >() {
45
48
@ Override
46
49
public Weather apply (ByCityRequest req ) {
50
+ logger .info ("Loading weather from {} using OpenWeatherMap in inline function" , req .city ());
47
51
return weatherService .getWeatherByCity (req .city ());
48
52
}
49
53
})
You can’t perform that action at this time.
0 commit comments