Able to save and retrieve records (Artist, Album, Genre, etc.)

This commit is contained in:
kdeng00
2019-09-02 13:59:49 -04:00
parent fafb39326b
commit 4306c174b3
26 changed files with 522 additions and 34 deletions
-1
View File
@@ -31,7 +31,6 @@ namespace Controller
OATPP_LOGI("icarus", "logging in");
Manager::token_manager tok;
//auto token = tok.retrieve_token(exe_path);
auto token = tok.retrieve_token(m_bConf);
auto logRes = Dto::loginResultDto::createShared();
+6 -1
View File
@@ -3,7 +3,7 @@
#include "database/base_repository.h"
#include "models/models.h"
#include "types/coverFilter.h"
#include "types/artistFilter.h"
namespace Database
{
@@ -11,7 +11,12 @@ namespace Database
{
public:
artistRepository(const Model::BinaryPath&);
Model::Artist retrieveRecord(Model::Artist&, Type::artistFilter);
void saveRecord(const Model::Artist&);
private:
Model::Artist parseRecord(MYSQL_RES*);
};
}
+6
View File
@@ -3,6 +3,7 @@
#include "database/base_repository.h"
#include "models/models.h"
#include "types/genreFilter.h"
namespace Database
{
@@ -10,7 +11,12 @@ namespace Database
{
public:
genreRepository(const Model::BinaryPath&);
Model::Genre retrieveRecord(Model::Genre&, Type::genreFilter);
void saveRecord(const Model::Genre&);
private:
Model::Genre parseRecord(MYSQL_RES*);
};
}
+6
View File
@@ -3,6 +3,7 @@
#include "database/base_repository.h"
#include "models/models.h"
#include "types/yearFilter.h"
namespace Database
{
@@ -10,7 +11,12 @@ namespace Database
{
public:
yearRepository(const Model::BinaryPath&);
Model::Year retrieveRecord(Model::Year&, Type::yearFilter);
void saveRecord(const Model::Year&);
private:
Model::Year parseRecord(MYSQL_RES*);
};
}
+4 -1
View File
@@ -10,7 +10,10 @@ namespace Manager
public:
albumManager(const Model::BinaryPath&);
void saveAlbum(const Model::Song&);
Model::Album retrieveAlbum(Model::Album&);
Model::Album saveAlbum(const Model::Song&);
static void printAlbum(const Model::Album&);
private:
Model::BinaryPath m_bConf;
};
+5
View File
@@ -9,6 +9,11 @@ namespace Manager
{
public:
artistManager(const Model::BinaryPath&);
Model::Artist retrieveArtist(Model::Artist&);
Model::Artist saveArtist(const Model::Song&);
static void printArtist(const Model::Artist&);
private:
Model::BinaryPath m_bConf;
};
+3 -3
View File
@@ -18,11 +18,11 @@ namespace Manager
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 std::string&);
static nlohmann::json credentialConfigContent(const Model::BinaryPath&);
static nlohmann::json databaseConfigContent(const std::string&);
//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 std::string&);
static nlohmann::json pathConfigContent(const Model::BinaryPath&);
void delete_cover_art_file(const std::string&, const std::string&);
+5
View File
@@ -9,6 +9,11 @@ namespace Manager
{
public:
genreManager(const Model::BinaryPath&);
Model::Genre retrieveGenre(Model::Genre&);
Model::Genre saveGenre(const Model::Song&);
static void printGenre(const Model::Genre&);
private:
Model::BinaryPath m_bConf;
};
+5
View File
@@ -9,6 +9,11 @@ namespace Manager
{
public:
yearManager(const Model::BinaryPath&);
Model::Year retrieveYear(Model::Year&);
Model::Year saveYear(const Model::Song&);
static void printYear(const Model::Year&);
private:
Model::BinaryPath m_bConf;
};
+2
View File
@@ -94,6 +94,8 @@ namespace Model
{
BinaryPath() = default;
BinaryPath(const char *p) : path(std::move(p)) { }
BinaryPath(std::string& p) : path(std::move(p)) { }
BinaryPath(const std::string& p) : path(std::move(p)) { }
std::string path;
};
}