完成RequestBase构造函数个getConfig()函数
This commit is contained in:
83
netio.h
Normal file
83
netio.h
Normal file
@ -0,0 +1,83 @@
|
||||
//
|
||||
// Created by HW on 2023/07/27.
|
||||
//
|
||||
|
||||
#ifndef OFFICEASSISTANT_NETIO_H
|
||||
#define OFFICEASSISTANT_NETIO_H
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
#include <cstring>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
QString img;
|
||||
QString img_cover;
|
||||
QString title;
|
||||
QString func;
|
||||
QString url;
|
||||
} Menu;
|
||||
typedef struct {
|
||||
bool succeed;
|
||||
struct {
|
||||
QString logo_url;
|
||||
QString device_id;
|
||||
QString dev_id;
|
||||
QString token;
|
||||
QString backgroud_color;
|
||||
QString title_color;
|
||||
QString title_cover_color;
|
||||
}basic;
|
||||
Menu *menu;
|
||||
}ConfigResponse;
|
||||
|
||||
class RequestBodyBase:public QObject{
|
||||
public:
|
||||
RequestBodyBase(QString requestId);
|
||||
protected:
|
||||
QString product;
|
||||
QString partner_id;
|
||||
QString os;
|
||||
QString os_version;
|
||||
QString device_id;
|
||||
QString request_id;
|
||||
QString version;
|
||||
QString release;
|
||||
QString sign;
|
||||
QJsonDocument qJsonDocument;
|
||||
};
|
||||
class ConfigRequest:public RequestBodyBase{
|
||||
public:
|
||||
ConfigRequest(QString requestId):RequestBodyBase(requestId){}
|
||||
void getConfig(ConfigResponse * configResponse);
|
||||
};
|
||||
class OpRequest:public RequestBodyBase{
|
||||
public:
|
||||
OpRequest(QString Op,QString OpValue,QString requestId):RequestBodyBase(requestId),op(Op),op_value(OpValue){}
|
||||
QString getOpValue(){
|
||||
return op_value;
|
||||
}
|
||||
QString getOp(){
|
||||
return op;
|
||||
}
|
||||
void setOpValue(QString op_value){
|
||||
this->op_value=op_value;
|
||||
}
|
||||
void setOp(QString op){
|
||||
this->op=op;
|
||||
}
|
||||
protected:
|
||||
QString op;
|
||||
QString op_value;
|
||||
};
|
||||
|
||||
class DeviceRequest:RequestBodyBase{
|
||||
DeviceRequest(QString requestId):RequestBodyBase(requestId){}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //OFFICEASSISTANT_NETIO_H
|
Reference in New Issue
Block a user