Older/WebApplication/model/BlogSession.h
luocai 4021ffa190
Some checks failed
Deploy / PullDocker (push) Successful in 4s
Deploy / Build (push) Failing after 34s
Deploy Docker Images / Docusaurus build and Server deploy (push) Successful in 13s
add docker images.
2024-11-06 15:51:01 +08:00

35 lines
1.0 KiB
C++

#ifndef __BLOGSESSION_H__
#define __BLOGSESSION_H__
#include "BlogUserDatabase.h"
#include <Wt/Auth/Login.h>
#include <Wt/Auth/OAuthService.h>
#include <Wt/Dbo/Session.h>
#include <Wt/Dbo/backend/Sqlite3.h>
class Comment;
class BlogSession : public Wt::Dbo::Session {
public:
BlogSession(Wt::Dbo::SqlConnectionPool &connectionPool);
static void configureAuth();
static std::unique_ptr<Wt::Dbo::SqlConnectionPool> createConnectionPool(const std::string &sqlite3);
Wt::Auth::Login &login() {
return m_login;
}
Wt::Dbo::ptr<User> user() const;
Wt::Signal<Wt::Dbo::ptr<Comment>> &commentsChanged();
BlogUserDatabase &users() {
return m_users;
}
Wt::Auth::PasswordService *passwordAuth() const;
const std::vector<const Wt::Auth::OAuthService *> &oAuth() const;
private:
Wt::Dbo::SqlConnectionPool &m_connectionPool;
BlogUserDatabase m_users;
Wt::Auth::Login m_login;
Wt::Signal<Wt::Dbo::ptr<Comment>> m_commentsChanged;
};
#endif // __BLOGSESSION_H__