This repository has been archived on 2020-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
e-commerce/prototype/src/main/java/org/hso/ecommerce/controller/intern/InternArticleController.java

58 lines
1.1 KiB
Java
Raw Normal View History

2020-04-29 22:44:16 +02:00
package org.hso.ecommerce.controller.intern;
2020-04-28 22:41:29 +02:00
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;
2020-04-28 22:41:29 +02:00
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
2020-04-28 22:41:29 +02:00
@Controller
@RequestMapping("intern/listedArticles")
2020-05-01 10:48:12 +02:00
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";
}
2020-04-28 22:41:29 +02:00
}