This commit is contained in:
Vladimir N. Korotenko
2025-11-28 09:15:36 +03:00
parent 61ae56d030
commit b367f4b3dc
5 changed files with 10 additions and 96 deletions

View File

@@ -625,9 +625,7 @@ int Deals::Negative()
jsf = ReplaceAll(jsf, "leave_before", "leave-before");
data = "curl -s --location '";
data.append(address);
data.append("/api/v1/deal/feedback?server=");
data.append(url_encode(address));
data.append("'");
data.append("/api/v1/deal/feedback'");
data.append(" --header 'Content-Type: application/json' ");
data.append("--data '");
data.append(jsf);

View File

@@ -3,17 +3,21 @@
#include <iostream>
#include <algorithm>
std::string Replace(std::string source, std::string from, std::string out) {
std::string Replace(std::string source, std::string from, std::string out)
{
std::string res("");
size_t start = 0, stop = 0;
start = source.find(from);
stop = from.length();
if (start >= 0) res = source.replace(start, stop, out);
if (start >= 0)
res = source.replace(start, stop, out);
return res;
}
std::string ReplaceAll(std::string str, const std::string& from, const std::string& to) {
std::string ReplaceAll(std::string str, const std::string &from, const std::string &to)
{
size_t start_pos = 0;
while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
while ((start_pos = str.find(from, start_pos)) != std::string::npos)
{
str.replace(start_pos, from.length(), to);
start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
}
@@ -22,6 +26,6 @@ std::string ReplaceAll(std::string str, const std::string& from, const std::stri
int NoResponse(std::string mgs)
{
std::cout << "No response from the server." + mgs << std::endl;
std::cout << "No response from the server. " + mgs << std::endl;
return 1;
}

BIN
dm-cli/dm-cli Normal file

Binary file not shown.