Skip to content

Commit bfae137

Browse files
committed
chore: clean codes
1 parent 293d804 commit bfae137

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

mvc-thymeleaf/src/main/java/com/example/demo/HomeController.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,30 @@
55
*/
66
package com.example.demo;
77

8-
import java.time.Duration;
9-
import java.util.List;
108
import lombok.RequiredArgsConstructor;
119
import lombok.extern.slf4j.Slf4j;
1210
import org.springframework.stereotype.Controller;
1311
import org.springframework.ui.Model;
1412
import org.springframework.web.bind.annotation.GetMapping;
15-
import org.thymeleaf.spring5.context.webflux.ReactiveDataDriverContextVariable;
13+
import org.thymeleaf.spring6.context.webflux.ReactiveDataDriverContextVariable;
1614
import reactor.core.publisher.Flux;
1715

1816
/**
19-
*
2017
* @author hantsy
2118
*/
2219
@Controller
2320
@Slf4j
2421
@RequiredArgsConstructor
2522
public 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
}

0 commit comments

Comments
 (0)