mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-16 17:11:37 +08:00
更新项目结构
This commit is contained in:
16
third-party/QtNetworkService/HttpRequest.cpp
vendored
16
third-party/QtNetworkService/HttpRequest.cpp
vendored
@@ -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);
|
||||
|
||||
|
||||
6
third-party/QtNetworkService/HttpRequest.h
vendored
6
third-party/QtNetworkService/HttpRequest.h
vendored
@@ -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__ << "; "
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ DEFINES += QT_APP_DEBUG
|
||||
|
||||
QT += network
|
||||
|
||||
CONFIG += staticlib
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
unix:TARGET = $$OUT_PWD/Lib/QtNetworkService
|
||||
|
||||
win32: {
|
||||
|
||||
Reference in New Issue
Block a user