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.1 KiB
52 lines
1.1 KiB
#ifndef DATAMANAGERBASE_H
|
|
#define DATAMANAGERBASE_H
|
|
#include <QObject>
|
|
#include <QHash>
|
|
|
|
class DataManagerBase
|
|
{
|
|
public:
|
|
enum ExcuteType{
|
|
none = 0, //当前为空
|
|
decode = 1, //执行解析
|
|
getData //执行获取数据
|
|
};
|
|
public:
|
|
ExcuteType toExcuteType(){ return type;}
|
|
void setExcuteType(ExcuteType t){type = t;}
|
|
|
|
virtual void doExcute() = 0;
|
|
|
|
//解析文件 插入数据库
|
|
virtual void decodeToMysql() = 0;
|
|
|
|
//
|
|
virtual void getDataFromMysql() = 0;
|
|
|
|
void setDecodeFile(QString filePath){decodeFilePath = filePath;}
|
|
|
|
QString getDecodeFile(){return decodeFilePath;}
|
|
|
|
void setDataDate(QString date){decodeDate = date;}
|
|
|
|
QString getDataDate(){return decodeDate;}
|
|
|
|
void clearParam(){
|
|
params.clear();
|
|
}
|
|
void addParam(QString key,QString value){
|
|
params.insert(key,value);
|
|
}
|
|
QString getParam(QString key){
|
|
return params.value(key);
|
|
}
|
|
|
|
private:
|
|
QString decodeFilePath;
|
|
QString decodeDate;
|
|
ExcuteType type = decode;
|
|
QHash<QString,QString> params;//参数
|
|
};
|
|
|
|
#endif // DATAMANAGERBASE_H
|