34 lines
754 B
C++
34 lines
754 B
C++
#ifndef __DATASTRUCTURE_H__
|
|
#define __DATASTRUCTURE_H__
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Older {
|
|
struct VisitorStats {
|
|
std::string url;
|
|
int visitorCount = 0;
|
|
int totalViews = 0;
|
|
int64_t lastViewTime = 0;
|
|
};
|
|
|
|
struct SiteStats {
|
|
int totalViews = 0;
|
|
int totalVisitors = 0;
|
|
};
|
|
|
|
struct Account {
|
|
int64_t id = 0;
|
|
std::string username;
|
|
std::string email;
|
|
std::vector<uint8_t> passwordHash;
|
|
std::vector<uint8_t> salt;
|
|
int64_t createdAt = 0;
|
|
|
|
static Account hashPassword(const std::string &password);
|
|
static bool verifyPassword(const Account &account, const std::string &password);
|
|
static bool validateEmail(const std::string& email);
|
|
};}
|
|
|
|
#endif // __DATASTRUCTURE_H__
|