From 6373d3660b2774bdf94de9418dddb105fe0f48a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Fri, 26 May 2017 17:27:46 +0200 Subject: [PATCH] Implemented ReadingListsController. --- .../server/controllers/readinglistscontroller.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/YACReaderLibrary/server/controllers/readinglistscontroller.cpp b/YACReaderLibrary/server/controllers/readinglistscontroller.cpp index 095832b7..0c76b314 100644 --- a/YACReaderLibrary/server/controllers/readinglistscontroller.cpp +++ b/YACReaderLibrary/server/controllers/readinglistscontroller.cpp @@ -1,5 +1,8 @@ #include "readinglistscontroller.h" +#include "db_helper.h" +#include "reading_list.h" + ReadingListsController::ReadingListsController() { @@ -20,5 +23,10 @@ void ReadingListsController::service(HttpRequest &request, HttpResponse &respons void ReadingListsController::serviceContent(const int library, HttpResponse &response) { + QList readingLists = DBHelper::getReadingLists(library); + foreach(const ReadingList &item, readingLists) + { + response.write(QString("%1\t%2\t%3\r\n").arg(library).arg(item.getId()).arg(item.getName()).toUtf8()); + } }