database stuff

This commit is contained in:
kdeng00
2019-08-18 11:57:08 -04:00
parent 5230e69832
commit d26c16aa69
11 changed files with 211 additions and 48 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef BASE_REPOSITORY_H_
#define BASE_REPOSITORY_H_
#include<string>
#include <mysql/mysql.h>
#include "models.h"
class base_repository
{
public:
MYSQL* setup_mysql_connection(database_connection);
MYSQL_RES* perform_mysql_query(MYSQL*, std::string&);
private:
};
#endif
+10
View File
@@ -48,6 +48,16 @@ struct auth_credentials
std::string api_identifier;
std::string client_id;
std::string client_secret;
std::string uri;
std::string endpoint;
};
struct database_connection
{
std::string server;
std::string username;
std::string password;
std::string database;
};
struct TokenReq
+4 -3
View File
@@ -1,6 +1,8 @@
#ifndef TOKEN_MANAGER_H_
#define TOKEN_MANAGER_H_
#include <string_view>
#include "models.h"
class token_manager
@@ -9,10 +11,9 @@ public:
token_manager();
loginResult retrieve_token();
//LoginRes* retrieve_token(TokenReq *tok);
loginResult retrieve_token(std::string_view);
private:
auth_credentials parse_auth_credentials();
auth_credentials parse_auth_credentials(std::string_view);
};
#endif