|
|
@@ -2,10 +2,29 @@
|
|
|
namespace internship\controller;
|
|
|
|
|
|
use n2n\web\http\controller\ControllerAdapter;
|
|
|
+use internship\model\ArticleDao;
|
|
|
+use n2n\context\attribute\Inject;
|
|
|
|
|
|
class ArticleController extends ControllerAdapter {
|
|
|
- function getDoArticles() {
|
|
|
+ #[Inject()]
|
|
|
+ private ArticleDao $articleDao;
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param string|null $categoryName
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ function getDoArticles(string $categoryName = null) {
|
|
|
+
|
|
|
+ echo 'irgendöpis';
|
|
|
+
|
|
|
$this->sendJson(['hello' => 'world']);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function getDoArticle(int $articleId) {
|
|
|
+ $this->sendJson($article);
|
|
|
}
|
|
|
|
|
|
function postDoArticle() {
|