You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.0 KiB

#include "userdata.h"
#include "ruoyi/ruoyidatamanager.h"
UserData::UserData()
{
m_pDataManager = nullptr;
}
UserData::~UserData()
{
if(m_pDataManager)
{
delete m_pDataManager;
m_pDataManager = nullptr;
}
}
void UserData::SetManagerType(ManagerType type)
{
if(type == None)
{
m_pDataManager = new BaseDataManager;
}
else if(type == Ruoyi)
{
m_pDataManager = new RuoyiDataManager;
}
}
QPixmap UserData::GetVerificationCode()
{
if(m_pDataManager == nullptr)
return QPixmap();
else
return m_pDataManager->GetVerificationCode();
}
UserInfo UserData::Login(const QString &userName, const QString &password, const QString &code)
{
if(m_pDataManager == nullptr)
return UserInfo();
else
return m_pDataManager->Login(userName,password,code);
}
QList<QList<QString> > UserData::GetTrends(const TrendsRequestParam& requestParam)
{
if(m_pDataManager != nullptr)
return m_pDataManager->GetTrends(requestParam);
return QList<QList<QString> >();
}