6 Star 3 Fork 2

GPLme / SG-Database

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dbProcess.h 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
ECIR 提交于 2021-04-17 21:16 . 增加日志功能
#pragma once
#include <iostream>
#include <string>
#include <queue>
#include <QVariant>
#include <tableManager.h>
#include "view.h"
#include "aggHelper.h"
#include "logger.h"
using namespace std;
class dbProcess
{
static table* countTable;
public:
static queue<processObject> processQueue;
static queue<processObject> correspondQueue;
static void setCount(table* table)
{
table->setSystemManage();
countTable=table;
}
static bool checkCount(const processObject& obj){
string userName=obj.getUser();
string passWord=obj.getPassWord();
vector<int> countVec=countTable->find({"(x=='"+userName+"')","(x=='"+passWord+"')"});
if(countVec.empty()){
return false;
}
return true;
}
static void processRequst(){
if(processQueue.empty()){
return;
}
processObject tmpProcess=processQueue.front();
processQueue.pop();
tableManager::setcurOperatUser(tmpProcess.getUser());
if(checkCount(tmpProcess)==false){
tmpProcess.setResult("Account password error");
}
else
{
QString mistake;
QVariant varResult=JSEval(QString::fromStdString(tmpProcess.getJS()),"eval",&mistake,view::viewmanager->getViewJSVM());
if(varResult==NULL)
{
tmpProcess.setResult(mistake.toStdString());
}
else
{
tmpProcess.setResult(varResult.toString().toStdString());
}
}
if(tmpProcess.getResult()==""){
tmpProcess.setResult("Run successfully");
}
correspondQueue.push(tmpProcess);
#ifdef StartLogger
logger::writeLog(tmpProcess);
#endif
tableManager::tablemanager->doManage();
#ifdef autoRecovery
manageContain::reset();
#endif
}
};
C++
1
https://gitee.com/sg-first/SG-Database.git
git@gitee.com:sg-first/SG-Database.git
sg-first
SG-Database
SG-Database
master

搜索帮助