更新项目结构

This commit is contained in:
metanoia1989
2020-11-13 22:57:37 +08:00
parent 8972425c7c
commit 66ef37c1ca
75 changed files with 465 additions and 43 deletions

View File

@@ -118,17 +118,17 @@ HttpRequest &HttpRequest::body(const QVariant &body)
m_body = QJsonDocument(QJsonObject::fromVariantMap(body.toMap())).toJson();
}
else {
warning << "This is not data in JSON format(QVariantMap or QJsonObject).";
log_warning << "This is not data in JSON format(QVariantMap or QJsonObject).";
m_body = QByteArray();
// warning output
}
}
else {
m_body = QByteArray();
warning << "Disable body.";
log_warning << "Disable body.";
}
debugger << "Body Content:" << m_body;
log_debugger << "Body Content:" << m_body;
return *this;
}
#endif
@@ -211,9 +211,9 @@ HttpResponse *HttpRequest::exec()
sendBuffer->setData(m_body);
}
debugger << "Http Client info: ";
debugger << "Type: " << s_httpOperation[m_op];
debugger << "Url: " << m_networkRequest.url().toString();
log_debugger << "Http Client info: ";
log_debugger << "Type: " << s_httpOperation[m_op];
log_debugger << "Url: " << m_networkRequest.url().toString();
QString headers;
for (int i = 0; i < m_networkRequest.rawHeaderList().count(); i++) {
QString each = m_networkRequest.rawHeaderList().at(i);
@@ -221,8 +221,8 @@ HttpResponse *HttpRequest::exec()
headers += QString("%1: %2;").arg(each)
.arg(header);
}
debugger << "Header: " << headers;
debugger << "Send buffer(Body):\r\n" << m_body;
log_debugger << "Header: " << headers;
log_debugger << "Send buffer(Body):\r\n" << m_body;
reply = m_httpService->createRequest(m_op, m_networkRequest, sendBuffer);

View File

@@ -19,15 +19,15 @@ LISCENSE: MIT
namespace AeaQt {
#ifdef QT_APP_DEBUG
#define debugger qDebug().noquote().nospace() \
#define log_debugger qDebug().noquote().nospace() \
<< "[AeaQt::Network] Debug: -> " \
<< "function: " << __func__ << "; " \
<< "line: " << __LINE__ << "; "
#else
#define debug QString()
#define log_debugger QString()
#endif
#define warning qWarning().noquote().nospace() \
#define log_warning qWarning().noquote().nospace() \
<< "[AeaQt::Network] Warning: -> " \
<< "function: " << __func__ << "; " \
<< "line: " << __LINE__ << "; "

View File

@@ -11,5 +11,5 @@ INCLUDEPATH += $$PWD/
QT += network
!CONFIG(QT_APP_MODE) {
LIBS += -L$$OUT_PWD/Lib -lQtNetworkService
LIBS += -L$$OUT_PWD/../third-party/QtNetworkService/Lib -lQtNetworkService
}

View File

@@ -13,8 +13,8 @@ DEFINES += QT_APP_DEBUG
QT += network
CONFIG += staticlib
TEMPLATE = lib
CONFIG += staticlib
unix:TARGET = $$OUT_PWD/Lib/QtNetworkService
win32: {