Committing updates.

This commit is contained in:
Преподобный Ален
2022-07-03 18:01:40 +03:00
parent 024103ff93
commit fd24410ee4
6 changed files with 928 additions and 50 deletions

View File

@@ -42,14 +42,6 @@ namespace Apostol {
namespace Module {
CString to_string(unsigned long Value) {
TCHAR szString[_INT_T_LEN + 1] = {0};
sprintf(szString, "%lu", Value);
return {szString};
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//-- CWebService -----------------------------------------------------------------------------------------------
@@ -487,7 +479,7 @@ namespace Apostol {
}
//--------------------------------------------------------------------------------------------------------------
void CWebService::DoUser(CHTTPServerConnection *AConnection, const CString& Method, const CString& URI) {
void CWebService::DoAccount(CHTTPServerConnection *AConnection, const CString& Method, const CString& URI) {
auto pProxy = GetProxy(AConnection);
auto pServerRequest = AConnection->Request();
@@ -679,8 +671,8 @@ namespace Apostol {
}
}
//DebugMessage("[DoUser] Server request:\n%s\n", pServerRequest->Content.c_str());
//DebugMessage("[DoUser] sPayload:\n%s\n", sPayload.c_str());
//DebugMessage("[DoAccount] Server request:\n%s\n", pServerRequest->Content.c_str());
//DebugMessage("[DoAccount] sPayload:\n%s\n", sPayload.c_str());
CJSON Json(jvtObject);
@@ -718,6 +710,7 @@ namespace Apostol {
const auto DateTime = UTC();
const auto Date = StringToDate(Data.Date);
const auto Sum = BTCToDouble(Data.Payment.Sum);
if (Data.Order == doCreate) {
if (DateTime < Date)
@@ -1135,9 +1128,6 @@ namespace Apostol {
}
}
//DebugMessage("[DoDeal] Server request:\n%s\n", pServerRequest->Content.c_str());
//DebugMessage("[DoDeal] sPayload:\n%s\n", sPayload.c_str());
CJSON Json(jvtObject);
Json.Object().AddPair("id", ApostolUID());
@@ -1277,7 +1267,7 @@ namespace Apostol {
} else if (caCommand == "time") {
pReply->Content << "{\"serverTime\": " << to_string(MsEpoch()) << "}";
pReply->Content << "{\"serverTime\": " << ToString(MsEpoch()) << "}";
AConnection->SendReply(CHTTPReply::ok);
@@ -1285,13 +1275,13 @@ namespace Apostol {
pRequest->Content.Clear();
DoUser(AConnection, "GET", sRoute);
DoAccount(AConnection, "GET", sRoute);
} else if (caCommand == "account" && caAction == "status") {
pRequest->Content.Clear();
DoUser(AConnection, "GET", sRoute);
DoAccount(AConnection, "GET", sRoute);
} else if (caCommand == "deal" && caAction == "status") {
@@ -1428,7 +1418,7 @@ namespace Apostol {
if (caCommand == "account") {
DoUser(AConnection, "POST", sRoute);
DoAccount(AConnection, "POST", sRoute);
} else if (caCommand == "deal") {
@@ -1709,6 +1699,13 @@ namespace Apostol {
}
//--------------------------------------------------------------------------------------------------------------
CString CWebService::ToString(unsigned long Value) {
TCHAR szString[_INT_T_LEN + 1] = {0};
sprintf(szString, "%lu", Value);
return { szString };
}
//--------------------------------------------------------------------------------------------------------------
}
}
}