Let's make (git) history!
This commit is contained in:
36
requestworker.h
Normal file
36
requestworker.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#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
|
Reference in New Issue
Block a user