feat: Remove req lib reference
This commit is contained in:
@@ -1,36 +1,16 @@
|
||||
#include "notify.h"
|
||||
#include "Request.h"
|
||||
#include "log/log.h"
|
||||
namespace Recon {
|
||||
std::string ReconID;
|
||||
Req::Request req;
|
||||
bool notifyStart(const std::string& aReconID ){
|
||||
ReconID = aReconID;
|
||||
Req::Request::Init();
|
||||
req.setClientCertificate("/home/krad/workdir/ReconTester/client.crt","/home/krad/workdir/ReconTester/client.key");
|
||||
std::string str = "{\"ReconID\": \""+ReconID+"\"}";
|
||||
std::unordered_map<std::string, std::string> headers;
|
||||
headers["Content-Type"] = "application/json";
|
||||
auto resp = req.post("https://localhost:5002/Task/Start/",str,headers);
|
||||
return resp->httpCode() == 200;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool notifyFinish(){
|
||||
std::string str = "{\"ReconID\": \""+ReconID+"\"}";
|
||||
std::unordered_map<std::string, std::string> headers;
|
||||
headers["Content-Type"] = "application/json";
|
||||
auto resp = req.post("https://localhost:5002/Task/Finish/",str,headers);
|
||||
Req::Request::Dispose();
|
||||
return resp->httpCode() == 200;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool notifyProgress( int percent){
|
||||
char buffer[2048] = {0};
|
||||
sprintf(buffer, "https://localhost:5002/Task/Notify/%d/", percent);
|
||||
std::string str = "{\"ReconID\": \""+ReconID+"\"}";
|
||||
std::unordered_map<std::string, std::string> headers;
|
||||
headers["Content-Type"] = "application/json";
|
||||
auto resp = req.post(buffer,str,headers);
|
||||
return resp->httpCode() == 200;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user