Older/Database/VisitorRecord.h
luocai 6803f84677
Some checks failed
Deploy / Build (push) Failing after 2m55s
fix model.
2024-11-29 20:01:10 +08:00

25 lines
614 B
C++

#ifndef __VISITORRECORD_H__
#define __VISITORRECORD_H__
#include <Wt/Dbo/Dbo.h>
class VisitorRecord {
public:
int id = -1;
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");
}
};
using VisitorRecords = Wt::Dbo::collection<Wt::Dbo::ptr<VisitorRecord>>;
#endif // __VISITORRECORD_H__