Older/Database/VisitorRecord.h

25 lines
614 B
C
Raw Permalink Normal View History

2024-11-27 00:08:24 +08:00
#ifndef __VISITORRECORD_H__
#define __VISITORRECORD_H__
#include <Wt/Dbo/Dbo.h>
class VisitorRecord {
public:
2024-11-29 20:01:10 +08:00
int id = -1;
2024-11-27 00:08:24 +08:00
std::string url;
std::string userAgent;
std::string visitorUuid;
std::chrono::system_clock::time_point time;
template <class Action>
void persist(Action &a) {
Wt::Dbo::field(a, url, "url");
Wt::Dbo::field(a, userAgent, "user_agent");
Wt::Dbo::field(a, visitorUuid, "visitor_uuid");
Wt::Dbo::field(a, time, "time");
}
};
2024-11-29 20:01:10 +08:00
using VisitorRecords = Wt::Dbo::collection<Wt::Dbo::ptr<VisitorRecord>>;
2024-11-27 00:08:24 +08:00
#endif // __VISITORRECORD_H__