Older/WebApplication/model/Token.h
amass b6e0681489
All checks were successful
Deploy / PullDocker (push) Successful in 4s
Deploy / Build (push) Successful in 2m8s
Deploy Docker Images / Docusaurus build and Server deploy (push) Successful in 13s
add code.
2024-11-02 00:30:14 +08:00

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__