37 baris
772 B
C
37 baris
772 B
C
|
#ifndef REQUESTWORKER_H
|
||
|
#define REQUESTWORKER_H
|
||
|
|
||
|
#include "request.h"
|
||
|
#include "response.h"
|
||
|
#include "session.h"
|
||
|
#include "template.h"
|
||
|
#include "database/database.h"
|
||
|
#include "urlprovider.h"
|
||
|
#include "database/sessiondao.h"
|
||
|
#include "cache/fscache.h"
|
||
|
class RequestWorker
|
||
|
{
|
||
|
Database *db;
|
||
|
Template *templ;
|
||
|
UrlProvider *urlProvider;
|
||
|
ICache *cache;
|
||
|
std::unique_ptr<SessionDao> sessionDao;
|
||
|
|
||
|
private:
|
||
|
Session retrieveSession(std::string token) const;
|
||
|
|
||
|
public:
|
||
|
RequestWorker(Database &db, Template &templ, UrlProvider &provider, ICache &cache)
|
||
|
{
|
||
|
this->db = &db;
|
||
|
this->templ = &templ;
|
||
|
this->urlProvider = &provider;
|
||
|
this->sessionDao = db.createSessionDao();
|
||
|
this->cache = &cache;
|
||
|
}
|
||
|
|
||
|
Response processRequest(const Request &r);
|
||
|
};
|
||
|
|
||
|
#endif // REQUESTWORKER_H
|