From 1c9af2aae9cee6d679d046a612abe3a4065028e3 Mon Sep 17 00:00:00 2001 From: kradchen Date: Wed, 12 Jun 2024 13:07:18 +0800 Subject: [PATCH] feat: Remove req lib reference --- CMakeLists.txt | 5 +---- src/log/notify.cpp | 26 +++----------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f8080e..70ee0dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") find_package(Aurora REQUIRED) find_package(Parser REQUIRED) -find_package(Req REQUIRED) find_package(URDepends REQUIRED) find_package(DCMTK REQUIRED) set(DCMTK_WITH_JPEG OFF) @@ -26,14 +25,12 @@ add_executable(UR ${cpp_files} ${cu_files} ${cxx_files} ${header_files} ${Auror target_include_directories(UR PUBLIC ./src/) target_include_directories(UR PUBLIC ${Aurora_INCLUDE_DIRS}) target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS}) -target_include_directories(UR PUBLIC ${Req_INCLUDES_DIRS}) target_include_directories(UR PUBLIC ${Parser_INCLUDE_DIRS}) target_include_directories(UR PUBLIC ${URDepends_INCLUDES_DIRS}) target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS}) target_link_libraries(UR PUBLIC ${Aurora_Libraries}) target_link_libraries(UR PUBLIC dcmdata) target_link_libraries(UR PUBLIC matio) -target_link_libraries(UR PUBLIC Req) target_link_libraries(UR PUBLIC Parser) target_link_libraries(UR PUBLIC URDepends::TransDetection) @@ -65,7 +62,7 @@ enable_testing() file(GLOB_RECURSE test_cpp test/*.cpp) add_executable(UR_Test ${cpp_files} ${header_files} ${Aurora_Source} ${test_cpp} ) target_include_directories(UR_Test PUBLIC ./test/ ./src/) -target_compile_options(UR_Test PUBLIC ${Aurora_Complie_Options} "-march=native") +# target_compile_options(UR_Test PUBLIC ${Aurora_Complie_Options} "-march=native") target_include_directories(UR_Test PUBLIC ${DCMTK_INCLUDE_DIRS}) target_include_directories(UR_Test PUBLIC ${Aurora_INCLUDE_DIRS}) target_include_directories(UR_Test PUBLIC ${Parser_INCLUDE_DIRS}) diff --git a/src/log/notify.cpp b/src/log/notify.cpp index 7731520..e30b435 100644 --- a/src/log/notify.cpp +++ b/src/log/notify.cpp @@ -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 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 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 headers; - headers["Content-Type"] = "application/json"; - auto resp = req.post(buffer,str,headers); - return resp->httpCode() == 200; + return true; } } \ No newline at end of file