diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-08-24 19:04:13 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-08-24 19:04:13 +0200 |
commit | 38e20390ddf38edd74447ef7db2af660b8e0ff32 (patch) | |
tree | 19139ea991ae5d99b28d5c1f9f509ff0ebf4b151 /include/GetEssen.hpp | |
parent | 61464b6d069513eda07e4fc2638c8889cbce98f5 (diff) | |
download | n_core-38e20390ddf38edd74447ef7db2af660b8e0ff32.tar.gz n_core-38e20390ddf38edd74447ef7db2af660b8e0ff32.zip |
add all available commands (in this branch? @Max where are the others?)
Diffstat (limited to 'include/GetEssen.hpp')
-rw-r--r-- | include/GetEssen.hpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/GetEssen.hpp b/include/GetEssen.hpp new file mode 100644 index 0000000..ff75029 --- /dev/null +++ b/include/GetEssen.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include <iostream> +#include <sys/stat.h> + +#include <curl/curl.h> + +#include <boost/date_time/date_formatting.hpp> +#include <boost/date_time/gregorian/gregorian.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> + +#include "Handler.hpp" +#include "Response.hpp" + +namespace Handler { + namespace MensaHandler { + using std::string; + using boost::posix_time::ptime; + + struct MensaEssen { + int ID{191}; + string Message{"nothing got back! There was an error!!"}; + ptime Datum; + ptime LastModified; + }; + + enum mensa { + Adlershof = 191, Nord = 147, Sued = 367 + }; + + + bool db_update_mensa_message(const int &mensaID, const ptime &mensaDatum, const string &message); + + bool db_insert_mensa_message(const int &mensaID, const ptime &mensaDatum, const string &message); + + MensaEssen db_get_mensa_message(const int &mensaID, const ptime &mensaDatum); + + string getEssen(const int mensa_ID, const int offset); + + string read_mensa_message_from_file(const int &mensa_id_file); + } + + json mensaHandler(std::string const &arguments, std::string const &session, void *payload); +} + + + |