Update user guide azure content
This commit is contained in:
@@ -15,17 +15,18 @@
|
||||
*/
|
||||
package com.example;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SampleApplication {
|
||||
|
||||
@@ -41,18 +42,16 @@ public class SampleApplication {
|
||||
@Bean
|
||||
public Function<MultiValueMap<String, String>, Map<String, Integer>> sum() {
|
||||
return multiValueMap -> {
|
||||
|
||||
Map<String, Integer> result = new HashMap<>();
|
||||
|
||||
multiValueMap.forEach((s, strings) -> result.put(s, strings.stream().mapToInt(Integer::parseInt).sum()));
|
||||
|
||||
multiValueMap.forEach((s, strings) -> result.put(s,
|
||||
strings.stream().mapToInt(Integer::parseInt).sum()));
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Supplier<Flux<Foo>> words() {
|
||||
return () -> Flux.fromArray(new Foo[]{new Foo("foo"), new Foo("bar")}).log();
|
||||
return () -> Flux.fromArray(new Foo[] { new Foo("foo"), new Foo("bar") }).log();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user