Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdParty/QtCurl
6 changes: 3 additions & 3 deletions App/App.pro
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ OTHER_FILES += \
dumpDBSchema.sh \
Schemas/Common.my.sql \
Schemas/CommonFuncs.my.sql \
Schemas/I18N.my.sql
Schemas/I18N.my.sql \
../conf/api.conf

# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-#
LIBS += -lTargomanAPIInterface \
-laws-cpp-sdk-s3

DISTFILES += \
conf/test.conf \
conf/api.server.conf \


12 changes: 12 additions & 0 deletions App/Server/RESTServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ void RESTServer::start(fnIsInBlackList_t _fnIPInBlackList)
Path<<
"?"<<
_req->url().query());

//----------------------------------
try
{
auto headers = _req->headers();
QStringList headersLog;
for (auto Iter = headers.begin(); Iter != headers.end(); ++Iter)
headersLog.append(QString(" %1: %2").arg(Iter.key().toStdString().c_str()).arg(Iter.value().toStdString().c_str()));
TargomanLogInfo(7, "headers: " << "\n" << headersLog.join("\n"));
} catch (...) {}

//----------------------------------
RequestHandler->process(Path.mid(ServerConfigs::BasePathWithVersion.size() - 1));
}
catch(exTargomanBase& ex)
Expand Down
2 changes: 1 addition & 1 deletion App/Server/clsRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void clsRequestHandler::process(const QString& _api)
{
TargomanLogInfo(7, "posted data: " << _data);

QByteArray ContentType= this->Request->headers().value("content-type");
QByteArray ContentType = this->Request->headers().value("content-type");

if (ContentType.isEmpty())
throw exHTTPBadRequest("No content-type header present");
Expand Down
7 changes: 5 additions & 2 deletions Interfaces/Common/APIArgHelperMacros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,14 @@
QT_TRY { \
TAPI::setFromVariant(_varName, _infoRec.value(_table::_tableFieldName)); \
} \
QT_CATCH (const std::exception &e) { \
qDebug() << "fieldName:" << #_tableFieldName << e.what(); \
QT_CATCH (const std::exception &exp) { \
TargomanDebug(5, "*** SET_FIELD_FROM_VARIANT_MAP *** ERROR: fieldName:" << #_tableFieldName << exp.what()); \
QT_RETHROW; \
}

#define SET_FIELD_FROM_VARIANT_MAP_SAME_NAME(_storage, _varName, _infoRec, _table) \
SET_FIELD_FROM_VARIANT_MAP(_storage _varName, _infoRec, _table, _varName)

#define C2DBL(v) INTERNAL_C2DBL(v)
#define C2U64(v) INTERNAL_C2DBL(v)
#define V2U64(v) INTERNAL_V2U64(v)
Expand Down
8 changes: 6 additions & 2 deletions Interfaces/DBM/QueryBuilders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,10 @@ QString clsCondition::buildConditionString(

CondStr += " LIKE '";
//makeValueAsSQL(
CondStr += conditionData.Value.value<QString>();
QString LikeVal = conditionData.Value.value<QString>();
if (LikeVal.indexOf("%") < 0)
LikeVal = "%" + LikeVal + "%";
CondStr += LikeVal;
CondStr += "'";
}
else if (conditionData.Operator == enuConditionOperator::In)
Expand Down Expand Up @@ -1205,7 +1208,7 @@ template <class itmplDerived, class itmplData>
tmplBaseQuery<itmplDerived, itmplData>::tmplBaseQuery(clsTable& _table, const QString& _alias) :
Data(new itmplData(_table, _alias)) {
if (_table.AllCols.isEmpty())
throw exQueryBuilder("Call prepareFiltersList on table before creating a QueryBuilder");
throw exQueryBuilder(QString("Call prepareFiltersList on table (%1) before creating a QueryBuilder").arg(_table.Name));
}

template <class itmplDerived, class itmplData>
Expand Down Expand Up @@ -3355,6 +3358,7 @@ QString getInvalidatedAtQueryString(clsTable& _table, bool _makeWithUniqeIndex,
return invalidateQueryString;
}

///TODO: BUG: the create query may results more than one rows, but only last inserted id returns by .execute
quint64 CreateQuery::execute(quint64 _currentUserID, QVariantMap _args, bool _useBinding)
{
stuBoundQueryString BoundQueryString = this->buildQueryString(_currentUserID, _args, _useBinding);
Expand Down
5 changes: 5 additions & 0 deletions Interfaces/DBM/clsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ void clsTable::prepareRelationsFiltersList(const QList<stuRelation> &_relations,
}
}

const QString clsTable::schema() const
{
return this->Schema;
}

const QString clsTable::domain()
{
if (this->Domain.length())
Expand Down
2 changes: 2 additions & 0 deletions Interfaces/DBM/clsTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ class clsTable //: public intfPureModule
const QVariant getDBProperty(const QString& _key);
const QString getStatusColumnName();

const QString schema() const;

protected:
/*inline */const QString domain();

Expand Down
Loading