Older/WebApplication/model/Token.h

30 lines
577 B
C
Raw Normal View History

2024-11-02 00:30:14 +08:00
#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__