File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
springboot-webflux-2-restful/src/main/java/org/spring/springboot Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change 3
3
/**
4
4
* 城市实体类
5
5
*
6
- * Created by bysocket on 09/29/2017.
7
6
*/
8
7
public class City {
9
8
Original file line number Diff line number Diff line change @@ -22,14 +22,11 @@ public Mono<Long> save(City city) {
22
22
}
23
23
24
24
public Mono <City > findCityById (Long id ) {
25
- return Mono .create ( cityMonoSink -> cityMonoSink . success ( cityRepository .findCityById (id ) ));
25
+ return Mono .justOrEmpty ( cityRepository .findCityById (id ));
26
26
}
27
27
28
28
public Flux <City > findAllCity () {
29
- return Flux .create (cityFluxSink -> {
30
- cityRepository .findAll ().forEach (city -> cityFluxSink .next (city ));
31
- cityFluxSink .complete ();
32
- });
29
+ return Flux .fromIterable (cityRepository .findAll ());
33
30
}
34
31
35
32
public Mono <Long > modifyCity (City city ) {
You can’t perform that action at this time.
0 commit comments