30 lines
577 B
C++
30 lines
577 B
C++
#ifndef __TOKENS_H__
|
|
#define __TOKENS_H__
|
|
|
|
#include <Wt/Dbo/Types.h>
|
|
#include <Wt/WDateTime.h>
|
|
|
|
class User;
|
|
|
|
class Token : public Wt::Dbo::Dbo<Token> {
|
|
public:
|
|
Token();
|
|
Token(const std::string &value, const Wt::WDateTime &expires);
|
|
|
|
Wt::Dbo::ptr<User> user;
|
|
|
|
std::string value;
|
|
Wt::WDateTime expires;
|
|
|
|
template <class Action>
|
|
void persist(Action &a) {
|
|
Wt::Dbo::field(a, value, "value");
|
|
Wt::Dbo::field(a, expires, "expires");
|
|
|
|
Wt::Dbo::belongsTo(a, user, "user");
|
|
}
|
|
};
|
|
|
|
DBO_EXTERN_TEMPLATES(Token)
|
|
|
|
#endif // __TOKENS_H__
|