File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
mvc-thymeleaf/src/main/java/com/example/demo Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 55 */
66package com .example .demo ;
77
8- import java .time .Duration ;
9- import java .util .List ;
108import lombok .RequiredArgsConstructor ;
119import lombok .extern .slf4j .Slf4j ;
1210import org .springframework .stereotype .Controller ;
1311import org .springframework .ui .Model ;
1412import org .springframework .web .bind .annotation .GetMapping ;
15- import org .thymeleaf .spring5 .context .webflux .ReactiveDataDriverContextVariable ;
13+ import org .thymeleaf .spring6 .context .webflux .ReactiveDataDriverContextVariable ;
1614import reactor .core .publisher .Flux ;
1715
1816/**
19- *
2017 * @author hantsy
2118 */
2219@ Controller
2320@ Slf4j
2421@ RequiredArgsConstructor
2522public class HomeController {
2623
27- private final PostRepository posts ;
24+ private final PostRepository posts ;
2825
29- @ GetMapping ("/home" )
30- public String home (final Model model ) {
26+ @ GetMapping ("/home" )
27+ public String home (final Model model ) {
3128
32- Flux <Post > postList = this .posts .findAll ();
33- model .addAttribute ("posts" , new ReactiveDataDriverContextVariable (postList , 100 ));
34- return "home" ;
35- }
29+ Flux <Post > postList = this .posts .findAll ();
30+ model .addAttribute ("posts" , new ReactiveDataDriverContextVariable (postList , 100 ));
31+ return "home" ;
32+ }
3633
3734}
You can’t perform that action at this time.
0 commit comments