Начал реализовывать обмен запросами к БД

This commit is contained in:
krivoshein
2024-12-06 11:15:02 +03:00
parent 53b37240eb
commit 2f48cf3921
107 changed files with 938 additions and 1189 deletions

View File

@@ -69,6 +69,8 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
connect(processingSystem,&ProcessingSystem::sigLogMessage,logger,&Logger::addTextToLogger);
connect(this,&ServerLMSWidget::sigLog,logger,&Logger::addTextToLogger);
connect(processingSystem,&ProcessingSystem::sigAuthChanged,this, &ServerLMSWidget::slot_AuthChanged);
on_btnStartServer_clicked();
first = true;
@@ -189,6 +191,21 @@ void ServerLMSWidget::slot_BlockAutorization(bool block)
unBlockAutorization();
}
void ServerLMSWidget::slot_AuthChanged()
{
//Проходим все открытые сокеты
foreach(int idSocket, clientsMap.keys())
{
//Проверяем, есть ли клиенты TYPE_GUI
if(clientsMap[idSocket]->getClient()->getTypeClient() == TypeClientAutorization::TYPE_GUI)
{//Отправляем этому клиенту обновление списков
ClientQueryToDB queryToDB;
queryToDB.typeQuery = TypeQueryToDB::TYPE_QUERY_GET_LIST_INSTRUCTORS;
processingSystem->processingClientQueryToDB(clientsMap[idSocket], queryToDB);
}
}
}
void ServerLMSWidget::removeClient(int idSocket)
{
clientsMap.remove(idSocket);