DPS/DataPlatform/Connection.h

46 lines
1.2 KiB
C
Raw Normal View History

2025-06-23 10:41:33 +08:00
#pragma once
#include<QObject>
#include<QString>
#include "json.hpp"
using json = nlohmann::json;
class Connection : QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ getName WRITE setName)
Q_PROPERTY(bool status READ getStatus WRITE setStatus)
Q_PROPERTY(QString type READ getType WRITE setType)
Q_PROPERTY(QString path READ getPath WRITE setPath)
Q_PROPERTY(QString time READ getTime WRITE setTime)
public:
Connection();
~Connection();
int getID() { return _id; }
void setID(int id) { _id = id; }
QString getName() { return _name; }
void setName(QString name) { _name = name; }
QString getType() { return _type; }
void setType(QString type) { _type = type; }
QString getPath() { return _path; }
void setPath(QString path) { _path = path; }
QString getTime() { return _time; }
void setTime(QString time) { _time = time; }
bool getStatus() { return _status; }
void setStatus(bool status) { _status = status; }
void toJson(json& jsonObj);
void save(json parameter);
private:
int _id = -1;
QString _name; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool _status = false; //<2F><><EFBFBD><EFBFBD>״̬ true = <20><><EFBFBD><EFBFBD> false = ʧ<><CAA7>
QString _type; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
QString _path; //·<><C2B7>
QString _time; //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
};