Merge branch 'refs/heads/marvin'

This commit is contained in:
mepiphana2023
2024-04-23 11:02:00 +02:00
8 changed files with 34 additions and 5 deletions

View File

@@ -1,11 +1,17 @@
package fr.eni.enchere.controllers;
import fr.eni.enchere.bll.ArticleService;
import fr.eni.enchere.bo.Article;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@Controller
@@ -16,6 +22,7 @@ public class AccueilController {
public AccueilController(ArticleService articleService) {
super();
this.articleService = articleService;
}
@@ -25,6 +32,12 @@ public class AccueilController {
return "accueil";
}
@PostMapping("/searchArticle")
public String searchArticle(@ModelAttribute String title, Model model) {
model.addAttribute("Articles", articleService.findArticleByTitle(title));
return "accueil";
}
@GetMapping("/login")
public String login(Model modele) {
return "login";