58 lines
1.1 KiB
Java
58 lines
1.1 KiB
Java
package org.hso.ecommerce.controller.intern;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import org.hso.ecommerce.entities.shop.Article;
|
|
import org.hso.ecommerce.repos.shop.ArticleRepository;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
@RequestMapping("intern/listedArticles")
|
|
public class InternArticleController {
|
|
|
|
@Autowired
|
|
private final ArticleRepository articleRepository = null;
|
|
|
|
/*
|
|
@Autowired
|
|
public InternArticleController(ArticleRepository articleRepository)
|
|
{
|
|
this.articleRepository = articleRepository;
|
|
}
|
|
*/
|
|
|
|
@GetMapping("/")
|
|
public String internListedArticles(Model model) {
|
|
|
|
|
|
List<Article> articles = articleRepository.findAll();
|
|
|
|
System.out.println(articles.size());
|
|
|
|
|
|
|
|
// model.addAttribute("ListedArticles", bookService.findAll());
|
|
|
|
|
|
|
|
return "intern/listedArticles/index";
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/{id}")
|
|
public String internListedArticlesId() {
|
|
return "intern/listedArticles/id";
|
|
}
|
|
|
|
|
|
}
|