Rewrite electricity server to .NET web api
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
#include <pistache/http.h>
|
||||
#include <pistache/router.h>
|
||||
|
||||
namespace Server::Api
|
||||
{
|
||||
void GetDay(Pistache::Http::Request const & request, Pistache::Http::ResponseWriter responseWrite);
|
||||
|
||||
void SetupRouting(Pistache::Rest::Router & router);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace Server
|
||||
{
|
||||
class Configuration {
|
||||
private:
|
||||
std::string logDirectory;
|
||||
std::string serverDomain;
|
||||
std::string lastExternalIp;
|
||||
std::chrono::time_point<std::chrono::steady_clock> lastIpCheckTimePoint;
|
||||
std::mutex externalIpRefreshMutex;
|
||||
|
||||
Configuration();
|
||||
Configuration(Configuration & other) = delete;
|
||||
Configuration(Configuration && other) = delete;
|
||||
Configuration & operator=(Configuration & other) = delete;
|
||||
Configuration & operator=(Configuration && other) = delete;
|
||||
|
||||
void RefreshExternalIp();
|
||||
bool ExternalIpRequiresRefresh() const;
|
||||
|
||||
public:
|
||||
void Setup(std::string & electricityLogDirectory, std::string const & serverDomain);
|
||||
|
||||
std::string const & GetLogDirectory() const;
|
||||
std::string const & GetExternalServerIp();
|
||||
|
||||
static Configuration & Get();
|
||||
};
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
#include <string>
|
||||
#include <util/date.hpp>
|
||||
|
||||
namespace Server::Database
|
||||
{
|
||||
std::string GetDetailedJsonOf(Util::Date const & date);
|
||||
std::string GetSummaryJsonOf(Util::Date const & startDate, Util::Date const & stopDate);
|
||||
}
|
||||
Reference in New Issue
Block a user