实现登录接口。

This commit is contained in:
root
2025-03-01 09:09:30 +00:00
parent 63aa6a6270
commit d1b8bf6342
15 changed files with 608 additions and 8 deletions

View File

@ -1,17 +1,34 @@
#ifndef __DATASTRUCTURE_H__
#define __DATASTRUCTURE_H__
#include <cstdint>
#include <string>
#include <vector>
struct VisitorStats{
namespace Older {
struct VisitorStats {
std::string url;
int visitorCount=0;
int totalViews =0;
int64_t lastViewTime =0;
int visitorCount = 0;
int totalViews = 0;
int64_t lastViewTime = 0;
};
struct SiteStats{
int totalViews =0;
int totalVisitors =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__