Older/Database/Session.h

25 lines
563 B
C
Raw Normal View History

2024-10-31 19:40:29 +08:00
#ifndef __SESSION_H__
#define __SESSION_H__
2024-11-26 22:58:54 +08:00
#include "HomeBox.h"
#include "Task.h"
2024-11-11 19:21:48 +08:00
#include "User.h"
2024-10-31 19:40:29 +08:00
#include <Wt/Auth/Login.h>
#include <Wt/Dbo/Session.h>
using UserDatabase = Wt::Auth::Dbo::UserDatabase<AuthInfo>;
class Session : public Wt::Dbo::Session {
public:
2024-11-14 23:06:22 +08:00
Session(Wt::Dbo::SqlConnectionPool &connectionPool);
2024-10-31 19:40:29 +08:00
~Session();
2024-11-14 23:06:22 +08:00
Wt::Dbo::ptr<User> user() const;
2024-10-31 19:40:29 +08:00
Wt::Auth::AbstractUserDatabase &users();
Wt::Auth::Login &login();
private:
std::unique_ptr<UserDatabase> m_users;
Wt::Auth::Login m_login;
};
#endif // __SESSION_H__