forked from chookspace/chookchat
yay initial commit
This commit is contained in:
35
server/src/post.h
Normal file
35
server/src/post.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef POST_H
|
||||
#define POST_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
|
||||
struct Post {
|
||||
uint64_t id = 0;
|
||||
|
||||
std::string content = "";
|
||||
std::string user = "";
|
||||
std::time_t time = 0;
|
||||
uint64_t likes = 0;
|
||||
|
||||
uint64_t userId = 0;
|
||||
|
||||
std::string genHtml() const;
|
||||
|
||||
Post(const std::string& contentin, const std::string& user);
|
||||
Post(const std::string& contentin, uint64_t user);
|
||||
|
||||
// Constructor for DB
|
||||
Post(
|
||||
uint64_t id,
|
||||
const std::string& content,
|
||||
const std::string& user,
|
||||
std::time_t time,
|
||||
uint64_t likes
|
||||
) : id(id), content(content), user(user), time(time), likes(likes) {}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user