Added Controller namespace

This commit is contained in:
kdeng00
2019-09-01 16:16:06 -04:00
parent f75ebe14a7
commit 1ec3511bc5
17 changed files with 305 additions and 202 deletions
+2 -1
View File
@@ -14,7 +14,7 @@ namespace Database
public:
base_repository();
base_repository(const std::string&);
base_repository(const BinaryPath&);
base_repository(const Model::BinaryPath&);
protected:
MYSQL* setup_mysql_connection();
MYSQL* setup_mysql_connection(Model::database_connection);
@@ -24,6 +24,7 @@ namespace Database
Model::database_connection details;
private:
void intitalizeDetails();
void initializeDetails(const Model::BinaryPath&);
std::string path;
Model::BinaryPath m_binConf;
+13 -9
View File
@@ -7,17 +7,21 @@
#include "models/models.h"
#include "types/coverFilter.h"
class coverArtRepository : public base_repository
namespace Database
{
public:
coverArtRepository(const std::string&);
class coverArtRepository : public base_repository
{
public:
coverArtRepository(const std::string&);
coverArtRepository(const Model::BinaryPath&);
Model::Cover retrieveRecord(Model::Cover&, coverFilter);
Model::Cover retrieveRecord(Model::Cover&, coverFilter);
void deleteRecord(const Model::Cover&);
void saveRecord(const Model::Cover&);
private:
Model::Cover parseRecord(MYSQL_RES*);
};
void deleteRecord(const Model::Cover&);
void saveRecord(const Model::Cover&);
private:
Model::Cover parseRecord(MYSQL_RES*);
};
}
#endif
+15 -11
View File
@@ -10,21 +10,25 @@
#include "models/models.h"
#include "types/songFilter.h"
class songRepository : public base_repository
namespace Database
{
public:
songRepository(const std::string&);
class songRepository : public base_repository
{
public:
songRepository(const std::string&);
songRepository(const Model::BinaryPath&);
std::vector<Model::Song> retrieveRecords();
std::vector<Model::Song> retrieveRecords();
Model::Song retrieveRecord(Model::Song&, songFilter);
Model::Song retrieveRecord(Model::Song&, songFilter);
void deleteRecord(const Model::Song&);
void saveRecord(const Model::Song&);
private:
std::vector<Model::Song> parseRecords(MYSQL_RES*);
void deleteRecord(const Model::Song&);
void saveRecord(const Model::Song&);
private:
std::vector<Model::Song> parseRecords(MYSQL_RES*);
Model::Song parseRecord(MYSQL_RES*);
};
Model::Song parseRecord(MYSQL_RES*);
};
}
#endif
+2
View File
@@ -11,9 +11,11 @@ namespace Manager
{
public:
coverArtManager(const std::string&);
coverArtManager(const Model::BinaryPath& bConf);
Model::Cover saveCover(const Model::Song&, std::string&, const std::string&);
private:
Model::BinaryPath m_bConf;
std::string path;
};
}
+5 -1
View File
@@ -15,11 +15,15 @@ namespace Manager
public:
static std::string create_directory_process(Model::Song, const std::string&);
static std::string configPath(std::string_view);
static std::string contentOfPath(std::string_view);
static std::string configPath(const Model::BinaryPath&);
static std::string contentOfPath(const std::string&);
static nlohmann::json credentialConfigContent(const std::string&);
static nlohmann::json credentialConfigContent(const Model::BinaryPath&);
static nlohmann::json databaseConfigContent(const std::string&);
static nlohmann::json databaseConfigContent(const Model::BinaryPath&);
static nlohmann::json pathConfigContent(const std::string&);
static nlohmann::json pathConfigContent(const Model::BinaryPath&);
void delete_cover_art_file(const std::string&, const std::string&);
static void delete_directories(Model::Song, const std::string&);
+2
View File
@@ -14,6 +14,7 @@ namespace Manager
{
public:
song_manager(std::string&);
song_manager(const Model::BinaryPath&);
void saveSong(Model::Song&);
void deleteSong(Model::Song&);
@@ -22,6 +23,7 @@ namespace Manager
private:
void saveSongTemp(Model::Song&);
Model::BinaryPath m_bConf;
std::string exe_path;
};
}
+2 -2
View File
@@ -20,12 +20,12 @@ namespace Manager
Model::loginResult retrieve_token();
Model::loginResult retrieve_token(std::string_view);
Model::loginResult retrieve_token(const BinaryPath&);
Model::loginResult retrieve_token(const Model::BinaryPath&);
bool is_token_valid(std::string&, Scope);
private:
Model::auth_credentials parse_auth_credentials(std::string_view);
Model::auth_credentials parse_auth_credentials(const BinaryPath&);
Model::auth_credentials parse_auth_credentials(const Model::BinaryPath&);
std::vector<std::string> extract_scopes(const jwt::decoded_jwt&&);
std::pair<bool, std::vector<std::string>> fetch_auth_header(const std::string&);