better article

This commit is contained in:
Parpaillax
2024-04-30 16:53:08 +02:00
parent efdf1cb306
commit ba908f9352
4 changed files with 22 additions and 7 deletions

View File

@@ -74,7 +74,12 @@ public class ArticleController {
lastEnchere = lastEnchere.stream()
.sorted(Comparator.comparing(Enchere::getMontantEnchere).reversed())
.collect(Collectors.toList());
Optional<String> pseudoMaxEnchere = lastEnchere.stream()
.max(Comparator.comparing(Enchere::getMontantEnchere)) // Comparaison basée sur le montant d'enchère
.map(Enchere::getPseudoUtilisateur);
model.addAttribute("encheres", lastEnchere);
model.addAttribute("maxEncherePseudo", pseudoMaxEnchere.orElse(""));
model.addAttribute("isArticleCurrentUser", isArticleCurrentUser);
model.addAttribute("article", article);
model.addAttribute("username", user);